Changeset 1105286 in sasmodels


Ignore:
Timestamp:
Feb 7, 2017 2:41:16 PM (8 years ago)
Author:
GitHub <noreply@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
3a45c2c, a769b54, 7b7fcf0, 130d4c7
Parents:
fe8ff99 (diff), d2b939c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Paul Kienzle <pkienzle@…> (02/07/17 14:41:16)
git-committer:
GitHub <noreply@…> (02/07/17 14:41:16)
Message:

Merge pull request #26 from SasView?/ticket-794

Allow for (rare) cases where the size of q_input is smaller than result. Fixes #794.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelcl.py

    r7fcdc9f rd2b939c  
    465465        # architectures tested so far. 
    466466        if self.is_2d: 
    467             # Note: 17 rather than 15 because results is 2 elements 
    468             # longer than input. 
    469             width = ((self.nq+17)//16)*16 
     467            # Note: 16 rather than 15 because result is 1 longer than input. 
     468            width = ((self.nq+16)//16)*16 
    470469            self.q = np.empty((width, 2), dtype=dtype) 
    471470            self.q[:self.nq, 0] = q_vectors[0] 
    472471            self.q[:self.nq, 1] = q_vectors[1] 
    473472        else: 
    474             # Note: 33 rather than 31 because results is 2 elements 
    475             # longer than input. 
    476             width = ((self.nq+33)//32)*32 
     473            # Note: 32 rather than 31 because result is 1 longer than input. 
     474            width = ((self.nq+32)//32)*32 
    477475            self.q = np.empty(width, dtype=dtype) 
    478476            self.q[:self.nq] = q_vectors[0] 
     
    524522        self.dim = '2d' if q_input.is_2d else '1d' 
    525523        # plus three for the normalization values 
    526         self.result = np.empty(q_input.nq+3, dtype) 
     524        self.result = np.empty(q_input.nq+1, dtype) 
    527525 
    528526        # Inputs and outputs for each kernel call 
Note: See TracChangeset for help on using the changeset viewer.