diff src/ov-scalar.h @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents 39930366b709
children f336dd8e96d0
line wrap: on
line diff
--- a/src/ov-scalar.h
+++ b/src/ov-scalar.h
@@ -76,6 +76,8 @@
   octave_value do_index_op (const octave_value_list& idx,
 			    bool resize_ok = false);
 
+  type_conv_fcn numeric_demotion_function (void) const;
+
   idx_vector index_vector (void) const { return idx_vector (scalar); }
 
   octave_value any (int = 0) const
@@ -137,14 +139,24 @@
 
   double double_value (bool = false) const { return scalar; }
 
+  float float_value (bool = false) const { return static_cast<float> (scalar); }
+
   double scalar_value (bool = false) const { return scalar; }
 
+  float float_scalar_value (bool = false) const { return static_cast<float> (scalar); }
+
   Matrix matrix_value (bool = false) const
     { return Matrix (1, 1, scalar); }
 
+  FloatMatrix float_matrix_value (bool = false) const
+    { return FloatMatrix (1, 1, scalar); }
+
   NDArray array_value (bool = false) const
     { return NDArray (dim_vector (1, 1), scalar); }
 
+  FloatNDArray float_array_value (bool = false) const
+    { return FloatNDArray (dim_vector (1, 1), scalar); }
+
   SparseMatrix sparse_matrix_value (bool = false) const
     { return SparseMatrix (Matrix (1, 1, scalar)); }
 
@@ -156,12 +168,20 @@
 
   Complex complex_value (bool = false) const { return scalar; }
 
+  FloatComplex float_complex_value (bool = false) const { return scalar; }
+
   ComplexMatrix complex_matrix_value (bool = false) const
     { return  ComplexMatrix (1, 1, Complex (scalar)); }
 
+  FloatComplexMatrix float_complex_matrix_value (bool = false) const
+    { return  FloatComplexMatrix (1, 1, FloatComplex (scalar)); }
+
   ComplexNDArray complex_array_value (bool = false) const
     { return ComplexNDArray (dim_vector (1, 1), Complex (scalar)); }
 
+  FloatComplexNDArray float_complex_array_value (bool = false) const
+    { return FloatComplexNDArray (dim_vector (1, 1), FloatComplex (scalar)); }
+
   charNDArray
   char_array_value (bool = false) const
   {