Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7432793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:30:53+00:00 2026-05-29T09:30:53+00:00

The scipy document gives examples of Blitz++ style operations when using weave.blitz() and C

  • 0

The scipy document gives examples of Blitz++ style operations when using weave.blitz() and C style indexing when using weave.inline(). Does weave.inline() also support Blitz++ style indexing and reductions. That will be very convenient. If weave.inline() does indeed allow Blitz++ style indexing, could you tell me how to get a Blitz array from a numpy array in the weave.inline() code. Much appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:30:54+00:00Added an answer on May 29, 2026 at 9:30 am

    Here is an example, set the type_converter = weave.converters.blitz when calling weave.inline()

    # -*- coding: utf-8 -*-
    import scipy.weave as weave
    import numpy as np
    import time
    
    def my_sum(a):
        n=int(len(a))
        code="""
        int i;
    
        double counter;
        counter =0;
        for(i=0;i<n;i++){
            counter=counter+a(i);
        }
        return_val=counter;
        """
    
        err=weave.inline(  
            code,   
            ['a','n'],   
            type_converters=weave.converters.blitz, 
            compiler="gcc"  
        )
        return err
    
    a = np.arange(0, 10000000, 1.0)
    print my_sum(a)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What does the following error: Warning: overflow encountered in exp in scipy/numpy using Python
Has anyone tried compiling SciPy 0.7.1 on Windows using numpy-1.3.0 that was built with
I am using Scipy to construct a large, sparse (250k X 250k) co-occurrence matrix
I am using scipy-cluster in my application. It provides a function to plot a
I have been using the scipy.stats.invgamma.rvs function to randomly select values from an inverse
Does anyone know of an alternative for scipy.stats.norm.pdf()? I'm hosting my python site on
i am using this: http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html i have an list a that i want to
I use the latest version of numpy/scipy. The following script does not work: import
When testing scipy using the nose package using scipy.test() , the test fails under
I am currently using scipy's linregress function for single regression. I am unable to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.