54 if (haystack.
nelem() <= needleind[i])
57 os <<
"The input vector only has " << haystack.
nelem()
58 <<
" elements. But one of the needle indexes is " 59 << needleind[i] <<
"." << endl;
60 os <<
"The indexes must be between 0 and " << haystack.
nelem() - 1;
61 throw runtime_error (os.str());
64 dummy[i] = haystack[needleind[i]];
86 if (haystack.
nelem() <= needleind[i])
89 os <<
"The input vector only has " << haystack.
nelem()
90 <<
" elements. But one of the needle indexes is " 91 << needleind[i] <<
"." << endl;
92 os <<
"The indexes must be between 0 and " << haystack.
nelem() - 1;
93 throw runtime_error (os.str());
96 dummy[i] = haystack[needleind[i]];
118 if (haystack.
nrows() <= needleind[i])
121 os <<
"The input matrix only has " << haystack.
nrows()
122 <<
" rows. But one of the needle indexes is " 123 << needleind[i] <<
"." << endl;
124 os <<
"The indexes must be between 0 and " << haystack.
nrows() - 1;
125 throw runtime_error (os.str());
128 dummy(i,
joker) = haystack(needleind[i],
joker);
152 if (haystack.
nrows() <= needleind[i])
155 os <<
"The input matrix only has " << haystack.
nrows()
156 <<
" rows. But one of the needle indexes is " 157 << needleind[i] <<
"." << endl;
158 os <<
"The indexes must be between 0 and " << haystack.
nrows() - 1;
159 throw runtime_error (os.str());
169 Numeric value = haystack(needleind[i],j);
171 dummy.rw(i,j) = value;
176 if (dummy.nnz()==haystack.
nnz())
179 out3 <<
" Number of nonzero elements has stayed the same.\n";
183 out3 <<
" Number of nonzero elements reduced from " 184 << haystack.
nnz() <<
" to " << dummy.nnz() <<
".\n";
INDEX Index
The type to use for all integer numbers and indices.
Index nnz() const
Returns the number of nonzero elements.
Index nelem() const
Number of elements.
Declarations having to do with the four output streams.
Index ncols() const
Returns the number of columns.
Index nelem() const
Returns the number of elements.
This file contains the declaration and partly the implementation of the workspace class...
Index ncols() const
Returns the number of columns.
Header file for sparse matrices.
Declarations for agendas.
Index nrows() const
Returns the number of rows.
NUMERIC Numeric
The type to use for all floating point numbers.
This can be used to make arrays out of anything.
Index nrows() const
Returns the number of rows.
This file contains the definition of String, the ARTS string class.
void Select(Array< T > &needles, const Array< T > &haystack, const ArrayOfIndex &needleind, const Verbosity &)