sparse : remove sps2adj macros, rewrite ordmmd fortran gateway 00/11400/3
Antoine ELIAS [Thu, 25 Apr 2013 13:22:33 +0000 (15:22 +0200)]
Change-Id: I9b0ba2bf190e87ad033fe241aeed1477c8c50abe

12 files changed:
scilab/Scilab.sln
scilab/modules/sparse/Makefile.am
scilab/modules/sparse/Makefile.in
scilab/modules/sparse/includes/sparse_gw.hxx
scilab/modules/sparse/macros/sp2adj.sci [deleted file]
scilab/modules/sparse/sci_gateway/cpp/sci_ordmmd.cpp [new file with mode: 0644]
scilab/modules/sparse/sci_gateway/cpp/sparse_f_Import.def [new file with mode: 0644]
scilab/modules/sparse/sci_gateway/cpp/sparse_gw.cpp
scilab/modules/sparse/sci_gateway/cpp/sparse_gw.vcxproj
scilab/modules/sparse/sci_gateway/cpp/sparse_gw.vcxproj.filters
scilab/modules/sparse/src/fortran/sparse_f.vfproj
scilab/modules/types/src/cpp/double.cpp

index eb63504..9f3f934 100644 (file)
@@ -623,6 +623,9 @@ EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types_gw", "modules\types\sci_gateway\cpp\types_gw.vcxproj", "{C2E5F4F6-5EE7-4B36-BFAC-4AC36BB41420}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sparse_gw", "modules\sparse\sci_gateway\cpp\sparse_gw.vcxproj", "{7FC7AEC9-4922-4864-83F1-EAED67981AAC}"
+       ProjectSection(ProjectDependencies) = postProject
+               {13082624-97F9-47DB-A9A1-AD7D6BF3856A} = {13082624-97F9-47DB-A9A1-AD7D6BF3856A}
+       EndProjectSection
 EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
index c7c5250..d00913a 100644 (file)
@@ -9,7 +9,8 @@ SPARSE_FORTRAN_SOURCES = \
 src/fortran/isort1.f \
 src/fortran/spt.f \
 src/fortran/sz2ptr.f \
-src/fortran/spreshape.f
+src/fortran/spreshape.f \
+src/fortran/ordmmd.f
 
 GATEWAY_C_SOURCES =
 
@@ -23,7 +24,8 @@ sci_gateway/cpp/sci_sparse.cpp \
 sci_gateway/cpp/sci_spcompack.cpp \
 sci_gateway/cpp/sci_spget.cpp \
 sci_gateway/cpp/sci_spzeros.cpp \
-sci_gateway/cpp/sci_spones.cpp
+sci_gateway/cpp/sci_spones.cpp \
+sci_gateway/cpp/sci_ordmmd.cpp
 
 
 libscisparse_la_CPPFLAGS = -I$(srcdir)/includes/ \
index 19a9155..1c38f62 100644 (file)
@@ -135,7 +135,7 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscisparse_algo_la_LIBADD =
 am__objects_1 =
-am__objects_2 = isort1.lo spt.lo sz2ptr.lo spreshape.lo
+am__objects_2 = isort1.lo spt.lo sz2ptr.lo spreshape.lo ordmmd.lo
 am_libscisparse_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
 libscisparse_algo_la_OBJECTS = $(am_libscisparse_algo_la_OBJECTS)
 @MAINTAINER_MODE_FALSE@am_libscisparse_algo_la_rpath =
@@ -146,7 +146,7 @@ am__objects_3 = libscisparse_la-sparse_gw.lo \
        libscisparse_la-sci_nnz.lo libscisparse_la-sci_sp2adj.lo \
        libscisparse_la-sci_sparse.lo libscisparse_la-sci_spcompack.lo \
        libscisparse_la-sci_spget.lo libscisparse_la-sci_spzeros.lo \
-       libscisparse_la-sci_spones.lo
+       libscisparse_la-sci_spones.lo libscisparse_la-sci_ordmmd.lo
 am_libscisparse_la_OBJECTS = $(am__objects_1) $(am__objects_3)
 libscisparse_la_OBJECTS = $(am_libscisparse_la_OBJECTS)
 @MAINTAINER_MODE_FALSE@am_libscisparse_la_rpath =
@@ -454,7 +454,8 @@ SPARSE_FORTRAN_SOURCES = \
 src/fortran/isort1.f \
 src/fortran/spt.f \
 src/fortran/sz2ptr.f \
-src/fortran/spreshape.f
+src/fortran/spreshape.f \
+src/fortran/ordmmd.f
 
 GATEWAY_C_SOURCES = 
 GATEWAY_CPP_SOURCES = \
@@ -467,7 +468,8 @@ sci_gateway/cpp/sci_sparse.cpp \
 sci_gateway/cpp/sci_spcompack.cpp \
 sci_gateway/cpp/sci_spget.cpp \
 sci_gateway/cpp/sci_spzeros.cpp \
-sci_gateway/cpp/sci_spones.cpp
+sci_gateway/cpp/sci_spones.cpp \
+sci_gateway/cpp/sci_ordmmd.cpp
 
 libscisparse_la_CPPFLAGS = -I$(srcdir)/includes/ \
                                -I$(top_srcdir)/modules/ast/includes/ \
@@ -671,6 +673,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_adj2sp.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_full.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_nnz.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_ordmmd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_sp2adj.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_sparse.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscisparse_la-sci_spcompack.Plo@am__quote@
@@ -770,6 +773,13 @@ libscisparse_la-sci_spones.lo: sci_gateway/cpp/sci_spones.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisparse_la-sci_spones.lo `test -f 'sci_gateway/cpp/sci_spones.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_spones.cpp
 
+libscisparse_la-sci_ordmmd.lo: sci_gateway/cpp/sci_ordmmd.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscisparse_la-sci_ordmmd.lo -MD -MP -MF $(DEPDIR)/libscisparse_la-sci_ordmmd.Tpo -c -o libscisparse_la-sci_ordmmd.lo `test -f 'sci_gateway/cpp/sci_ordmmd.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ordmmd.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscisparse_la-sci_ordmmd.Tpo $(DEPDIR)/libscisparse_la-sci_ordmmd.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_ordmmd.cpp' object='libscisparse_la-sci_ordmmd.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscisparse_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscisparse_la-sci_ordmmd.lo `test -f 'sci_gateway/cpp/sci_ordmmd.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ordmmd.cpp
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
@@ -791,6 +801,9 @@ sz2ptr.lo: src/fortran/sz2ptr.f
 spreshape.lo: src/fortran/spreshape.f
        $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o spreshape.lo `test -f 'src/fortran/spreshape.f' || echo '$(srcdir)/'`src/fortran/spreshape.f
 
+ordmmd.lo: src/fortran/ordmmd.f
+       $(LIBTOOL)  --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) -c -o ordmmd.lo `test -f 'src/fortran/ordmmd.f' || echo '$(srcdir)/'`src/fortran/ordmmd.f
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index 04bb577..52a4662 100644 (file)
@@ -37,5 +37,6 @@ CPP_GATEWAY_PROTOTYPE(sci_spget);
 CPP_GATEWAY_PROTOTYPE(sci_spzeros);
 CPP_GATEWAY_PROTOTYPE(sci_spones);
 CPP_GATEWAY_PROTOTYPE(sci_full);
+CPP_GATEWAY_PROTOTYPE(sci_ordmmd);
 
 #endif /* !__SPARSE_GW_HXX__ */
diff --git a/scilab/modules/sparse/macros/sp2adj.sci b/scilab/modules/sparse/macros/sp2adj.sci
deleted file mode 100644 (file)
index 17cb5dd..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) XXXX-2008 - INRIA
-// Copyright (C) 2010 - DIGITEO - Michael Baudin
-// 
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution.  The terms
-// are also available at    
-// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-
-
-function [xadj,iadj,v]=sp2adj(A)
-    // sparse conversion to adjacency
-    // See sp2adj.xml for help.
-    //
-    // Check number of arguments
-    [lhs, rhs] = argn()
-    if ( rhs <> 1 ) then
-        lstr = gettext("%s: Wrong number of input arguments: %d to %d expected.\n")
-        error ( msprintf(lstr,"sp2adj",1,1))
-    end
-    if ( and(lhs <> [0 1 2 3]) ) then
-        lstr = gettext("%s: Wrong number of output arguments: %d to %d expected.\n")
-        error ( msprintf(lstr,"sp2adj",0,3))
-    end
-    //
-    // Check type of arguments
-    if ( typeof(A) <> "sparse" ) then
-        lstr = gettext("%s: Wrong type for input argument #%d.\n")
-        error ( msprintf(lstr,"sp2adj",1))
-    end
-    //
-    // Check size of arguments
-    // Nothing to do
-    //
-    // Check content of arguments
-    // Nothing to do
-    //
-    [ij,v,n]=spget(A')
-    N=n(1)
-    if ( ij == [] ) then,
-        xadj=ones(n(2)+1,1)
-        iadj=[]
-        v=[]
-    else,
-        [xadj,la,iadj]=ta2lpd(ij(:,1)',ij(:,2)',N+1,N)
-        xadj=xadj(:)
-        iadj=iadj(:)
-    end
-endfunction
diff --git a/scilab/modules/sparse/sci_gateway/cpp/sci_ordmmd.cpp b/scilab/modules/sparse/sci_gateway/cpp/sci_ordmmd.cpp
new file mode 100644 (file)
index 0000000..6ce92a5
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2010-2010 - DIGITEO - Bernard HUGUENEY
+*
+*  This file must be used under the terms of the CeCILL.
+*  This source file is licensed as described in the file COPYING, which
+*  you should have received as part of this distribution.  The terms
+*  are also available at
+*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+#include <iostream>
+#include "sparse_gw.hxx"
+#include "function.hxx"
+#include "sparse.hxx"
+
+extern "C"
+{
+#include "charEncoding.h"
+#include "Scierror.h"
+#include "localization.h"
+}
+
+extern "C" int C2F(ordmmd)(int* neqns, int* xadj, int* adjncy, int* invp, int* perm,
+                           int* iwsiz, int* iwork, int* nofsub, int* iflag);
+
+using namespace types;
+
+Function::ReturnValue sci_ordmmd(typed_list &in, int _iRetCount, typed_list &out)
+{
+    if (in.size() != 3)
+    {
+        Scierror(999, _("%s: Wrong number of input argument(s): %d expected.\n"), "ordmmd", 3);
+        return Function::Error;
+    }
+
+    if (_iRetCount != 3)
+    {
+        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), "ordmmd", 3);
+        return Function::Error;
+    }
+
+
+    //get argument #1
+    if (in[0]->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A matrix of integer value expected.\n"), "ordmmd", 1);
+        return Function::Error;
+    }
+
+    Double* pdbl1 = in[0]->getAs<Double>();
+    pdbl1->convertToInteger();
+    int* pXADJ = (int*)pdbl1->get();
+
+    //get argument #2
+    if (in[1]->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: A matrix of integer value expected.\n"), "ordmmd", 2);
+        return Function::Error;
+    }
+
+    Double* pdbl2 = in[1]->getAs<Double>();
+    pdbl2->convertToInteger();
+    int* pADJNCY = (int*)pdbl2->get();
+
+    //get argument #3
+    Double* pdbl3 = in[2]->getAs<Double>();
+    if (in[2]->isDouble() == false || pdbl3->getSize() != 1)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: An integer value expected.\n"), "ordmmd", 3);
+        return Function::Error;
+    }
+
+    int NEQNS = (int)pdbl3->get(0);
+
+    Double* pdbl4 = new Double(NEQNS, 1);
+    pdbl4->convertToInteger();
+
+    Double* pdbl5 = new Double(NEQNS, 1);
+    pdbl5->convertToInteger();
+
+    Double* pdbl6 = new Double(1, 1);
+    pdbl6->convertToInteger();
+
+    Double* pdbl7 = new Double(4 * NEQNS, 1);
+    pdbl7->convertToInteger();
+    int iSize = 4 * NEQNS;
+
+    int iFlag = 0;
+    C2F(ordmmd)(&NEQNS, (int*)pdbl1->get(), (int*)pdbl2->get(), (int*)pdbl5->get(),
+                (int*)pdbl4->get(), &iSize, (int*)pdbl7->get(), (int*)pdbl6->get(), &iFlag);
+
+    if (iFlag)
+    {
+        Scierror(999, _("%s: insufficient working storage"), "ordmmd");
+        return Function::Error;
+    }
+
+    pdbl1->convertFromInteger();
+    pdbl2->convertFromInteger();
+    pdbl4->convertFromInteger();
+    pdbl5->convertFromInteger();
+    pdbl6->convertFromInteger();
+    pdbl7->convertFromInteger();
+    delete pdbl7;
+
+    out.push_back(pdbl4);
+    out.push_back(pdbl5);
+    out.push_back(pdbl6);
+
+    return Function::OK;
+}
+
diff --git a/scilab/modules/sparse/sci_gateway/cpp/sparse_f_Import.def b/scilab/modules/sparse/sci_gateway/cpp/sparse_f_Import.def
new file mode 100644 (file)
index 0000000..40dc192
--- /dev/null
@@ -0,0 +1,6 @@
+LIBRARY    sparse_f.dll
+
+
+EXPORTS
+ordmmd_
+
index 8ac3d6e..3069847 100644 (file)
@@ -25,6 +25,6 @@ int SparseModule::Load()
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spzeros", &sci_spzeros, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spones", &sci_spones, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"full", &sci_full, MODULE_NAME));
-
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"ordmmd", &sci_ordmmd, MODULE_NAME));
     return 1;
 }
index 03072b5..9ffcfe6 100644 (file)
       <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
       <TargetMachine>MachineX86</TargetMachine>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <AdditionalDependencies>sparse_f.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PreLinkEvent>
+      <Command>lib /DEF:"$(ProjectDir)sparse_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+    </PreLinkEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
       <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <AdditionalDependencies>sparse_f.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PreLinkEvent>
+      <Command>lib /DEF:"$(ProjectDir)sparse_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+    </PreLinkEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
       <TargetMachine>MachineX86</TargetMachine>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <AdditionalDependencies>sparse_f.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PreLinkEvent>
+      <Command>lib /DEF:"$(ProjectDir)sparse_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+    </PreLinkEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <Midl>
       <ImportLibrary>$(TargetDir)$(TargetName).lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
       <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <AdditionalDependencies>sparse_f.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
+    <PreLinkEvent>
+      <Command>lib /DEF:"$(ProjectDir)sparse_f_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)sparse_f.lib" 1&gt;NUL 2&gt;NUL</Command>
+    </PreLinkEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="sci_adj2sp.cpp" />
     <ClCompile Include="sci_full.cpp" />
     <ClCompile Include="sci_nnz.cpp" />
+    <ClCompile Include="sci_ordmmd.cpp" />
     <ClCompile Include="sci_sp2adj.cpp" />
     <ClCompile Include="sci_sparse.cpp" />
     <ClCompile Include="sci_spcompack.cpp" />
   <ItemGroup>
     <Library Include="..\..\..\..\bin\libintl.lib" />
   </ItemGroup>
+  <ItemGroup>
+    <None Include="sparse_f_Import.def" />
+  </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
index 6e7229e..5a4f129 100644 (file)
@@ -48,6 +48,9 @@
     <ClCompile Include="sparse_gw.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="sci_ordmmd.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\sparse_gw.hxx">
@@ -57,4 +60,9 @@
   <ItemGroup>
     <Library Include="..\..\..\..\bin\libintl.lib" />
   </ItemGroup>
+  <ItemGroup>
+    <None Include="sparse_f_Import.def">
+      <Filter>Libraries Dependencies</Filter>
+    </None>
+  </ItemGroup>
 </Project>
\ No newline at end of file
index 05d2170..253a486 100644 (file)
@@ -58,6 +58,8 @@
                <File RelativePath=".\sparse_f.rc"/></Filter>
                <Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
                <File RelativePath="isort1.f"/>
+               <File RelativePath=".\ordmmd.f"/>
+               <File RelativePath="..\..\sci_gateway\fortran\sci_f_ordmmd.f"/>
                <File RelativePath="spreshape.f"/>
                <File RelativePath="spt.f"/>
                <File RelativePath="sz2ptr.f"/></Filter>
index 66031a8..35fb79e 100644 (file)
@@ -1113,7 +1113,6 @@ void Double::convertToInteger()
     //convert in place double to integer
     int* piR = (int*)get();
     double *pdblR = get();
-    //convert in place integer to double
 
     if (isComplex())
     {
@@ -1121,18 +1120,18 @@ void Double::convertToInteger()
         double *pdblI = getImg();
 
         //normal way to prevent overlap
-        for (int i = 0 ; i < getSize() ; i--)
+        for (int i = 0 ; i < getSize() ; i++)
         {
-            pdblR[i] = (double)piR[i];
-            pdblI[i] = (double)piI[i];
+            piR[i] = (int)pdblR[i];
+            piI[i] = (int)pdblI[i];
         }
     }
     else
     {
         //normal way to prevent overlap
-        for (int i = 0 ; i < getSize() ; i--)
+        for (int i = 0 ; i < getSize() ; i++)
         {
-            pdblR[i] = (double)piR[i];
+            piR[i] = (int)pdblR[i];
         }
     }