29 #ifndef HELP_FUNCTIONS_H
30 #define HELP_FUNCTIONS_H
46 for (
int i = 0; i < v.
length(); i++) {
57 for (
int i = 0; i < v.
length(); i++) {
68 for (
int i = 0; i < m.
rows(); i++) {
69 for (
int j = 0; j < m.
cols(); j++) {
70 out(i, j) = f(m(i, j));
81 for (
int i = 0; i < m.
rows(); i++) {
82 for (
int j = 0; j < m.
cols(); j++) {
83 out(i, j) = f(m(i, j));
95 for (
int i = 0; i < v.
length(); i++) {
108 for (
int i = 0; i < v.
length(); i++) {
119 for (
int i = 0; i < m.
rows(); i++) {
120 for (
int j = 0; j < m.
cols(); j++) {
121 out(i, j) = f(x, m(i, j));
134 for (
int i = 0; i < m.
rows(); i++) {
135 for (
int j = 0; j < m.
cols(); j++) {
136 out(i, j) = f(x, m(i, j));
147 for (
int i = 0; i < v.
length(); i++) {
160 for (
int i = 0; i < v.
length(); i++) {
171 for (
int i = 0; i < m.
rows(); i++) {
172 for (
int j = 0; j < m.
cols(); j++) {
173 out(i, j) = f(m(i, j), x);
186 for (
int i = 0; i < m.
rows(); i++) {
187 for (
int j = 0; j < m.
cols(); j++) {
188 out(i, j) = f(m(i, j), x);
204 extern template vec
apply_function(
double(*f)(
double),
const vec &v);
205 extern template cvec
apply_function(std::complex<double> (*f)(
const std::complex<double> &),
207 extern template svec
apply_function(
short(*f)(
short),
const svec &v);
208 extern template ivec
apply_function(
int (*f)(
int),
const ivec &v);
211 extern template mat
apply_function(
double(*f)(
double),
const mat &m);
212 extern template cmat
apply_function(std::complex<double> (*f)(
const std::complex<double> &),
214 extern template smat
apply_function(
short(*f)(
short),
const smat &m);
215 extern template imat
apply_function(
int (*f)(
int),
const imat &m);
218 extern template vec
apply_function(
double(*f)(
double,
double),
const double& x,
const vec &v);
219 extern template cvec
apply_function(std::complex<double> (*f)(
const std::complex<double> &,
220 const std::complex<double> &),
221 const std::complex<double>& x,
const cvec &v);
222 extern template svec
apply_function(
short(*f)(
short,
short),
const short& x,
const svec &v);
223 extern template ivec
apply_function(
int (*f)(
int,
int),
const int& x,
const ivec &v);
224 extern template bvec
apply_function(bin(*f)(bin, bin),
const bin& x,
const bvec &v);
226 extern template mat
apply_function(
double(*f)(
double,
double),
const double& x,
const mat &m);
227 extern template cmat
apply_function(std::complex<double> (*f)(
const std::complex<double> &,
228 const std::complex<double> &),
229 const std::complex<double>& x,
const cmat &m);
230 extern template smat
apply_function(
short(*f)(
short,
short),
const short& x,
const smat &m);
231 extern template imat
apply_function(
int (*f)(
int,
int),
const int& x,
const imat &m);
234 extern template vec
apply_function(
double(*f)(
double,
double),
const vec &v,
const double& x);
235 extern template cvec
apply_function(std::complex<double> (*f)(
const std::complex<double> &,
236 const std::complex<double> &),
237 const cvec &v,
const std::complex<double>& x);
238 extern template svec
apply_function(
short(*f)(
short,
short),
const svec &v,
const short& x);
239 extern template ivec
apply_function(
int (*f)(
int,
int),
const ivec &v,
const int& x);
240 extern template bvec
apply_function(bin(*f)(bin, bin),
const bvec &v,
const bin& x);
242 extern template mat
apply_function(
double(*f)(
double,
double),
const mat &m,
const double& x);
243 extern template cmat
apply_function(std::complex<double> (*f)(
const std::complex<double> &,
244 const std::complex<double> &),
245 const cmat &m,
const std::complex<double>& x);
246 extern template smat
apply_function(
short(*f)(
short,
short),
const smat &m,
const short& x);
247 extern template imat
apply_function(
int (*f)(
int,
int),
const imat &m,
const int& x);
256 #endif // #ifndef HELP_FUNCTIONS_H