diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/iemmatrix.dsp | 85 | ||||
-rw-r--r-- | src/iemmatrix.dsw | 29 | ||||
-rw-r--r-- | src/iemmatrix.h | 2 | ||||
-rw-r--r-- | src/makefile_win | 67 | ||||
-rw-r--r-- | src/mtx_gauss.c | 2 | ||||
-rw-r--r-- | src/mtx_mul.c | 4 |
6 files changed, 187 insertions, 2 deletions
diff --git a/src/iemmatrix.dsp b/src/iemmatrix.dsp new file mode 100644 index 0000000..4dfe21e --- /dev/null +++ b/src/iemmatrix.dsp @@ -0,0 +1,85 @@ +# Microsoft Developer Studio Project File - Name="iemmatrix" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** NICHT BEARBEITEN **
+
+# TARGTYPE "Win32 (x86) External Target" 0x0106
+
+CFG=iemmatrix - Win32 Debug
+!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
+!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
+!MESSAGE
+!MESSAGE NMAKE /f "iemmatrix.mak".
+!MESSAGE
+!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
+!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
+!MESSAGE
+!MESSAGE NMAKE /f "iemmatrix.mak" CFG="iemmatrix - Win32 Debug"
+!MESSAGE
+!MESSAGE Für die Konfiguration stehen zur Auswahl:
+!MESSAGE
+!MESSAGE "iemmatrix - Win32 Release" (basierend auf "Win32 (x86) External Target")
+!MESSAGE "iemmatrix - Win32 Debug" (basierend auf "Win32 (x86) External Target")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+
+!IF "$(CFG)" == "iemmatrix - Win32 Release"
+
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Cmd_Line "NMAKE /f makefile_win"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "makefile_win.exe"
+# PROP BASE Bsc_Name "makefile_win.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Cmd_Line "NMAKE /f makefile_win"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "iemmatrix.exe"
+# PROP Bsc_Name "iemmatrix.bsc"
+# PROP Target_Dir ""
+
+!ELSEIF "$(CFG)" == "iemmatrix - Win32 Debug"
+
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Cmd_Line "NMAKE /f makefile_win"
+# PROP BASE Rebuild_Opt "/a"
+# PROP BASE Target_File "makefile_win.exe"
+# PROP BASE Bsc_Name "makefile_win.bsc"
+# PROP BASE Target_Dir ""
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Cmd_Line "NMAKE /f makefile_win"
+# PROP Rebuild_Opt "/a"
+# PROP Target_File "iemmatrix.exe"
+# PROP Bsc_Name "iemmatrix.bsc"
+# PROP Target_Dir ""
+
+!ENDIF
+
+# Begin Target
+
+# Name "iemmatrix - Win32 Release"
+# Name "iemmatrix - Win32 Debug"
+
+!IF "$(CFG)" == "iemmatrix - Win32 Release"
+
+!ELSEIF "$(CFG)" == "iemmatrix - Win32 Debug"
+
+!ENDIF
+
+# Begin Source File
+
+SOURCE=.\makefile_win
+# End Source File
+# End Target
+# End Project
diff --git a/src/iemmatrix.dsw b/src/iemmatrix.dsw new file mode 100644 index 0000000..ef6a11c --- /dev/null +++ b/src/iemmatrix.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
+
+###############################################################################
+
+Project: "iemmatrix"=.\iemmatrix.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/src/iemmatrix.h b/src/iemmatrix.h index 6622441..4080707 100644 --- a/src/iemmatrix.h +++ b/src/iemmatrix.h @@ -62,6 +62,8 @@ #ifdef __WIN32__ # define fabsf fabs # define sqrtf sqrt +# define powf pow + #endif typedef double t_matrixfloat; diff --git a/src/makefile_win b/src/makefile_win new file mode 100644 index 0000000..5519e72 --- /dev/null +++ b/src/makefile_win @@ -0,0 +1,67 @@ + +all: ..\iemmatrix.dll + +VIS_CPP_PATH = "C:\Programme\Microsoft Visual Studio\Vc98" + +PD_INST_PATH = "C:\Programme\pd-0.37-1" + +PD_WIN_INCLUDE_PATH = /I. /I$(PD_INST_PATH)\src /I$(VIS_CPP_PATH)\include + +PD_WIN_C_FLAGS = /nologo /W3 /WX /DPD /D__WIN32__ /Ox -DPA_LITTLE_ENDIAN + +PD_WIN_L_FLAGS = /nologo + +PD_WIN_LIB = /NODEFAULTLIB:libc /NODEFAULTLIB:oldnames /NODEFAULTLIB:kernel /NODEFAULTLIB:uuid \ + $(VIS_CPP_PATH)\lib\libc.lib \ + $(PD_INST_PATH)\bin\pd.lib + + +SRC = mtx_add.c \ + mtx_binops.c \ + mtx_check.c \ + mtx_cholesky.c \ + mtx_col.c \ + mtx_diag.c \ + mtx_diegg.c \ + mtx_distance2.c \ + mtx_egg.c \ + mtx_element.c \ + mtx_exp.c \ + mtx_eye.c \ + mtx_gauss.c \ + mtx_inverse.c \ + mtx_log.c \ + mtx_matrix.c \ + mtx_mean.c \ + mtx_mul.c \ + mtx_mul~.c \ + mtx_ones.c \ + mtx_pivot.c \ + mtx_pow.c \ + mtx_print.c \ + mtx_prod.c \ + mtx_rand.c \ + mtx_resize.c \ + mtx_roll.c \ + mtx_row.c \ + mtx_scroll.c \ + mtx_size.c \ + mtx_sub.c \ + mtx_sum.c \ + mtx_trace.c \ + mtx_transpose.c \ + mtx_zeros.c \ + iemmatrix.c + + +OBJ = $(SRC:.c=.obj) + +.c.obj: + cl $(PD_WIN_C_FLAGS) $(PD_WIN_INCLUDE_PATH) /c $*.c + +..\iemmatrix.dll: $(OBJ) + link $(PD_WIN_L_FLAGS) /dll /export:iemmatrix_setup \ + /out:..\iemmatrix.dll $(OBJ) $(PD_WIN_LIB) + +clean: + del *.obj diff --git a/src/mtx_gauss.c b/src/mtx_gauss.c index c115a4a..c6d9a3f 100644 --- a/src/mtx_gauss.c +++ b/src/mtx_gauss.c @@ -42,6 +42,7 @@ static void mtx_gauss_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) int row=atom_getfloat(argv); int col=atom_getfloat(argv+1); int i, j, k, row2=row*row; + const t_matrixfloat singrange = 1.0e-10; t_matrixfloat *original, *gaussed; t_matrixfloat *a1, *a2, *b1, *b2; // dummy pointers @@ -62,7 +63,6 @@ static void mtx_gauss_matrix(t_matrix *x, t_symbol *s, int argc, t_atom *argv) adjustsize(x, row, row); original=matrix2float(argv); - const t_matrixfloat singrange = 1.0e-10; // Gauss elimination for(i=0; i<row; i++) { int nz = 0; diff --git a/src/mtx_mul.c b/src/mtx_mul.c index 8272d53..e00af08 100644 --- a/src/mtx_mul.c +++ b/src/mtx_mul.c @@ -25,9 +25,11 @@ t_matrixfloat*mtx_doMultiply(int rowA, t_matrixfloat*A, int colArowB, t_matrixfloat*B, int colB){ t_matrixfloat*result=0; + int r, c, n; + if(!A || !B || !rowA || !colArowB || !colB)return 0; result=(t_matrixfloat*)getbytes(sizeof(t_matrixfloat)*rowA*colB); - int r, c, n; + for(r=0; r<rowA; r++){ for(c=0; c<colB; c++){ t_matrixfloat sum=0.f; |