Go to the documentation of this file.
89 for(
Index i=0; i<nelem; i++ )
99 sa.resize(sa2.
nelem());
147 os <<
"Matrix dimensions must be consistent!\n"
148 <<
"Matrix1.ncols() = " <<
M.ncols() <<
"\n"
149 <<
"Matrix2.nrows() = " << X.
nrows();
150 throw runtime_error( os.str() );
189 if( v2.
nelem() != nv )
190 throw runtime_error(
"Vectors must be of the same size.");
211 throw runtime_error(
"Vectors must be of the same size.");
229 if( matrix2.
nrows() != nrows || matrix2.
ncols() != ncols )
230 throw runtime_error(
"The two matrices do not have the same size." );
234 for(
Index r=0; r<nrows; r++ )
236 for(
Index c=0; c<ncols; c++ )
238 Numeric diff = fabs( matrix1(r,c) - matrix2(r,c) );
244 if( maxdiff > maxabsdiff )
247 os <<
"A difference of " << maxdiff <<
" was found, which is larger "
248 <<
"than the specified threshold of " << maxabsdiff <<
".";
249 throw runtime_error(os.str());
253 out2 <<
" Check OK (maximum difference = " << maxdiff <<
").\n";
282 if( v2.
nelem() != nv )
283 throw runtime_error(
"Vectors must be of the same size.");
304 throw runtime_error(
"Vectors must be of the same size.");
399 os <<
"Matrix dimensions must be consistent!\n"
400 <<
"Matrix1.ncols() = " <<
M.ncols() <<
"\n"
401 <<
"Matrix2.nrows() = " << X.
nrows();
402 throw runtime_error( os.str() );
475 x.
resize( npages, nrows, ncols );
478 out2 <<
" Tensor3 = " << value <<
"\n";
479 out3 <<
" npages : " << npages <<
"\n";
480 out3 <<
" nrows : " << nrows <<
"\n";
481 out3 <<
" ncols : " << ncols <<
"\n";
517 x.
resize( nbooks, npages, nrows, ncols );
520 out2 <<
" Tensor4 = " << value <<
"\n";
521 out3 <<
" nbooks : " << nbooks <<
"\n";
522 out3 <<
" npages : " << npages <<
"\n";
523 out3 <<
" nrows : " << nrows <<
"\n";
524 out3 <<
" ncols : " << ncols <<
"\n";
551 const Index& nshelves,
562 x.
resize( nshelves, nbooks, npages, nrows, ncols );
565 out2 <<
" Tensor5 = " << value <<
"\n";
566 out3 <<
" nshelves : " << nshelves <<
"\n";
567 out3 <<
" nbooks : " << nbooks <<
"\n";
568 out3 <<
" npages : " << npages <<
"\n";
569 out3 <<
" nrows : " << nrows <<
"\n";
570 out3 <<
" ncols : " << ncols <<
"\n";
597 const Index& nvitrines,
598 const Index& nshelves,
609 x.
resize( nvitrines, nshelves, nbooks, npages, nrows, ncols );
612 out2 <<
" Tensor6 = " << value <<
"\n";
613 out3 <<
" nvitrines : " << nvitrines <<
"\n";
614 out3 <<
" nshelves : " << nshelves <<
"\n";
615 out3 <<
" nbooks : " << nbooks <<
"\n";
616 out3 <<
" npages : " << npages <<
"\n";
617 out3 <<
" nrows : " << nrows <<
"\n";
618 out3 <<
" ncols : " << ncols <<
"\n";
645 const Index& nlibraries,
646 const Index& nvitrines,
647 const Index& nshelves,
658 x.
resize( nlibraries, nvitrines, nshelves, nbooks, npages, nrows, ncols );
661 out2 <<
" Tensor7 = " << value <<
"\n";
662 out3 <<
" nlibraries : " << nlibraries <<
"\n";
663 out3 <<
" nvitrines : " << nvitrines <<
"\n";
664 out3 <<
" nshelves : " << nshelves <<
"\n";
665 out3 <<
" nbooks : " << nbooks <<
"\n";
666 out3 <<
" npages : " << npages <<
"\n";
667 out3 <<
" nrows : " << nrows <<
"\n";
668 out3 <<
" ncols : " << ncols <<
"\n";
707 for(
Index i=0; i<n; i++ )
714 for(
Index i=0; i<n; i++ )
751 const Vector dummy = ig[
Range(ig.nelem()-1,ig.nelem(),-1)];
759 os <<
"The input Vector must be either\n"
760 <<
"strictly increasing or strictly decreasing,\n"
761 <<
"but this is not the case.\n";
762 os <<
"The vector contains:\n"
764 throw runtime_error( os.str() );
782 while ( iig<ig.nelem() && ip<p.
nelem() )
789 else if ( p[ip]>ig[iig] )
791 x.push_back(ig[iig]);
796 out3 <<
" Skipping point " << p[ip] <<
", which is already "
797 <<
"in the original grid.\n";
803 out2 <<
" " << sk <<
" points skipped.\n";
810 while ( iig<ig.nelem() )
812 x.push_back(ig[iig]);
816 else if ( iig==ig.nelem() )
819 while ( ip<p.
nelem() )
842 og[i] = x[x.
nelem()-1-i];
859 out2 <<
" Creating a linearly spaced vector.\n";
860 out3 <<
" length : " << x.
nelem() <<
"\n";
861 out3 <<
" first value : " << x[0] <<
"\n";
865 out3 <<
" step size : " << x[1]-x[0] <<
"\n";
866 out3 <<
" last value : " << x[x.nelem()-1] <<
"\n";
880 linspace(x,log(start),log(stop),step);
883 out2 <<
" Creating a logarithmically spaced vector.\n";
884 out3 <<
" length : " << x.
nelem() <<
"\n";
885 out3 <<
" first value : " << x[0] <<
"\n";
889 out3 <<
" step size : " << x[1]-x[0] <<
"\n";
890 out3 <<
" last value : " << x[x.nelem()-1] <<
"\n";
906 os <<
"Matrix and vector dimensions must be consistent!\n"
907 <<
"Matrix.ncols() = " <<
M.ncols() <<
"\n"
908 <<
"Vector.nelem() = " << x.
nelem();
909 throw runtime_error( os.str() );
933 throw runtime_error(
"The number of points must be > 1.");
936 out2 <<
" Creating a linearly spaced vector.\n";
937 out3 <<
" length : " << n <<
"\n";
938 out3 <<
" first value : " << x[0] <<
"\n";
942 out3 <<
" step size : " << x[1]-x[0] <<
"\n";
943 out3 <<
" last value : " << x[x.nelem()-1] <<
"\n";
959 throw runtime_error(
"The number of points must be > 1.");
960 if ( (start<=0) || (stop<=0) )
961 throw runtime_error(
"Only positive numbers are allowed.");
965 out2 <<
" Creating a logarithmically spaced vector.\n";
966 out3 <<
" length : " << n <<
"\n";
967 out3 <<
" first value : " << x[0] <<
"\n";
970 out3 <<
" last value : " << x[x.nelem()-1] <<
"\n";
1009 out2 <<
" Creating a constant vector.\n";
1010 out3 <<
" length : " << n <<
"\n";
1011 out3 <<
" value : " << value <<
"\n";
void transform(VectorView y, double(&my_func)(double), ConstVectorView x)
A generic transform function for vectors, which can be used to implement mathematical functions opera...
void resize(Index b, Index p, Index r, Index c)
Resize function.
Index nshelves() const
Returns the number of shelves.
void NumericScale(Numeric &out, const Numeric &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: NumericScale.
Index nshelves() const
Returns the number of shelves.
Index nbooks() const
Returns the number of books.
The declarations of all the exception classes.
void ArrayOfIndexSet(ArrayOfIndex &aoi, const ArrayOfIndex &values, const Verbosity &)
WORKSPACE METHOD: ArrayOfIndexSet.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
void VectorAddScalar(Vector &out, const Vector &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: VectorAddScalar.
void ArrayOfStringSet(ArrayOfString &sa, const ArrayOfString &sa2, const Verbosity &)
WORKSPACE METHOD: ArrayOfStringSet.
Index ncols() const
Returns the number of columns.
void Matrix1RowFromVector(Matrix &m, const Vector &v, const Verbosity &)
WORKSPACE METHOD: Matrix1RowFromVector.
void MatrixSet(Matrix &x, const Matrix &values, const Verbosity &)
WORKSPACE METHOD: MatrixSet.
Index ncols() const
Returns the number of columns.
Index npages() const
Returns the number of pages.
void Matrix2ColFromVectors(Matrix &m, const Vector &v1, const Vector &v2, const Verbosity &)
WORKSPACE METHOD: Matrix2ColFromVectors.
Index ncols() const
Returns the number of columns.
Index nrows() const
Returns the number of rows.
void resize(Index n)
Resize function.
void Tensor4Scale(Tensor4 &out, const Tensor4 &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: Tensor4Scale.
void Tensor6SetConstant(Tensor6 &x, const Index &nvitrines, const Index &nshelves, const Index &nbooks, const Index &npages, const Index &nrows, const Index &ncols, const Numeric &value, const Verbosity &verbosity)
WORKSPACE METHOD: Tensor6SetConstant.
Index nrows() const
Returns the number of rows.
void NumericSet(Numeric &x, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: NumericSet.
void Tensor7Scale(Tensor7 &out, const Tensor7 &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: Tensor7Scale.
void Tensor3AddScalar(Tensor3 &out, const Tensor3 &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: Tensor3AddScalar.
void Matrix2RowFromVectors(Matrix &m, const Vector &v1, const Vector &v2, const Verbosity &)
WORKSPACE METHOD: Matrix2RowFromVectors.
This file contains the definition of Array.
void NumericAdd(Numeric &out, const Numeric &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: NumericAdd.
void resize(Index p, Index r, Index c)
Resize function.
Index npages() const
Returns the number of pages.
void VectorLogSpace(Vector &x, const Numeric &start, const Numeric &stop, const Numeric &step, const Verbosity &verbosity)
WORKSPACE METHOD: VectorLogSpace.
Index npages() const
Returns the number of pages.
Index nlibraries() const
Returns the number of libraries.
void nlogspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlogspace
void MatrixCompare(const Matrix &matrix1, const Matrix &matrix2, const Numeric &maxabsdiff, const Verbosity &verbosity)
WORKSPACE METHOD: MatrixCompare.
void IndexSet(Index &x, const Index &value, const Verbosity &)
WORKSPACE METHOD: IndexSet.
void Tensor4SetConstant(Tensor4 &x, const Index &nbooks, const Index &npages, const Index &nrows, const Index &ncols, const Numeric &value, const Verbosity &verbosity)
WORKSPACE METHOD: Tensor4SetConstant.
bool is_decreasing(ConstVectorView x)
Checks if a vector is sorted in reversed order and is strictly decreasing.
void get_sorted_indexes(ArrayOfIndex &sorted, const T &data)
get_sorted_indexes
void Tensor6Scale(Tensor6 &out, const Tensor6 &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: Tensor6Scale.
Index nvitrines() const
Returns the number of vitrines.
void MatrixScale(Matrix &out, const Matrix &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: MatrixScale.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
void mult(VectorView y, const ConstMatrixView &M, const ConstVectorView &x)
Matrix Vector multiplication.
void resize(Index s, Index b, Index p, Index r, Index c)
Resize function.
void Matrix3RowFromVectors(Matrix &m, const Vector &v1, const Vector &v2, const Vector &v3, const Verbosity &)
WORKSPACE METHOD: Matrix3RowFromVectors.
Declarations having to do with the four output streams.
void VectorFlip(Vector &out, const Vector &in, const Verbosity &)
WORKSPACE METHOD: VectorFlip.
void VectorNLinSpace(Vector &x, const Index &n, const Numeric &start, const Numeric &stop, const Verbosity &verbosity)
WORKSPACE METHOD: VectorNLinSpace.
Index ncols() const
Returns the number of columns.
The implementation for String, the ARTS string class.
void VectorInsertGridPoints(Vector &og, const Vector &ingrid, const Vector &points, const Verbosity &verbosity)
WORKSPACE METHOD: VectorInsertGridPoints.
Index nelem() const
Returns the number of elements.
void StringSet(String &s, const String &s2, const Verbosity &)
WORKSPACE METHOD: StringSet.
Index nvitrines() const
Returns the number of vitrines.
Index ncols() const
Returns the number of columns.
void Tensor3SetConstant(Tensor3 &x, const Index &npages, const Index &nrows, const Index &ncols, const Numeric &value, const Verbosity &verbosity)
WORKSPACE METHOD: Tensor3SetConstant.
Index npages() const
Returns the number of pages.
NUMERIC Numeric
The type to use for all floating point numbers.
Index npages() const
Returns the number of pages.
Index nbooks() const
Returns the number of books.
Implements the class MakeArray, which is a derived class of Array, allowing explicit initialization.
void Tensor5SetConstant(Tensor5 &x, const Index &nshelves, const Index &nbooks, const Index &npages, const Index &nrows, const Index &ncols, const Numeric &value, const Verbosity &verbosity)
WORKSPACE METHOD: Tensor5SetConstant.
void SparseSparseMultiply(Sparse &Y, const Sparse &M, const Sparse &X, const Verbosity &)
WORKSPACE METHOD: SparseSparseMultiply.
void resize(Index r, Index c)
Resize function.
void VectorScale(Vector &out, const Vector &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: VectorScale.
Index nrows() const
Returns the number of rows.
void VectorLinSpace(Vector &x, const Numeric &start, const Numeric &stop, const Numeric &step, const Verbosity &verbosity)
WORKSPACE METHOD: VectorLinSpace.
void nlinspace(Vector &x, const Numeric start, const Numeric stop, const Index n)
nlinspace
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
void MatrixSetConstant(Matrix &x, const Index &nrows, const Index &ncols, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: MatrixSetConstant.
void ArrayOfIndexSetConstant(ArrayOfIndex &aoi, const Index &nelem, const Index &value, const Verbosity &)
WORKSPACE METHOD: ArrayOfIndexSetConstant.
void Matrix1ColFromVector(Matrix &m, const Vector &v, const Verbosity &)
WORKSPACE METHOD: Matrix1ColFromVector.
Index nbooks() const
Returns the number of books.
Index nrows() const
Returns the number of rows.
void VectorSet(Vector &x, const Vector &values, const Verbosity &)
WORKSPACE METHOD: VectorSet.
bool is_increasing(ConstVectorView x)
Checks if a vector is sorted and strictly increasing.
Header file for logic.cc.
Index nrows() const
Returns the number of rows.
Index nshelves() const
Returns the number of shelves.
Index ncols() const
Returns the number of columns.
Header file for sparse matrices.
void VectorNLogSpace(Vector &x, const Index &n, const Numeric &start, const Numeric &stop, const Verbosity &verbosity)
WORKSPACE METHOD: VectorNLogSpace.
void Matrix3ColFromVectors(Matrix &m, const Vector &v1, const Vector &v2, const Vector &v3, const Verbosity &)
WORKSPACE METHOD: Matrix3ColFromVectors.
void FlagOn(Index &x, const Verbosity &)
WORKSPACE METHOD: FlagOn.
void VectorMatrixMultiply(Vector &y, const Matrix &M, const Vector &x, const Verbosity &)
WORKSPACE METHOD: VectorMatrixMultiply.
void IndexStep(Index &xout, const Index &xin, const Verbosity &)
WORKSPACE METHOD: IndexStep.
void MatrixMatrixMultiply(Matrix &Y, const Matrix &M, const Matrix &X, const Verbosity &)
WORKSPACE METHOD: MatrixMatrixMultiply.
INDEX Index
The type to use for all integer numbers and indices.
Index nrows() const
Returns the number of rows.
void linspace(Vector &x, const Numeric start, const Numeric stop, const Numeric step)
linspace
void arts_exit(int status)
This is the exit function of ARTS.
void FlagOff(Index &x, const Verbosity &)
WORKSPACE METHOD: FlagOff.
Contains sorting routines.
Index nelem() const
Number of elements.
void Tensor7SetConstant(Tensor7 &x, const Index &nlibraries, const Index &nvitrines, const Index &nshelves, const Index &nbooks, const Index &npages, const Index &nrows, const Index &ncols, const Numeric &value, const Verbosity &verbosity)
WORKSPACE METHOD: Tensor7SetConstant.
Index ncols() const
Returns the number of columns.
void Tensor5Scale(Tensor5 &out, const Tensor5 &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: Tensor5Scale.
This file contains the definition of String, the ARTS string class.
The global header file for ARTS.
void Tensor3Scale(Tensor3 &out, const Tensor3 &in, const Numeric &value, const Verbosity &)
WORKSPACE METHOD: Tensor3Scale.
void VectorSetConstant(Vector &x, const Index &n, const Numeric &value, const Verbosity &verbosity)
WORKSPACE METHOD: VectorSetConstant.