/usr/include/casacore/scimath/Mathematics/RigidVector.tcc is in casacore-dev 2.2.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | //# RigidVector.cc: Fast Vector classes with fixed (templated) length
//# Copyright (C) 1996,1998,2001
//# Associated Universities, Inc. Washington DC, USA.
//#
//# This library is free software; you can redistribute it and/or modify it
//# under the terms of the GNU Library General Public License as published by
//# the Free Software Foundation; either version 2 of the License, or (at your
//# option) any later version.
//#
//# This library is distributed in the hope that it will be useful, but WITHOUT
//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
//# License for more details.
//#
//# You should have received a copy of the GNU Library General Public License
//# along with this library; if not, write to the Free Software Foundation,
//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
//#
//# Correspondence concerning AIPS++ should be addressed as follows:
//# Internet email: aips2-request@nrao.edu.
//# Postal address: AIPS++ Project Office
//# National Radio Astronomy Observatory
//# 520 Edgemont Road
//# Charlottesville, VA 22903-2475 USA
//#
//# $Id$
#ifndef SCIMATH_RIGIDVECTOR_TCC
#define SCIMATH_RIGIDVECTOR_TCC
#include <casacore/scimath/Mathematics/RigidVector.h>
#include <casacore/scimath/Mathematics/SquareMatrix.h>
namespace casacore { //# NAMESPACE CASACORE - BEGIN
template <class T, Int n>
RigidVector<T,n>&
RigidVector<T,n>::operator*=(const SquareMatrix<T,n>& m) {
switch (m.type_p) {
case SquareMatrix<T,n>::ScalarId: {
for (Int i=0; i<n; i++) v_p[i]*=m.a_p[0][0];
return *this;
}
case SquareMatrix<T,n>::Diagonal: {
for (Int i=0; i<n; i++) v_p[i]*=m.a_p[i][i];
return *this;
}
// case SquareMatrix<T,n>::General:
default:
{
T v[n], tmp;
Int i;
for (i=0; i<n; i++) v[i]=v_p[i];
for (i=0; i<n; i++) {
v_p[i]=m.a_p[i][0]; v_p[i]*=v[0];
for (Int j=1; j<n; j++) {
//#v_p[i]+=m.a_p[i][j]*v[j]; inlining fails
tmp=m.a_p[i][j]; tmp*=v[j]; v_p[i]+=tmp;
}
}
return *this;
}
}
}
template <class T, Int n>
RigidVector<T,n> sqrt(const RigidVector<T,n>& v) {
RigidVector<T,n> tmp;
for (Int i=0; i<n; i++) tmp.v_p[i]=::sqrt(v.v_p[i]);
return tmp;
}
// // Needed for Image<RigidVector>
// template <class T, Int n>
// void* RigidVector<T,n>::newCopyInfo (const TableRecord&, const IPosition&)
// { return 0; }
// template <class T, Int n>
// void RigidVector<T,n>::deleteCopyInfo (void*)
// {}
// // For set and get, we don't need to do anything sophisticated
// template <class T, Int n>
// void RigidVector<T,n>::set (void* ci, void* vout,
// const Array<T>& in,
// const IPosition& shape)
// {
// Array<RigidVector<T,n> >& out = *(Array<RigidVector<T,n> >*)vout;
// if (shape.nelements() == 1 && shape(0) == n) {
// retypedArrayEngineSet (out, in);
// }else{
// throw (DataManError ("RigidVector<T,n>::set"));
// }
// }
// template <class T, Int n>
// void RigidVector<T,n>::get (void* ci, Array<T>& out,
// const void* vin,
// const IPosition& shape)
// {
// const Array<RigidVector<T,n> >& in = *(const Array<RigidVector<T,n> >*)vin;
// if (shape.nelements() == 1 && shape(0) == n) {
// retypedArrayEngineGet (out, in);
// }else{
// throw (DataManError ("RigidVector<T,n>::get"));
// }
// }
} //# NAMESPACE CASACORE - END
#endif
|