operator & with boolean fixed 19/15419/2
Cedric Delamarre [Fri, 24 Oct 2014 12:36:30 +0000 (14:36 +0200)]
%t & []
[] & [%t %f]
3 & []
[] & [1 12]

test_run elementary_functions acoth

Change-Id: I91b28fadd1386781304921893413496dc87b4ea3

scilab/modules/ast/includes/operations/types_and.hxx
scilab/modules/ast/src/cpp/operations/types_and.cpp

index ef1a3de..f6154e8 100644 (file)
@@ -47,6 +47,8 @@ DECLARE_AND_PROTO(and_int_S_M);
 DECLARE_AND_PROTO(and_int_S_S);
 
 //boolean sparse specialisation
+template<> types::InternalType* and_E_M<types::Double, types::Bool, types::Bool>(types::Double* _pL, types::Bool* _pR);
+template<> types::InternalType* and_M_E<types::Bool, types::Double, types::Bool>(types::Bool* _pL, types::Double* _pR);
 template<> types::InternalType* and_M_M<types::SparseBool, types::SparseBool, types::SparseBool>(types::SparseBool* _pL, types::SparseBool* _pR);
 template<> types::InternalType* and_M_M<types::SparseBool, types::Bool, types::SparseBool>(types::SparseBool* _pL, types::Bool* _pR);
 template<> types::InternalType* and_M_M<types::Bool, types::SparseBool, types::SparseBool>(types::Bool* _pL, types::SparseBool* _pR);
index f56209b..6038f29 100644 (file)
@@ -56,7 +56,7 @@ void fillAndFunction()
     scilab_fill_and(Bool, ScalarDouble, M_S, Bool, Double, Bool);
     scilab_fill_and(Bool, ScalarBool, M_S, Bool, Bool, Bool);
 
-    scilab_fill_and(Bool, Empty, M_E, Bool, Double, Double);
+    scilab_fill_and(Bool, Empty, M_E, Bool, Double, Bool);
     scilab_fill_and(Bool, Identity, M_S, Bool, Double, Bool);
 
     scilab_fill_and(ScalarBool, Double, S_M, Bool, Double, Bool);
@@ -65,14 +65,14 @@ void fillAndFunction()
     scilab_fill_and(ScalarBool, ScalarDouble, S_S, Bool, Double, Bool);
     scilab_fill_and(ScalarBool, ScalarBool, S_S, Bool, Bool, Bool);
 
-    scilab_fill_and(ScalarBool, Empty, M_E, Bool, Double, Double);
+    scilab_fill_and(ScalarBool, Empty, M_E, Bool, Double, Bool);
     scilab_fill_and(ScalarBool, Identity, S_S, Bool, Double, Bool);
 
     // []
     scilab_fill_and(Empty, Double, E_M, Double, Double, Double);
-    scilab_fill_and(Empty, Bool, E_M, Double, Bool, Double);
+    scilab_fill_and(Empty, Bool, E_M, Double, Bool, Bool);
     scilab_fill_and(Empty, ScalarDouble, E_M, Double, Double, Double);
-    scilab_fill_and(Empty, ScalarBool, E_M, Double, Bool, Double);
+    scilab_fill_and(Empty, ScalarBool, E_M, Double, Bool, Bool);
     scilab_fill_and(Empty, Empty, E_M, Double, Double, Double);
     scilab_fill_and(Empty, Identity, E_M, Double, Double, Double);
 
@@ -592,6 +592,18 @@ InternalType* and_E_M(T *_pL, U * /*_pR*/)
     return _pL;
 }
 
+template<>
+InternalType* and_E_M<Double, Bool, Bool>(Double* /* _pL */, Bool* _pR)
+{
+    return _pR;
+}
+
+template<>
+InternalType* and_M_E<Bool, Double, Bool>(Bool* _pL, Double* /* _pR */)
+{
+    return _pL;
+}
+
 template<class T, class U, class O>
 InternalType* and_I_S(T *_pL, U *_pR)
 {