Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/ov-mp.h [bb2c18] .. [5b060d] Maximize Restore

  Switch to side-by-side view

--- a/src/ov-mp.h
+++ b/src/ov-mp.h
@@ -34,15 +34,12 @@
 public:
 
   octave_mp (void);
-  octave_mp (signed long si);
-  octave_mp (unsigned long ui);
+  octave_mp (signed long si, mpfr_prec_t sprec = mpfr_get_default_prec (),  mp_rnd_t srnd = mpfr_get_default_rounding_mode ());
+  
+  octave_mp (unsigned long ui, mpfr_prec_t sprec = mpfr_get_default_prec (),  mp_rnd_t srnd = mpfr_get_default_rounding_mode ());
   octave_mp (const octave_mp& s);
-  octave_mp (const double& x);
-  octave_mp (const long double& x);
-  octave_mp (const double& x, const mpfr_prec_t prec);
-  octave_mp (const long double& x, const mpfr_prec_t prec);
-  octave_mp (const std::string& x);
-  octave_mp (const std::string& x, const mpfr_prec_t prec);
+  octave_mp (const double& x, mpfr_prec_t sprec = mpfr_get_default_prec (),  mp_rnd_t srnd = mpfr_get_default_rounding_mode ());
+   octave_mp (const std::string& x, mpfr_prec_t sprec = mpfr_get_default_prec (), mp_rnd_t srnd = mpfr_get_default_rounding_mode ());
 
   ~octave_mp (void) { mpfr_clear (scalar); }
 
@@ -52,6 +49,8 @@
   void *operator new (size_t size);
   void operator delete (void *p, size_t size);
 #endif 
+
+  type_conv_info numeric_conversion_function (void) const;
 
   dim_vector dims (void) const { static dim_vector dv (1, 1); return dv; }
   int rows (void) const { return 1; }
@@ -69,6 +68,17 @@
   bool is_scalar_type (void) const { return true; }
   bool is_mp_type (void) const { return true; }
 
+  /* permits to re-use it out-of-context */
+  int mp_eq_proxy(const octave_mp& s) const
+  {
+    return mpfr_equal_p (scalar, s.scalar);
+  }
+
+  int mp_neq_proxy(const octave_mp& s) const
+  {
+    return !mpfr_equal_p (scalar, s.scalar);
+  }
+    
   bool valid_as_scalar_index (void) const
   { 
     mpfr_t one;
@@ -94,6 +104,8 @@
 
   void print (std::ostream& os, bool pr_as_read_syntax = false) const;
 
+  octave_value map (unary_mapper_t umap) const;
+
 private:
   
   mpfr_t scalar;