28 mColumns( nCols ), mRows( nRows ), mData( data ), mNodataValue( nodataValue )
48 mData =
new float[nEntries];
49 memcpy(
mData, m.
mData,
sizeof(
float ) * nEntries );
184 for (
int i = 0; i < nEntries; ++i )
198 mData[i] =
static_cast<float>( sqrt( value ) );
202 mData[i] =
static_cast<float>( sin( value ) );
205 mData[i] =
static_cast<float>( cos( value ) );
208 mData[i] =
static_cast<float>( tan( value ) );
211 mData[i] =
static_cast<float>( asin( value ) );
214 mData[i] =
static_cast<float>( acos( value ) );
217 mData[i] =
static_cast<float>( atan( value ) );
220 mData[i] =
static_cast<float>( -value );
249 if ( other.
number() == 0 )
299 float* matrix = other.
mData;
301 double value1, value2;
303 for (
int i = 0; i < nEntries; ++i )
305 value1 =
mData[i]; value2 = matrix[i];
315 mData[i] =
static_cast<float>( value1 + value2 );
318 mData[i] =
static_cast<float>( value1 - value2 );
321 mData[i] =
static_cast<float>( value1 * value2 );
330 mData[i] =
static_cast<float>( value1 / value2 );
340 mData[i] =
static_cast<float>( pow( value1, value2 ) );
344 mData[i] = value1 == value2 ? 1.0f : 0.0f;
347 mData[i] = value1 == value2 ? 0.0f : 1.0f;
350 mData[i] = value1 > value2 ? 1.0f : 0.0f;
353 mData[i] = value1 < value2 ? 1.0f : 0.0f;
356 mData[i] = value1 >= value2 ? 1.0f : 0.0f;
359 mData[i] = value1 <= value2 ? 1.0f : 0.0f;
362 mData[i] = value1 && value2 ? 1.0f : 0.0f;
365 mData[i] = value1 || value2 ? 1.0f : 0.0f;
376 float* matrix = other.
mData;
378 double value =
mData[0];
385 for (
int i = 0; i < nEntries; ++i )
392 for (
int i = 0; i < nEntries; ++i )
403 mData[i] =
static_cast<float>( value + matrix[i] );
406 mData[i] =
static_cast<float>( value - matrix[i] );
409 mData[i] =
static_cast<float>( value * matrix[i] );
412 if ( matrix[i] == 0 )
418 mData[i] =
static_cast<float>( value / matrix[i] );
428 mData[i] = pow( static_cast<float>( value ), matrix[i] );
432 mData[i] = value == matrix[i] ? 1.0f : 0.0f;
435 mData[i] = value == matrix[i] ? 0.0f : 1.0f;
438 mData[i] = value > matrix[i] ? 1.0f : 0.0f;
441 mData[i] = value < matrix[i] ? 1.0f : 0.0f;
444 mData[i] = value >= matrix[i] ? 1.0f : 0.0f;
447 mData[i] = value <= matrix[i] ? 1.0f : 0.0f;
450 mData[i] = value && matrix[i] ? 1.0f : 0.0f;
453 mData[i] = value || matrix[i] ? 1.0f : 0.0f;
461 double value = other.
number();
466 for (
int i = 0; i < nEntries; ++i )
473 for (
int i = 0; i < nEntries; ++i )
483 mData[i] =
static_cast<float>(
mData[i] + value );
486 mData[i] =
static_cast<float>(
mData[i] - value );
489 mData[i] =
static_cast<float>(
mData[i] * value );
498 mData[i] =
static_cast<float>(
mData[i] / value );
543 if (( base == 0 && power < 0 ) || ( power < 0 && ( power - floor( power ) ) > 0 ) )