/usr/include/linbox/blackbox/dense.inl is in liblinbox-dev 1.1.6~rc0-4.1.
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 114 115 116 117 118 119 120 121 122 | /* -*- mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* linbox/blackbox/dense.inl
* Copyright (C) 2001 B. David Saunders,
* 2001-2002 Bradford Hovinen,
* 2002 Zhendong Wan
*
* Written by B. David Saunders <saunders@cis.udel.edu>,
* Bradford Hovinen <hovinen@cis.udel.edu>,
* Zhendong Wan <wan@mail.eecis.udel.edu>
*
* evolved from dense-matrix.h by -bds, Zhendong Wan
*
* --------------------------------------------------------
* 2002-10-27 Bradford Hovinen <hovinen@cis.udel.edu>
*
* Split out container/iterator functionality into DenseMatrixBase
* --------------------------------------------------------
* 2002-08-09 Bradford Hovinen <hovinen@cis.udel.edu>
*
* Renamed file from dense-matrix1.C to dense.inl
* --------------------------------------------------------
*
* See COPYING for license information
*/
#ifndef __BLACKBOX_DENSE_INL
#define __BLACKBOX_DENSE_INL
#include <iostream>
#include <vector>
#include <fstream>
#include "linbox/blackbox/dense.h"
#include "linbox/util/debug.h"
namespace LinBox
{
template <class Field>
template<class Vect1, class Vect2>
Vect1& DenseMatrix<Field>::apply (Vect1& y, const Vect2& x) const {
#ifdef __LINBOX_PARALLEL
return BlackboxParallel (y, *this, x, BBBase::Apply);
#else
_MD. vectorMul (y, *this, x);
#endif
return y;
}
template <class Field>
template<class Vect1, class Vect2>
Vect1& DenseMatrix<Field>::applyTranspose (Vect1& y, const Vect2& x) const {
#ifdef __LINBOX_PARALLEL
return BlackboxParallel (y, *this, x, BBBase::ApplyTranspose);
#else
return _MD.vectorMul (y, _AT, x);
#endif
}
template< class Field, class BElement >
DenseMatrix<Field>*
DenseMatrixFactory<Field,BElement>::makeBlackbox( const Field& F )
{
DenseMatrixBase<typename Field::Element> newBase ( rowdim(), coldim() );
typename DenseMatrixBase<BElement>::ConstRawIterator i;
typename DenseMatrixBase<typename Field::Element>::RawIterator j;
for( i = _A.rawBegin(), j = newBase.rawBegin();
i != _A.rawEnd(), j != newBase.rawEnd();
++i, ++j )
F.init( *j, *i );
return new DenseMatrix<Field>( F, newBase );
}
template< class Field, class BElement >
integer& DenseMatrixFactory<Field,BElement>::maxNorm( integer& res ) {
typename DenseMatrixBase<BElement>::ConstRawIterator i;
res = 0L;
integer tmp;
for( i = _A.rawBegin(); i != _A.rawEnd(); ++i ) {
tmp = abs( *i );
if( res < tmp ) res = tmp;
}
return res;
}
template< class Field, class BElement >
integer& DenseMatrixFactory<Field,BElement>::hadamardBound(integer& res) const {
typename DenseMatrixBase<BElement>::ConstRowIterator r;
typename DenseMatrixBase<BElement>::ConstRow::const_iterator c;
res = 1L;
integer temp;
for( r = _A.rowBegin(); r != _A.rowEnd(); ++r ) {
temp = 0;
for( c = r->begin(); c != r->end(); ++c )
temp += static_cast<integer>((*c)) * (*c);
res *= temp;
}
res = sqrt(res);
return res;
}
} // namespace LinBox
#endif // __BLACKBOX_DENSE_INL
|