~ubuntu-branches/ubuntu/saucy/blender/saucy-proposed

« back to all changes in this revision

Viewing changes to extern/Eigen3/Eigen/src/Core/products/GeneralMatrixVector.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
//
4
4
// Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr>
5
5
//
6
 
// Eigen is free software; you can redistribute it and/or
7
 
// modify it under the terms of the GNU Lesser General Public
8
 
// License as published by the Free Software Foundation; either
9
 
// version 3 of the License, or (at your option) any later version.
10
 
//
11
 
// Alternatively, you can redistribute it and/or
12
 
// modify it under the terms of the GNU General Public License as
13
 
// published by the Free Software Foundation; either version 2 of
14
 
// the License, or (at your option) any later version.
15
 
//
16
 
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
17
 
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18
 
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
19
 
// GNU General Public License for more details.
20
 
//
21
 
// You should have received a copy of the GNU Lesser General Public
22
 
// License and a copy of the GNU General Public License along with
23
 
// Eigen. If not, see <http://www.gnu.org/licenses/>.
 
6
// This Source Code Form is subject to the terms of the Mozilla
 
7
// Public License v. 2.0. If a copy of the MPL was not distributed
 
8
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
24
9
 
25
10
#ifndef EIGEN_GENERAL_MATRIX_VECTOR_H
26
11
#define EIGEN_GENERAL_MATRIX_VECTOR_H
27
12
 
 
13
namespace Eigen { 
 
14
 
28
15
namespace internal {
29
16
 
30
17
/* Optimized col-major matrix * vector product:
40
27
 *  |cplx |real |cplx | invalid, the caller has to do tmp: = A * B; C += alpha*tmp
41
28
 *  |cplx |real |real | optimal case, vectorization possible via real-cplx mul
42
29
 */
43
 
template<typename Index, typename LhsScalar, bool ConjugateLhs, typename RhsScalar, bool ConjugateRhs>
44
 
struct general_matrix_vector_product<Index,LhsScalar,ColMajor,ConjugateLhs,RhsScalar,ConjugateRhs>
 
30
template<typename Index, typename LhsScalar, bool ConjugateLhs, typename RhsScalar, bool ConjugateRhs, int Version>
 
31
struct general_matrix_vector_product<Index,LhsScalar,ColMajor,ConjugateLhs,RhsScalar,ConjugateRhs,Version>
45
32
{
46
33
typedef typename scalar_product_traits<LhsScalar, RhsScalar>::ReturnType ResScalar;
47
34
 
99
86
  
100
87
  // How many coeffs of the result do we have to skip to be aligned.
101
88
  // Here we assume data are at least aligned on the base scalar type.
102
 
  Index alignedStart = first_aligned(res,size);
 
89
  Index alignedStart = internal::first_aligned(res,size);
103
90
  Index alignedSize = ResPacketSize>1 ? alignedStart + ((size-alignedStart) & ~ResPacketAlignedMask) : 0;
104
91
  const Index peeledSize  = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
105
92
 
109
96
                       : FirstAligned;
110
97
 
111
98
  // we cannot assume the first element is aligned because of sub-matrices
112
 
  const Index lhsAlignmentOffset = first_aligned(lhs,size);
 
99
  const Index lhsAlignmentOffset = internal::first_aligned(lhs,size);
113
100
 
114
101
  // find how many columns do we have to skip to be aligned with the result (if possible)
115
102
  Index skipColumns = 0;
296
283
 *  - alpha is always a complex (or converted to a complex)
297
284
 *  - no vectorization
298
285
 */
299
 
template<typename Index, typename LhsScalar, bool ConjugateLhs, typename RhsScalar, bool ConjugateRhs>
300
 
struct general_matrix_vector_product<Index,LhsScalar,RowMajor,ConjugateLhs,RhsScalar,ConjugateRhs>
 
286
template<typename Index, typename LhsScalar, bool ConjugateLhs, typename RhsScalar, bool ConjugateRhs, int Version>
 
287
struct general_matrix_vector_product<Index,LhsScalar,RowMajor,ConjugateLhs,RhsScalar,ConjugateRhs,Version>
301
288
{
302
289
typedef typename scalar_product_traits<LhsScalar, RhsScalar>::ReturnType ResScalar;
303
290
 
351
338
  // How many coeffs of the result do we have to skip to be aligned.
352
339
  // Here we assume data are at least aligned on the base scalar type
353
340
  // if that's not the case then vectorization is discarded, see below.
354
 
  Index alignedStart = first_aligned(rhs, depth);
 
341
  Index alignedStart = internal::first_aligned(rhs, depth);
355
342
  Index alignedSize = RhsPacketSize>1 ? alignedStart + ((depth-alignedStart) & ~RhsPacketAlignedMask) : 0;
356
343
  const Index peeledSize  = peels>1 ? alignedStart + ((alignedSize-alignedStart) & ~PeelAlignedMask) : alignedStart;
357
344
 
361
348
                         : FirstAligned;
362
349
 
363
350
  // we cannot assume the first element is aligned because of sub-matrices
364
 
  const Index lhsAlignmentOffset = first_aligned(lhs,depth);
 
351
  const Index lhsAlignmentOffset = internal::first_aligned(lhs,depth);
365
352
 
366
353
  // find how many rows do we have to skip to be aligned with rhs (if possible)
367
354
  Index skipRows = 0;
556
543
 
557
544
} // end namespace internal
558
545
 
 
546
} // end namespace Eigen
 
547
 
559
548
#endif // EIGEN_GENERAL_MATRIX_VECTOR_H