From 46ffbfb9555dfced51a504d495f118ae4dbd3cb7 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 27 Dec 2024 11:25:51 -0500 Subject: [PATCH 001/473] Initial commit --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..dfe077042 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto From 19db60c2f1c646e1678d4083f189b1bde0783c5d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 27 Dec 2024 11:37:00 -0500 Subject: [PATCH 002/473] Empty module --- .gitignore | 4 ++++ CMakeLists.txt | 54 +++++++++++++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 4 ++++ src/newlinalg.c | 15 ++++++++++++ src/newlinalg.h | 11 +++++++++ test/newlinalg.morpho | 3 +++ 6 files changed, 91 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/newlinalg.c create mode 100644 src/newlinalg.h create mode 100644 test/newlinalg.morpho diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..e4e9d09ee --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.so +*.DS_Store +build/* +build-xcode/* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..9d0630fd6 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,54 @@ +cmake_minimum_required(VERSION 3.13) + +project(morpho-newlinalg) + +# Build the library as a plugin +add_library(newlinalg MODULE "") + +# Suppress 'lib' prefix +set_target_properties(newlinalg PROPERTIES PREFIX "") + +# Add sources +add_subdirectory(src) + +### + +# Locate the morpho.h header file and store in MORPHO_HEADER +find_file(MORPHO_HEADER + morpho.h + HINTS + /usr/local/opt/morpho + /opt/homebrew/opt/morpho + /usr/local/include/morpho + ) + +# Identify folder that morpho.h is located in from MORPHO_HEADER and store in MORPHO_INCLUDE +get_filename_component(MORPHO_INCLUDE ${MORPHO_HEADER} DIRECTORY) + +# Add morpho headers to MORPHO_INCLUDE +target_include_directories(newlinalg PUBLIC ${MORPHO_INCLUDE}) + +# Add general header search paths +target_include_directories(newlinalg PUBLIC /usr/local/include /opt/homebrew/include) + +# Add morpho headers in subfolders to MORPHO_INCLUDE +file(GLOB morpho_subdirectories LIST_DIRECTORIES true ${MORPHO_INCLUDE}/*) +foreach(dir ${morpho_subdirectories}) + IF(IS_DIRECTORY ${dir}) + target_include_directories(zeromq PUBLIC ${dir}) + ELSE() + CONTINUE() + ENDIF() +endforeach() + +# Locate libmorpho +find_library(MORPHO_LIBRARY + NAMES morpho libmorpho +) + +target_link_libraries(newlinalg ${MORPHO_LIBRARY} ${ZMQ_LIBRARY} ${CZMQ_LIBRARY}) + +set(CMAKE_INSTALL_PREFIX ..) + +# Install the resulting binary +install(TARGETS newlinalg LIBRARY DESTINATION lib/) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..3ff084f99 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,4 @@ +target_sources(newlinalg + PRIVATE + newlinalg.c newlinalg.h +) \ No newline at end of file diff --git a/src/newlinalg.c b/src/newlinalg.c new file mode 100644 index 000000000..dc7dd41b5 --- /dev/null +++ b/src/newlinalg.c @@ -0,0 +1,15 @@ +#include +#include +#include + +#include "newlinalg.h" + +/* ------------------------------------------------------- + * Initialization and finalization + * ------------------------------------------------------- */ + +void newlinalg_initialize(void) { +} + +void newlinalg_finalize(void) { +} diff --git a/src/newlinalg.h b/src/newlinalg.h new file mode 100644 index 000000000..18e5b4fb7 --- /dev/null +++ b/src/newlinalg.h @@ -0,0 +1,11 @@ + +/** @file newlinalg.h + * @author T J Atherton + * + * @brief New linear algebra library +*/ + +#ifndef newlinalg_h +#define newlinalg_h + +#endif \ No newline at end of file diff --git a/test/newlinalg.morpho b/test/newlinalg.morpho new file mode 100644 index 000000000..11bf52972 --- /dev/null +++ b/test/newlinalg.morpho @@ -0,0 +1,3 @@ + +import newlinalg + From 901c2c0e136420945a010f37bd26d6b93ab35887 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 28 Dec 2024 10:07:38 -0500 Subject: [PATCH 003/473] Updates to ComplexMatrix --- src/CMakeLists.txt | 2 + src/newlinalg.c | 9 ++-- src/newlinalg.h | 7 ++- src/xcomplexmatrix.c | 7 +++ src/xcomplexmatrix.h | 12 +++++ src/xmatrix.c | 112 ++++++++++++++++++++++++++++++++++++++++++ src/xmatrix.h | 34 +++++++++++++ test/newlinalg.morpho | 5 ++ 8 files changed, 184 insertions(+), 4 deletions(-) create mode 100644 src/xcomplexmatrix.c create mode 100644 src/xcomplexmatrix.h create mode 100644 src/xmatrix.c create mode 100644 src/xmatrix.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3ff084f99..9fd5edf22 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,6 @@ target_sources(newlinalg PRIVATE newlinalg.c newlinalg.h + xmatrix.c xmatrix.h + xcomplexmatrix.c xcomplexmatrix.h ) \ No newline at end of file diff --git a/src/newlinalg.c b/src/newlinalg.c index dc7dd41b5..d81906861 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -1,6 +1,8 @@ -#include -#include -#include +/** @file newlinalg.c + * @author T J Atherton + * + * @brief New linear algebra library +*/ #include "newlinalg.h" @@ -9,6 +11,7 @@ * ------------------------------------------------------- */ void newlinalg_initialize(void) { + xmatrix_initialize(); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index 18e5b4fb7..43a0220ab 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -8,4 +8,9 @@ #ifndef newlinalg_h #define newlinalg_h -#endif \ No newline at end of file +#include +#include + +#include "xmatrix.h" + +#endif diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c new file mode 100644 index 000000000..e0d848917 --- /dev/null +++ b/src/xcomplexmatrix.c @@ -0,0 +1,7 @@ +/** @file xcomplexmatrix.c + * @author T J Atherton + * + * @brief New linear algebra library +*/ + +#include "xcomplexmatrix.h" diff --git a/src/xcomplexmatrix.h b/src/xcomplexmatrix.h new file mode 100644 index 000000000..7cfb91423 --- /dev/null +++ b/src/xcomplexmatrix.h @@ -0,0 +1,12 @@ +/** @file xcomplexmatrix.h + * @author T J Atherton + * + * @brief New linear algebra library +*/ + +#ifndef xcomplexmatrix_h +#define xcomplexmatrix_h + +#include "newlinalg.h" + +#endif diff --git a/src/xmatrix.c b/src/xmatrix.c new file mode 100644 index 000000000..56d5b4e3a --- /dev/null +++ b/src/xmatrix.c @@ -0,0 +1,112 @@ +/** @file xmatrix.c + * @author T J Atherton + * + * @brief New matrices +*/ + +#include "newlinalg.h" +#include "xmatrix.h" + +/* ********************************************************************** + * XMatrix objects + * ********************************************************************** */ + +objecttype objectxmatrixtype; + +/** Matrix object definitions */ +size_t objectxmatrix_sizefn(object *obj) { + return sizeof(objectxmatrix)+sizeof(double) * + ((objectxmatrix *) obj)->nels; +} + +void objectxmatrix_printfn(object *obj, void *v) { + morpho_printf(v, "<" XMATRIX_CLASSNAME ">"); +} + +objecttypedefn objectxmatrixdefn = { + .printfn=objectxmatrix_printfn, + .markfn=NULL, + .freefn=NULL, + .sizefn=objectxmatrix_sizefn, + .hashfn=NULL, + .cmpfn=NULL +}; + +/* ********************************************************************** + * XMatrix utility functions + * ********************************************************************** */ + +objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { + int nels = nrows*ncols; + objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), OBJECT_XMATRIX); + + if (new) { + new->nrows=nrows; + new->ncols=ncols; + new->nels=nels; + new->elements=new->matrixdata; + if (zero) memset(new->elements, 0, nels*sizeof(double)); + } + + return new; +} + +/* ********************************************************************** + * XMatrix constructor + * ********************************************************************** */ + +value xmatrix_constructor(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + + int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + + objectxmatrix *new=xmatrix_new(nrows, ncols, true); + + if (new) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + + return out; +} + +value xmatrix_list_constructor(vm *v, int nargs, value *args) { + + + return MORPHO_NIL; +} + +value xmatrix_invalid_constructor(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); + return MORPHO_NIL; +} + +/* ********************************************************************** + * XMatrix veneer class + * ********************************************************************** */ + +value XMatrix_add(vm *v, int nargs, value *args) { + return MORPHO_NIL; +} + +MORPHO_BEGINCLASS(XMatrix) +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS + +/* ********************************************************************** + * Initialization + * ********************************************************************** */ + +void xmatrix_initialize(void) { + objectxmatrixtype=object_addtype(&objectxmatrixdefn); + + value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), MORPHO_NIL); + + object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); + + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_list_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_invalid_constructor, MORPHO_FN_CONSTRUCTOR, NULL); +} + diff --git a/src/xmatrix.h b/src/xmatrix.h new file mode 100644 index 000000000..a4a2006f6 --- /dev/null +++ b/src/xmatrix.h @@ -0,0 +1,34 @@ +/** @file xmatrix.h + * @author T J Atherton + * + * @brief New linear algebra library +*/ + +#ifndef xmatrix_h +#define xmatrix_h + +/* ------------------------------------------------------- + * Matrix object type + * ------------------------------------------------------- */ + +extern objecttype objectxmatrixtype; +#define OBJECT_XMATRIX objectxmatrixtype + +typedef struct { + object obj; + int nrows; + int ncols; + int nels; + double *elements; + double matrixdata[]; +} objectxmatrix; + +/* ------------------------------------------------------- + * Matrix veneer class + * ------------------------------------------------------- */ + +#define XMATRIX_CLASSNAME "XMatrix" + +void xmatrix_initialize(void); + +#endif diff --git a/test/newlinalg.morpho b/test/newlinalg.morpho index 11bf52972..58b69eed7 100644 --- a/test/newlinalg.morpho +++ b/test/newlinalg.morpho @@ -1,3 +1,8 @@ import newlinalg +var a = XMatrix(2,2) +//var b = XMatrix([1,2,3]) + +print a +//print b From 89d734d209b9e65fae241365635f758876210956 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 4 Sep 2025 09:01:51 -0400 Subject: [PATCH 004/473] Add placeholders for help --- src/support/CMakeLists.txt | 2 ++ src/support/help.c | 10 ++++++++++ src/support/help.h | 10 ++++++++++ 3 files changed, 22 insertions(+) create mode 100644 src/support/help.c create mode 100644 src/support/help.h diff --git a/src/support/CMakeLists.txt b/src/support/CMakeLists.txt index 9abfd863d..6cb67d93d 100644 --- a/src/support/CMakeLists.txt +++ b/src/support/CMakeLists.txt @@ -3,6 +3,7 @@ target_sources(morpho common.c common.h extensions.c extensions.h format.c format.h + help.c help.h lex.c lex.h memory.c memory.h parse.c parse.h @@ -20,6 +21,7 @@ target_sources(morpho common.h extensions.h format.h + help.h lex.h memory.h parse.h diff --git a/src/support/help.c b/src/support/help.c new file mode 100644 index 000000000..a45d048ac --- /dev/null +++ b/src/support/help.c @@ -0,0 +1,10 @@ +/** @file help.c + * @author T J Atherton + * + * @brief Morpho help +*/ + +#include +#include + +#include "help.h" diff --git a/src/support/help.h b/src/support/help.h new file mode 100644 index 000000000..737d9a405 --- /dev/null +++ b/src/support/help.h @@ -0,0 +1,10 @@ +/** @file help.h + * @author T J Atherton and others (see below) + * + * @brief Morpho help +*/ + +#ifndef help_h +#define help_h + +#endif /* help_h */ From 0a37a45f62202b1c5a64e020187c49c66f88b43e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 4 Sep 2025 09:48:40 -0400 Subject: [PATCH 005/473] Initial implementation of CG3 --- src/geometry/fespace.c | 84 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 17b3603ab..229afda94 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -314,6 +314,90 @@ fespace cg2_2d = { .lower = cg2_2d_lower }; +/* ------------------------------------------------------- + * CG3 element in 2D + * ------------------------------------------------------- */ + +/* 2 + * | \ + * 7 6 + * | \ + * 8 10 5 + * | \ + * 0-3--4-1 + */ + +void cg3_2dinterpolate(double *lambda, double *wts) { + wts[0]=lambda[0]*(1.0 + 4.5*(lambda[0]-1)*lambda[0]); + wts[1]=lambda[1]*(1.0 + 4.5*(lambda[1]-1)*lambda[1]); + wts[2]=lambda[2]*(1.0 + 4.5*(lambda[2]-1)*lambda[2]); + wts[3]=4.5*lambda[0]*lambda[1]*(3*lambda[0]-1.0); + wts[4]=4.5*lambda[0]*lambda[1]*(3*lambda[1]-1.0); + wts[5]=4.5*lambda[1]*lambda[2]*(3*lambda[1]-1.0); + wts[6]=4.5*lambda[1]*lambda[2]*(3*lambda[2]-1.0); + wts[7]=4.5*lambda[0]*lambda[2]*(3*lambda[2]-1.0); + wts[8]=4.5*lambda[0]*lambda[2]*(3*lambda[0]-1.0); + wts[9]=27.0*lambda[0]*lambda[1]*lambda[2]; +} + +void cg3_2dgrad(double *lambda, double *grad) { + // Gij = d Xi[i] / d lambda[j] + // Note this is in column-major order! + double g[] = + { }; + memcpy(grad, g, sizeof(g)); +} + +unsigned int cg3_2dshape[] = { 1, 1, 0 }; + +double cg3_2dnodes[] = { 0.0, 0.0, + 1.0, 0.0, + 0.0, 1.0, + 0.3333333333333333,0.0, + 0.6666666666666666,0.0, + 0.6666666666666666,0.3333333333333333, + 0.3333333333333333,0.6666666666666666, + 0,0.6666666666666666, + 0,0.3333333333333333, + 0.3333333333333333,0.3333333333333333 }; + +eldefninstruction cg3_2deldefn[] = { + LINE(0,0,1), // Identify line subelement with vertex indices (0,1) + LINE(1,1,2), // Identify line subelement with vertex indices (1,2) + LINE(2,2,0), // Identify line subelement with vertex indices (2,0) + AREA(0,0,1,2), // Identify area subelement with vertex indices (0,1,2) + QUANTITY(0,0,0), // Fetch quantity on vertex 0 + QUANTITY(0,1,0), // Fetch quantity on vertex 1 + QUANTITY(0,2,0), // Fetch quantity on vertex 2 + QUANTITY(1,0,0), // Fetch quantity 0 from line 0 + QUANTITY(1,0,1), // Fetch quantity 1 from line 0 + QUANTITY(1,1,0), // Fetch quantity 0 from line 1 + QUANTITY(1,1,1), // Fetch quantity 1 from line 1 + QUANTITY(1,2,0), // Fetch quantity 0 from line 2 + QUANTITY(1,2,1), // Fetch quantity 1 from line 2 + QUANTITY(2,0,0), // Fetch quantity 0 from area 0 + ENDDEFN +}; + +fespace *cg3_2d_lower[] = { + &cg2_1d, + NULL +}; + +fespace cg3_2d = { + .name = "CG3", + .grade = 2, + .shape = cg3_2dshape, + .degree = 3, + .nnodes = 10, + .nsubel = 4, + .nodes = cg3_2dnodes, + .ifn = cg3_2dinterpolate, + .gfn = cg3_2dgrad, + .eldefn = cg3_2deldefn, + .lower = cg3_2d_lower +}; + /* ------------------------------------------------------- * CG1 element in 3D * ------------------------------------------------------- */ From 5ba759f2f05afbf6d3446a069de1bfb8210e6ba4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 4 Sep 2025 22:16:48 -0400 Subject: [PATCH 006/473] Update CG3 1D definitions --- src/geometry/fespace.c | 42 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 229afda94..33f4dc3b1 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -155,13 +155,26 @@ fespace cg2_1d = { */ void cg3_1dinterpolate(double *lambda, double *wts) { - double a = (9.0/2.0)*lambda[0]*lambda[1]; + double a = 4.5*lambda[0]*lambda[1]; wts[0]=lambda[0]*(1-a); wts[1]=lambda[1]*(1-a); wts[2]=a*(2*lambda[0]-lambda[1]); wts[3]=a*(2*lambda[1]-lambda[0]); } +void cg3_1dgrad(double *lambda, double *grad) { + // Gij = d Xi[i] / d lambda[j] + // Note this is in column-major order! + double g[] = + { 1-9*lambda[0]*lambda[1], -4.5*lambda[1]*lambda[1], + 4.5*(4*lambda[0]-lambda[1])*lambda[1], 9*lambda[1]*(lambda[1]-lambda[0]), + + -4.5*lambda[0]*lambda[0], 1-9*lambda[0]*lambda[1], + 9*lambda[0]*(lambda[0]-lambda[1]), 4.5*(4*lambda[1]-lambda[0])*lambda[0] + }; + memcpy(grad, g, sizeof(g)); +} + unsigned int cg3_1dshape[] = { 1, 2 }; double cg3_1dnodes[] = { 0.0, 1.0, 1.0/3.0, 2.0/3.0 }; @@ -184,6 +197,7 @@ fespace cg3_1d = { .nsubel = 1, .nodes = cg3_1dnodes, .ifn = cg3_1dinterpolate, + .gfn = cg3_1dgrad, .eldefn = cg3_1ddefn, .lower = NULL }; @@ -341,14 +355,30 @@ void cg3_2dinterpolate(double *lambda, double *wts) { } void cg3_2dgrad(double *lambda, double *grad) { - // Gij = d Xi[i] / d lambda[j] - // Note this is in column-major order! + // Gij = d Xi[i] / d lambda[j] in col. major order double g[] = - { }; + { 1.0 + 4.5*lambda[0]*(3*lambda[0]-2), 0, 0, + 4.5*lambda[1]*(6*lambda[0]-1), 4.5*lambda[1]*(3*lambda[0]-1), + 0, 0, + 4.5*lambda[2]*(3*lambda[2]-1), 4.5*lambda[2]*(6*lambda[0]-1), + 27*lambda[1]*lambda[2], + + 0, 1.0 + 4.5*lambda[1]*(3*lambda[1]-2), 0, + 4.5*lambda[0]*(3*lambda[0]-1), 4.5*lambda[0]*(6*lambda[1]-1), + 4.5*lambda[2]*(6*lambda[1]-1), 4.5*lambda[2]*(3*lambda[2]-1), + 0, 0, + 27*lambda[0]*lambda[2], + + 0, 0, 1.0 + 4.5*lambda[2]*(3*lambda[2]-2), + 0, 0, + 4.5*lambda[1]*(3*lambda[1]-1), 4.5*lambda[1]*(6*lambda[2]-1), + 4.5*lambda[0]*(6*lambda[2]-1), 4.5*lambda[0]*(3*lambda[0]-1), + 27*lambda[0]*lambda[1], + }; memcpy(grad, g, sizeof(g)); } -unsigned int cg3_2dshape[] = { 1, 1, 0 }; +unsigned int cg3_2dshape[] = { 1, 2, 1 }; double cg3_2dnodes[] = { 0.0, 0.0, 1.0, 0.0, @@ -380,7 +410,7 @@ eldefninstruction cg3_2deldefn[] = { }; fespace *cg3_2d_lower[] = { - &cg2_1d, + &cg3_1d, NULL }; From f017a9e23c85dba6e8936a5e4d284e4e4b06a405 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 8 Sep 2025 21:05:19 -0400 Subject: [PATCH 007/473] Reorganize field/discretizations --- src/geometry/fespace.c | 2 ++ .../{ => cg1}/cg1_area_in_2d_grad.morpho | 0 .../{ => cg1}/cg1_area_in_2d_grad_old.morpho | 0 .../{ => cg1}/cg1_area_in_2d_old.morpho | 0 .../{ => cg1}/cg1_line_in_3d_grad.morpho | 0 .../{ => cg2}/cg2_area_in_2d.morpho | 0 .../{ => cg2}/cg2_area_in_2d_grad.morpho | 0 .../cg2_area_in_2d_tensor_grad.morpho | 0 .../{ => cg2}/cg2_area_in_3d_grad.morpho | 0 .../{ => cg2}/cg2_line_in_1d.morpho | 0 .../{ => cg2}/cg2_line_in_2d_grad.morpho | 0 .../{ => cg2}/cg2_line_in_3d_integrate.morpho | 0 .../{ => cg2}/cg2_vol_in_3d.morpho | 0 .../{ => cg2}/cg2_vol_in_3d_grad.morpho | 0 .../discretizations/cg3/cg3_area_in_2d.morpho | 22 +++++++++++++ .../discretizations/cg3/cg3_line_in_1d.morpho | 33 +++++++++++++++++++ 16 files changed, 57 insertions(+) rename test/field/discretizations/{ => cg1}/cg1_area_in_2d_grad.morpho (100%) rename test/field/discretizations/{ => cg1}/cg1_area_in_2d_grad_old.morpho (100%) rename test/field/discretizations/{ => cg1}/cg1_area_in_2d_old.morpho (100%) rename test/field/discretizations/{ => cg1}/cg1_line_in_3d_grad.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_area_in_2d.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_area_in_2d_grad.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_area_in_2d_tensor_grad.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_area_in_3d_grad.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_line_in_1d.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_line_in_2d_grad.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_line_in_3d_integrate.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_vol_in_3d.morpho (100%) rename test/field/discretizations/{ => cg2}/cg2_vol_in_3d_grad.morpho (100%) create mode 100644 test/field/discretizations/cg3/cg3_area_in_2d.morpho create mode 100644 test/field/discretizations/cg3/cg3_line_in_1d.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 33f4dc3b1..40bb4e592 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -594,8 +594,10 @@ fespace cg2_3d = { fespace *fespaces[] = { &cg1_1d, &cg2_1d, + &cg3_1d, &cg1_2d, &cg2_2d, + &cg3_2d, &cg1_3d, &cg2_3d, NULL diff --git a/test/field/discretizations/cg1_area_in_2d_grad.morpho b/test/field/discretizations/cg1/cg1_area_in_2d_grad.morpho similarity index 100% rename from test/field/discretizations/cg1_area_in_2d_grad.morpho rename to test/field/discretizations/cg1/cg1_area_in_2d_grad.morpho diff --git a/test/field/discretizations/cg1_area_in_2d_grad_old.morpho b/test/field/discretizations/cg1/cg1_area_in_2d_grad_old.morpho similarity index 100% rename from test/field/discretizations/cg1_area_in_2d_grad_old.morpho rename to test/field/discretizations/cg1/cg1_area_in_2d_grad_old.morpho diff --git a/test/field/discretizations/cg1_area_in_2d_old.morpho b/test/field/discretizations/cg1/cg1_area_in_2d_old.morpho similarity index 100% rename from test/field/discretizations/cg1_area_in_2d_old.morpho rename to test/field/discretizations/cg1/cg1_area_in_2d_old.morpho diff --git a/test/field/discretizations/cg1_line_in_3d_grad.morpho b/test/field/discretizations/cg1/cg1_line_in_3d_grad.morpho similarity index 100% rename from test/field/discretizations/cg1_line_in_3d_grad.morpho rename to test/field/discretizations/cg1/cg1_line_in_3d_grad.morpho diff --git a/test/field/discretizations/cg2_area_in_2d.morpho b/test/field/discretizations/cg2/cg2_area_in_2d.morpho similarity index 100% rename from test/field/discretizations/cg2_area_in_2d.morpho rename to test/field/discretizations/cg2/cg2_area_in_2d.morpho diff --git a/test/field/discretizations/cg2_area_in_2d_grad.morpho b/test/field/discretizations/cg2/cg2_area_in_2d_grad.morpho similarity index 100% rename from test/field/discretizations/cg2_area_in_2d_grad.morpho rename to test/field/discretizations/cg2/cg2_area_in_2d_grad.morpho diff --git a/test/field/discretizations/cg2_area_in_2d_tensor_grad.morpho b/test/field/discretizations/cg2/cg2_area_in_2d_tensor_grad.morpho similarity index 100% rename from test/field/discretizations/cg2_area_in_2d_tensor_grad.morpho rename to test/field/discretizations/cg2/cg2_area_in_2d_tensor_grad.morpho diff --git a/test/field/discretizations/cg2_area_in_3d_grad.morpho b/test/field/discretizations/cg2/cg2_area_in_3d_grad.morpho similarity index 100% rename from test/field/discretizations/cg2_area_in_3d_grad.morpho rename to test/field/discretizations/cg2/cg2_area_in_3d_grad.morpho diff --git a/test/field/discretizations/cg2_line_in_1d.morpho b/test/field/discretizations/cg2/cg2_line_in_1d.morpho similarity index 100% rename from test/field/discretizations/cg2_line_in_1d.morpho rename to test/field/discretizations/cg2/cg2_line_in_1d.morpho diff --git a/test/field/discretizations/cg2_line_in_2d_grad.morpho b/test/field/discretizations/cg2/cg2_line_in_2d_grad.morpho similarity index 100% rename from test/field/discretizations/cg2_line_in_2d_grad.morpho rename to test/field/discretizations/cg2/cg2_line_in_2d_grad.morpho diff --git a/test/field/discretizations/cg2_line_in_3d_integrate.morpho b/test/field/discretizations/cg2/cg2_line_in_3d_integrate.morpho similarity index 100% rename from test/field/discretizations/cg2_line_in_3d_integrate.morpho rename to test/field/discretizations/cg2/cg2_line_in_3d_integrate.morpho diff --git a/test/field/discretizations/cg2_vol_in_3d.morpho b/test/field/discretizations/cg2/cg2_vol_in_3d.morpho similarity index 100% rename from test/field/discretizations/cg2_vol_in_3d.morpho rename to test/field/discretizations/cg2/cg2_vol_in_3d.morpho diff --git a/test/field/discretizations/cg2_vol_in_3d_grad.morpho b/test/field/discretizations/cg2/cg2_vol_in_3d_grad.morpho similarity index 100% rename from test/field/discretizations/cg2_vol_in_3d_grad.morpho rename to test/field/discretizations/cg2/cg2_vol_in_3d_grad.morpho diff --git a/test/field/discretizations/cg3/cg3_area_in_2d.morpho b/test/field/discretizations/cg3/cg3_area_in_2d.morpho new file mode 100644 index 000000000..c15c73be9 --- /dev/null +++ b/test/field/discretizations/cg3/cg3_area_in_2d.morpho @@ -0,0 +1,22 @@ +// CG2 FunctionSpace in two dimensions + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addvertex([1,1]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) +var m = mb.build() +m.addgrade(1) + +var l = FiniteElementSpace("CG2", grade=2) + +var f = Field(m, fn (x,y) (x+y)^3, finiteelementspace=l) + +print f.shape() // expect: [ 1, 1, 0 ] + +print abs(AreaIntegral(fn (x, phi) phi, f, method={ }).total(m)-4/9) < 1e-6 +// expect: true diff --git a/test/field/discretizations/cg3/cg3_line_in_1d.morpho b/test/field/discretizations/cg3/cg3_line_in_1d.morpho new file mode 100644 index 000000000..e963804db --- /dev/null +++ b/test/field/discretizations/cg3/cg3_line_in_1d.morpho @@ -0,0 +1,33 @@ +// CG3 FunctionSpace in one dimension + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([0.5,0,0]) +mb.addvertex([1,0,0]) +mb.addedge([0,1]) +mb.addedge([1,2]) +var m = mb.build() + +var l = FiniteElementSpace("CG3", grade=1) + +var f = Field(m, fn (x,y,z) x^3, finiteelementspace=l) + +print f[2,1] + +print l.layout(f) +// expect: [ 1 0 ] +// expect: [ 1 1 ] +// expect: [ 0 1 ] +// expect: [ 1 0 ] +// expect: [ 1 0 ] +// expect: [ 0 1 ] +// expect: [ 0 1 ] + +print f.shape() +// expect: [ 1, 2 ] + +print (LineIntegral(fn (x, u) u, f, method={ }).total(m) - 1/4) < 1e-10 +// expect: true + From 6e2414c6c05dc7984dc7408ba8371b141d0b74eb Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 25 Sep 2025 09:16:38 -0400 Subject: [PATCH 008/473] Type checking across arithmetic operations --- src/core/compile.c | 44 ++++++++++++++++++- test/types/type_return.morpho | 11 +++++ .../type_violation_arithmetic.morpho | 10 +++++ .../type_violation_comparison.morpho | 10 +++++ .../type_violation_constant.morpho | 0 .../type_violation_dictionary.morpho | 0 .../type_violation_global.morpho | 0 .../type_violation_in_function.morpho | 0 .../type_violation_inheritance.morpho | 0 .../type_violation_instance.morpho | 0 .../type_violation_matrix.morpho | 0 .../violations/type_violation_power.morpho | 10 +++++ .../type_violation_propagation.morpho | 0 .../type_violation_range.morpho | 0 .../violations/type_violation_tuple.morpho | 10 +++++ 15 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 test/types/type_return.morpho create mode 100644 test/types/violations/type_violation_arithmetic.morpho create mode 100644 test/types/violations/type_violation_comparison.morpho rename test/types/{ => violations}/type_violation_constant.morpho (100%) rename test/types/{ => violations}/type_violation_dictionary.morpho (100%) rename test/types/{ => violations}/type_violation_global.morpho (100%) rename test/types/{ => violations}/type_violation_in_function.morpho (100%) rename test/types/{ => violations}/type_violation_inheritance.morpho (100%) rename test/types/{ => violations}/type_violation_instance.morpho (100%) rename test/types/{ => violations}/type_violation_matrix.morpho (100%) create mode 100644 test/types/violations/type_violation_power.morpho rename test/types/{ => violations}/type_violation_propagation.morpho (100%) rename test/types/{ => violations}/type_violation_range.morpho (100%) create mode 100644 test/types/violations/type_violation_tuple.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 7b091cf82..0b9b4df97 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -2052,9 +2052,35 @@ static codeinfo compiler_not(compiler *c, syntaxtreenode *node, registerindx req return CODEINFO(REGISTER, out, ninstructions); } +bool compiler_arithmetictype(compiler *c, registerindx left, registerindx right, value *type) { + bool success=false; + value ltype=MORPHO_NIL, rtype=MORPHO_NIL; + value inttype=MORPHO_NIL, floattype=MORPHO_NIL; + if (!compiler_findtypefromcstring(c, INT_CLASSNAME, &inttype)) return success; + if (!compiler_findtypefromcstring(c, FLOAT_CLASSNAME, &floattype)) return success; + + if (compiler_regcurrenttype(c, left, <ype) && + compiler_regcurrenttype(c, right, &rtype)) { + + if (ltype==inttype && rtype==inttype) { + *type=inttype; + } else if ((ltype==inttype && rtype==floattype) || + (ltype==floattype && rtype==inttype) || + (ltype==floattype && rtype==floattype)) { + *type=floattype; + } else { + *type=MORPHO_NIL; // TODO: Lookup appropriate selector + } + + success=true; + } + return success; +} + /** Compile arithmetic operators */ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx reqout) { codeinfo left = compiler_nodetobytecode(c, node->left, REGISTER_UNALLOCATED); + unsigned int ninstructions=left.ninstructions; if (!(CODEINFO_ISREGISTER(left))) { /* Ensure we're working with a register */ @@ -2104,8 +2130,24 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx compiler_addinstruction(c, ENCODE(op, out, left.dest, right.dest), node); ninstructions++; - compiler_releaseoperand(c, left); + + /* Set the output type of the operation */ + // TODO: Check input types? + value type = MORPHO_NIL; + if (op<=OP_DIV) { // Arithmetic type + compiler_arithmetictype(c, left.dest, right.dest, &type); + } else if (op==OP_POW) { // Powers always generate floats + compiler_findtypefromcstring(c, FLOAT_CLASSNAME, &type); + } else { // Comparison operations + compiler_findtypefromcstring(c, BOOL_CLASSNAME, &type); + } + + compiler_releaseoperand(c, left); // Release operands after type information determined compiler_releaseoperand(c, right); + + if (!MORPHO_ISNIL(type) && + !compiler_regsetcurrenttype(c, node, out, type)) return CODEINFO_EMPTY; + // TODO: This should change; we always need to set the output type! return CODEINFO(REGISTER, out, ninstructions); } diff --git a/test/types/type_return.morpho b/test/types/type_return.morpho new file mode 100644 index 000000000..211980bff --- /dev/null +++ b/test/types/type_return.morpho @@ -0,0 +1,11 @@ +// Return type of a function matches type qualifier + +fn sqr(Int x) { + return x*x +} + +Int a = sqr(2) + +print a + +// expect error 'TypeErr' \ No newline at end of file diff --git a/test/types/violations/type_violation_arithmetic.morpho b/test/types/violations/type_violation_arithmetic.morpho new file mode 100644 index 000000000..96d46ddac --- /dev/null +++ b/test/types/violations/type_violation_arithmetic.morpho @@ -0,0 +1,10 @@ +// Type violation in function from an arithmetic operation + +fn f() { + String u + + u = 1+3 +} + +f() +// expect error 'TypeErr' diff --git a/test/types/violations/type_violation_comparison.morpho b/test/types/violations/type_violation_comparison.morpho new file mode 100644 index 000000000..890791814 --- /dev/null +++ b/test/types/violations/type_violation_comparison.morpho @@ -0,0 +1,10 @@ +// Type violation in function from a type comparison + +fn f() { + String u + + u = 1<3 +} + +f() +// expect error 'TypeErr' diff --git a/test/types/type_violation_constant.morpho b/test/types/violations/type_violation_constant.morpho similarity index 100% rename from test/types/type_violation_constant.morpho rename to test/types/violations/type_violation_constant.morpho diff --git a/test/types/type_violation_dictionary.morpho b/test/types/violations/type_violation_dictionary.morpho similarity index 100% rename from test/types/type_violation_dictionary.morpho rename to test/types/violations/type_violation_dictionary.morpho diff --git a/test/types/type_violation_global.morpho b/test/types/violations/type_violation_global.morpho similarity index 100% rename from test/types/type_violation_global.morpho rename to test/types/violations/type_violation_global.morpho diff --git a/test/types/type_violation_in_function.morpho b/test/types/violations/type_violation_in_function.morpho similarity index 100% rename from test/types/type_violation_in_function.morpho rename to test/types/violations/type_violation_in_function.morpho diff --git a/test/types/type_violation_inheritance.morpho b/test/types/violations/type_violation_inheritance.morpho similarity index 100% rename from test/types/type_violation_inheritance.morpho rename to test/types/violations/type_violation_inheritance.morpho diff --git a/test/types/type_violation_instance.morpho b/test/types/violations/type_violation_instance.morpho similarity index 100% rename from test/types/type_violation_instance.morpho rename to test/types/violations/type_violation_instance.morpho diff --git a/test/types/type_violation_matrix.morpho b/test/types/violations/type_violation_matrix.morpho similarity index 100% rename from test/types/type_violation_matrix.morpho rename to test/types/violations/type_violation_matrix.morpho diff --git a/test/types/violations/type_violation_power.morpho b/test/types/violations/type_violation_power.morpho new file mode 100644 index 000000000..eaca6cb98 --- /dev/null +++ b/test/types/violations/type_violation_power.morpho @@ -0,0 +1,10 @@ +// Type violation in function from a power operation + +fn f() { + String u + + u = 2^2 +} + +f() +// expect error 'TypeErr' diff --git a/test/types/type_violation_propagation.morpho b/test/types/violations/type_violation_propagation.morpho similarity index 100% rename from test/types/type_violation_propagation.morpho rename to test/types/violations/type_violation_propagation.morpho diff --git a/test/types/type_violation_range.morpho b/test/types/violations/type_violation_range.morpho similarity index 100% rename from test/types/type_violation_range.morpho rename to test/types/violations/type_violation_range.morpho diff --git a/test/types/violations/type_violation_tuple.morpho b/test/types/violations/type_violation_tuple.morpho new file mode 100644 index 000000000..d54c2f7ae --- /dev/null +++ b/test/types/violations/type_violation_tuple.morpho @@ -0,0 +1,10 @@ +// Type violation due to a constructor + +fn f() { + String u + + u = Tuple(1,2,3) +} + +f() +// expect error 'TypeErr' From f9c029012bb43342ec6e2ec3de4f36d853850055 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:33:59 -0400 Subject: [PATCH 009/473] Return type inference --- src/classes/function.c | 10 ++++++ src/classes/function.h | 3 ++ src/classes/metafunction.c | 16 ++++++++++ src/classes/metafunction.h | 2 ++ src/core/compile.c | 32 +++++++++++++++++++ src/datastructures/signature.c | 5 +++ src/datastructures/signature.h | 1 + test/types/type_return.morpho | 4 +-- test/types/type_return_metafunction.morpho | 17 ++++++++++ .../violations/type_violation_return.morpho | 9 ++++++ 10 files changed, 96 insertions(+), 3 deletions(-) create mode 100644 test/types/type_return_metafunction.morpho create mode 100644 test/types/violations/type_violation_return.morpho diff --git a/src/classes/function.c b/src/classes/function.c index a45912d89..10cf8bac6 100644 --- a/src/classes/function.c +++ b/src/classes/function.c @@ -162,6 +162,16 @@ void function_setsignature(objectfunction *func, value *signature) { signature_set(&func->sig, function_countpositionalargs(func), signature); } +/** Sets the return type of a function */ +void function_setreturntype(objectfunction *func, value type) { + signature_setreturntype(&func->sig, type); +} + +/** Get the return type of a function */ +value function_getreturntype(objectfunction *func) { + return signature_getreturntype(&func->sig); +} + /** Returns true if any of the parameters are typed */ bool function_hastypedparameters(objectfunction *func) { return signature_istyped(&func->sig); diff --git a/src/classes/function.h b/src/classes/function.h index 94cb34973..f60ad71cb 100644 --- a/src/classes/function.h +++ b/src/classes/function.h @@ -80,6 +80,9 @@ bool function_isclosure(objectfunction *func); void function_setsignature(objectfunction *func, value *signature); bool function_hastypedparameters(objectfunction *func); +void function_setreturntype(objectfunction *func, value type); +value function_getreturntype(objectfunction *func); + void objectfunction_printfn(object *obj, void *v); void function_initialize(void); diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index c948fb167..3101f9ff7 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -177,6 +177,22 @@ signature *metafunction_getsignature(value fn) { return NULL; } +/** Infer the return type from the contents of a metafunction, if known */ +void metafunction_inferreturntype(objectmetafunction *fn, value *type) { + value rtype = MORPHO_NIL; + + for (int i=0; ifns.count; i++) { + signature *sig = metafunction_getsignature(fn->fns.data[i]); + if (i==0) { + rtype=sig->ret; + } else { + if (sig->ret!=rtype) rtype=MORPHO_NIL; + } + } + + *type=rtype; +} + value _getname(value fn) { if (MORPHO_ISFUNCTION(fn)) { return MORPHO_GETFUNCTION(fn)->name; diff --git a/src/classes/metafunction.h b/src/classes/metafunction.h index 678bf43a8..3b88686eb 100644 --- a/src/classes/metafunction.h +++ b/src/classes/metafunction.h @@ -79,6 +79,8 @@ bool metafunction_matchfn(objectmetafunction *fn, value f); bool metafunction_matchset(objectmetafunction *fn, int n, value *fns); signature *metafunction_getsignature(value fn); +void metafunction_inferreturntype(objectmetafunction *fn, value *type); + bool metafunction_compile(objectmetafunction *fn, error *err); void metafunction_clearinstructions(objectmetafunction *fn); diff --git a/src/core/compile.c b/src/core/compile.c index 0b9b4df97..e137a577b 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -221,6 +221,29 @@ objectfunction *compiler_getpreviousfunction(compiler *c) { return c->prevfunction; } +bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type); + +/** Sets the return type of a function */ +void compiler_setreturntypefromregister(compiler *c, registerindx ix) { + objectfunction *func = compiler_getcurrentfunction(c); + + value type=MORPHO_NIL; + compiler_regcurrenttype(c, ix, &type); + + if (MORPHO_ISOBJECT(type)) signature_setreturntype(&func->sig, type); // TODO: Should check for current type +} + +/** Infer the return type of a call target */ +void compiler_getreturntype(compiler *c, value target, value *type) { + signature *sig=metafunction_getsignature(target); + + if (sig) { + *type=signature_getreturntype(sig); + } else if (MORPHO_ISMETAFUNCTION(target)) { + metafunction_inferreturntype(MORPHO_GETMETAFUNCTION(target), type); + } +} + /* ------------------------------------------ * Types * ------------------------------------------- */ @@ -3366,6 +3389,7 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re // Check if the call is a constructor syntaxtreenode *selnode=compiler_getnode(c, node->left); + // Attempt to infer type for constructors value rtype=MORPHO_NIL; if (selnode->type==NODE_SYMBOL) { // A regular call from a symbol compiler_findtype(c, selnode->content, &rtype); @@ -3382,6 +3406,13 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re // Compile the selector codeinfo func = compiler_nodetobytecode(c, node->left, (reqouttype==NODE_SYMBOL && compiler_catch(c, COMPILE_SYMBOLNOTDEFINED)) { syntaxtreenode *symbol=compiler_getnode(c, node->left); @@ -3559,6 +3590,7 @@ static codeinfo compiler_return(compiler *c, syntaxtreenode *node, registerindx ninstructions+=left.ninstructions; } + compiler_setreturntypefromregister(c, left.dest); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, left.dest), node); ninstructions++; } diff --git a/src/datastructures/signature.c b/src/datastructures/signature.c index 39b5ccbd8..c83248c01 100644 --- a/src/datastructures/signature.c +++ b/src/datastructures/signature.c @@ -69,6 +69,11 @@ bool signature_getparamtype(signature *s, int i, value *type) { return true; } +/** @brief Sets the return type of a function */ +void signature_setreturntype(signature *s, value type) { + s->ret=type; +} + /** @brief Returns the return type from the signature if defined */ value signature_getreturntype(signature *s) { return s->ret; diff --git a/src/datastructures/signature.h b/src/datastructures/signature.h index d101ae394..028ca4d1e 100644 --- a/src/datastructures/signature.h +++ b/src/datastructures/signature.h @@ -26,6 +26,7 @@ bool signature_istyped(signature *s); bool signature_isequal(signature *a, signature *b); bool signature_paramlist(signature *s, int *nparams, value **ptypes); bool signature_getparamtype(signature *s, int i, value *type); +void signature_setreturntype(signature *s, value type); value signature_getreturntype(signature *s); int signature_countparams(signature *s); diff --git a/test/types/type_return.morpho b/test/types/type_return.morpho index 211980bff..7d697252a 100644 --- a/test/types/type_return.morpho +++ b/test/types/type_return.morpho @@ -6,6 +6,4 @@ fn sqr(Int x) { Int a = sqr(2) -print a - -// expect error 'TypeErr' \ No newline at end of file +print a.clss() // expect: @Int diff --git a/test/types/type_return_metafunction.morpho b/test/types/type_return_metafunction.morpho new file mode 100644 index 000000000..587bdaab0 --- /dev/null +++ b/test/types/type_return_metafunction.morpho @@ -0,0 +1,17 @@ +// Return type of a function matches type qualifier + +fn sqr(Int x) { + return x*x +} + +fn sqr(Float x) { + return Int(x*x) +} + +Int a = sqr(2) + +Int b = sqr(2.5) + +print a.clss() // expect: @Int + +print b.clss() // expect: @Int diff --git a/test/types/violations/type_violation_return.morpho b/test/types/violations/type_violation_return.morpho new file mode 100644 index 000000000..ca538e462 --- /dev/null +++ b/test/types/violations/type_violation_return.morpho @@ -0,0 +1,9 @@ +// Return type of a function matches type qualifier + +fn f(Int x) { + return 2.5*x +} + +Int a = f(2) + +// expect error 'TypeErr' From e7aa1195efddc4d2dca4bd0b16a14f3b59b1f584 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:55:28 -0400 Subject: [PATCH 010/473] Add return types to some builtin functions --- src/builtin/functiondefs.c | 9 +++++---- test/types/type_return.morpho | 2 +- test/types/type_return_builtin.morpho | 6 ++++++ test/types/type_return_metafunction.morpho | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 test/types/type_return_builtin.morpho diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index b644ee513..6c28b7f43 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -602,10 +602,11 @@ value builtin_clock(vm *v, int nargs, value *args) { builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); void functiondefs_initialize(void) { - builtin_addfunction(FUNCTION_CLOCK, builtin_clock, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_RANDOM, builtin_random, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_RANDOMINT, builtin_randomint, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_RANDOMNORMAL, builtin_randomnormal, BUILTIN_FLAGSEMPTY); + morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, BUILTIN_FLAGSEMPTY, NULL); + + morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_RANDOMNORMAL, "Float ()", builtin_randomnormal, BUILTIN_FLAGSEMPTY, NULL); builtin_addfunction(FUNCTION_SYSTEM, builtin_system, BUILTIN_FLAGSEMPTY); builtin_addfunction(FUNCTION_ARCTAN, builtin_arctan, BUILTIN_FLAGSEMPTY); diff --git a/test/types/type_return.morpho b/test/types/type_return.morpho index 7d697252a..58d850b9d 100644 --- a/test/types/type_return.morpho +++ b/test/types/type_return.morpho @@ -6,4 +6,4 @@ fn sqr(Int x) { Int a = sqr(2) -print a.clss() // expect: @Int +print a.clss() // expect: @Int diff --git a/test/types/type_return_builtin.morpho b/test/types/type_return_builtin.morpho new file mode 100644 index 000000000..115836b7f --- /dev/null +++ b/test/types/type_return_builtin.morpho @@ -0,0 +1,6 @@ +// Return type of a function matches type qualifier + +Float a = clock() + +print a.clss() // expect: @Float + diff --git a/test/types/type_return_metafunction.morpho b/test/types/type_return_metafunction.morpho index 587bdaab0..1660d158b 100644 --- a/test/types/type_return_metafunction.morpho +++ b/test/types/type_return_metafunction.morpho @@ -12,6 +12,6 @@ Int a = sqr(2) Int b = sqr(2.5) -print a.clss() // expect: @Int +print a.clss() // expect: @Int -print b.clss() // expect: @Int +print b.clss() // expect: @Int From a2afc3830ede06681df95c244d99197332f270eb Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Sep 2025 13:28:47 -0400 Subject: [PATCH 011/473] FIx closure type and not --- src/core/compile.c | 8 ++++++-- test/types/type_not.morpho | 7 +++++++ test/types/violations/type_violation_fn.morpho | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 test/types/type_not.morpho create mode 100644 test/types/violations/type_violation_fn.morpho diff --git a/src/core/compile.c b/src/core/compile.c index e137a577b..b7f6d2d8a 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -2068,6 +2068,10 @@ static codeinfo compiler_not(compiler *c, syntaxtreenode *node, registerindx req ninstructions+=left.ninstructions; } + value type=MORPHO_NIL; + compiler_findtypefromcstring(c, BOOL_CLASSNAME, &type); + compiler_regsetcurrenttype(c, node, out, type); + compiler_addinstruction(c, ENCODE_DOUBLE(OP_NOT, out, left.dest), node); ninstructions++; compiler_releaseoperand(c, left); @@ -2310,7 +2314,7 @@ static codeinfo compiler_interpolation(compiler *c, syntaxtreenode *node, regist compiler_regfreetoend(c, r+1); } } - + compiler_addinstruction(c, ENCODE(OP_CAT, (reqout!=REGISTER_UNALLOCATED ? reqout : start), start, r), node); ninstructions++; @@ -3252,7 +3256,7 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind if (closure!=REGISTER_UNALLOCATED) { // Save the register where the closure is to be found compiler_regsetsymbol(c, reg, func->name); - compiler_regsettype(c, reg, _closuretype); + compiler_regsetcurrenttype(c, node, reg, _closuretype); function_setclosure(func, reg); compiler_addinstruction(c, ENCODE_DOUBLE(OP_CLOSURE, reg, (registerindx) closure), node); ninstructions++; diff --git a/test/types/type_not.morpho b/test/types/type_not.morpho new file mode 100644 index 000000000..f82b5bec7 --- /dev/null +++ b/test/types/type_not.morpho @@ -0,0 +1,7 @@ +// Type propagation through NOT + +var a = true + +Bool b = !a + +print b.clss() // expect: @Bool diff --git a/test/types/violations/type_violation_fn.morpho b/test/types/violations/type_violation_fn.morpho new file mode 100644 index 000000000..912c38de5 --- /dev/null +++ b/test/types/violations/type_violation_fn.morpho @@ -0,0 +1,7 @@ +// Assign a function to a type protected variable + +fn sqr(x) { return x^2 } + +Int a = sqr + +// expect: 'TypErr' From 18e4d885008c5937edcc7f2a87c53c97fca58b2f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Sep 2025 14:02:57 -0400 Subject: [PATCH 012/473] Ensure closure recorded correctly --- src/core/compile.c | 1 + test/types/violations/type_violation_fn.morpho | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/compile.c b/src/core/compile.c index b7f6d2d8a..0da83552f 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3256,6 +3256,7 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind if (closure!=REGISTER_UNALLOCATED) { // Save the register where the closure is to be found compiler_regsetsymbol(c, reg, func->name); + compiler_regsettype(c, reg, _closuretype); compiler_regsetcurrenttype(c, node, reg, _closuretype); function_setclosure(func, reg); compiler_addinstruction(c, ENCODE_DOUBLE(OP_CLOSURE, reg, (registerindx) closure), node); diff --git a/test/types/violations/type_violation_fn.morpho b/test/types/violations/type_violation_fn.morpho index 912c38de5..b078c0755 100644 --- a/test/types/violations/type_violation_fn.morpho +++ b/test/types/violations/type_violation_fn.morpho @@ -4,4 +4,4 @@ fn sqr(x) { return x^2 } Int a = sqr -// expect: 'TypErr' +// expect error 'TypeErr' From d242eef108a0e0c2577009aa4b0dfd129715e03c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 28 Sep 2025 10:45:53 -0400 Subject: [PATCH 013/473] Math functions implemented as metafunctions with types --- src/builtin/functiondefs.c | 35 ++++++++++++++++++++++++++++++++--- src/builtin/functiondefs.h | 2 +- src/classes/metafunction.c | 21 +++++++++++++++++++++ 3 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 6c28b7f43..59690e1b8 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -34,6 +34,27 @@ * *************************************/ #define BUILTIN_MATH(function) \ +value builtin_float_##function(vm *v, int nargs, value *args) { \ + value arg = MORPHO_GETARG(args, 0); \ + return MORPHO_FLOAT(function(MORPHO_GETFLOATVALUE(arg))); \ +} \ + \ +value builtin_int_##function(vm *v, int nargs, value *args) { \ + value arg = MORPHO_GETARG(args, 0); \ + return MORPHO_FLOAT(function((double) MORPHO_GETINTEGERVALUE(arg))); \ +} \ + \ +value builtin_cmplx_##function(vm *v, int nargs, value *args) { \ + value arg = MORPHO_GETARG(args, 0); \ + return complex_builtin##function(v, MORPHO_GETCOMPLEX(arg)); \ +} \ + \ +value builtin_numargserr_##function(vm *v, int nargs, value *args) { \ + morpho_runtimeerror(v, MATH_NUMARGS, #function); \ + return MORPHO_NIL; \ +} \ + +#define BUILTIN_MATH_OLD(function) \ value builtin_##function(vm *v, int nargs, value *args) { \ if (nargs==1) { \ value arg = MORPHO_GETARG(args, 0); \ @@ -592,9 +613,17 @@ value builtin_clock(vm *v, int nargs, value *args) { return MORPHO_FLOAT( ((double) time)/((double) CLOCKS_PER_SEC) ); } -#define BUILTIN_MATH(function) \ +#define BUILTIN_MATH_OLD2(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); +#define BUILTIN_VARMATH(label, function) \ + morpho_addfunction(label, "Float (Int)", builtin_int_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(label, "Float (Float)", builtin_float_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(label, "Complex (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(label, "(...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); + +#define BUILTIN_MATH(function) BUILTIN_VARMATH(#function, function) + #define BUILTIN_MATH_BOOL(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); @@ -611,7 +640,7 @@ void functiondefs_initialize(void) { builtin_addfunction(FUNCTION_SYSTEM, builtin_system, BUILTIN_FLAGSEMPTY); builtin_addfunction(FUNCTION_ARCTAN, builtin_arctan, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_ABS, builtin_fabs, BUILTIN_FLAGSEMPTY); + BUILTIN_VARMATH(FUNCTION_ABS, fabs) BUILTIN_MATH(exp) BUILTIN_MATH(log) @@ -626,7 +655,7 @@ void functiondefs_initialize(void) { BUILTIN_MATH(sinh) BUILTIN_MATH(cosh) BUILTIN_MATH(tanh) - BUILTIN_MATH(sqrt) + BUILTIN_MATH_OLD2(sqrt) BUILTIN_MATH(floor) BUILTIN_MATH(ceil) diff --git a/src/builtin/functiondefs.h b/src/builtin/functiondefs.h index 5ba3fd46a..f77b31904 100644 --- a/src/builtin/functiondefs.h +++ b/src/builtin/functiondefs.h @@ -48,7 +48,7 @@ #define MATH_ARGS_MSG "Function '%s' expects numerical arguments." #define MATH_NUMARGS "ExpctArgNm" -#define MATH_NUMARGS_MSG "Function '%s' expects 1 numerical argument." +#define MATH_NUMARGS_MSG "Function '%s' expects a single numerical argument." #define MATH_ATANARGS "AtanArgNm" #define MATH_ATANARGS_MSG "Function 'arctan' expects either 1 or 2 numerical arguments." diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 3101f9ff7..3c9e602cf 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -952,7 +952,28 @@ value Metafunction_count(vm *v, int nargs, value *args) { return MORPHO_INTEGER(fn->fns.count); } +value Metafunction_tostring(vm *v, int nargs, value *args) { + objectmetafunction *func=MORPHO_GETMETAFUNCTION(MORPHO_SELF(args)); + value out = MORPHO_NIL; + + varray_char buffer; + varray_charinit(&buffer); + + varray_charadd(&buffer, "name, &buffer); + varray_charwrite(&buffer, '>'); + + out = object_stringfromvarraychar(&buffer); + if (MORPHO_ISSTRING(out)) { + morpho_bindobjects(v, 1, &out); + } + varray_charclear(&buffer); + + return out; +} + MORPHO_BEGINCLASS(Metafunction) +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Metafunction_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_COUNT_METHOD, Metafunction_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS From 3a485ca31591c5f6161bc01703556c754c14e032 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 28 Sep 2025 11:01:36 -0400 Subject: [PATCH 014/473] Builtin math functions that return a Bool --- src/builtin/functiondefs.c | 62 ++++++++++---------------------------- src/classes/cmplx.c | 2 +- src/classes/cmplx.h | 6 ++-- 3 files changed, 20 insertions(+), 50 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 59690e1b8..e960c05d6 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -33,15 +33,15 @@ * Math * *************************************/ -#define BUILTIN_MATH(function) \ +#define BUILTIN_VARMATH(function, type) \ value builtin_float_##function(vm *v, int nargs, value *args) { \ value arg = MORPHO_GETARG(args, 0); \ - return MORPHO_FLOAT(function(MORPHO_GETFLOATVALUE(arg))); \ + return type(function(MORPHO_GETFLOATVALUE(arg))); \ } \ \ value builtin_int_##function(vm *v, int nargs, value *args) { \ value arg = MORPHO_GETARG(args, 0); \ - return MORPHO_FLOAT(function((double) MORPHO_GETINTEGERVALUE(arg))); \ + return type(function((double) MORPHO_GETINTEGERVALUE(arg))); \ } \ \ value builtin_cmplx_##function(vm *v, int nargs, value *args) { \ @@ -54,23 +54,9 @@ value builtin_numargserr_##function(vm *v, int nargs, value *args) { \ return MORPHO_NIL; \ } \ -#define BUILTIN_MATH_OLD(function) \ -value builtin_##function(vm *v, int nargs, value *args) { \ - if (nargs==1) { \ - value arg = MORPHO_GETARG(args, 0); \ - if (MORPHO_ISFLOAT(arg)) { \ - return MORPHO_FLOAT(function(MORPHO_GETFLOATVALUE(arg))); \ - } else if (MORPHO_ISINTEGER(arg)) { \ - return MORPHO_FLOAT(function((double) MORPHO_GETINTEGERVALUE(arg))); \ - } else if (MORPHO_ISCOMPLEX(arg)){\ - return complex_builtin##function(v,MORPHO_GETCOMPLEX(arg));\ - } else { \ - morpho_runtimeerror(v, MATH_ARGS, #function);\ - } \ - } \ - morpho_runtimeerror(v, MATH_NUMARGS, #function);\ - return MORPHO_NIL; \ -} +#define BUILTIN_MATH(function) BUILTIN_VARMATH(function, MORPHO_FLOAT) + +#define BUILTIN_MATH_BOOL(function) BUILTIN_VARMATH(function, MORPHO_BOOL) /** Math functions */ BUILTIN_MATH(fabs) @@ -91,34 +77,14 @@ BUILTIN_MATH(tanh) BUILTIN_MATH(floor) BUILTIN_MATH(ceil) -#undef BUILTIN_MATH - -/** Boolean output function need to output morpho true or false **/ - -#define BUILTIN_MATH_BOOL(function) \ -value builtin_##function(vm *v, int nargs, value *args) { \ - if (nargs==1) { \ - value arg = MORPHO_GETARG(args, 0); \ - if (MORPHO_ISFLOAT(arg)) { \ - return MORPHO_BOOL(function(MORPHO_GETFLOATVALUE(arg))); \ - } else if (MORPHO_ISINTEGER(arg)) { \ - return MORPHO_BOOL(function((double) MORPHO_GETINTEGERVALUE(arg))); \ - } else if (MORPHO_ISCOMPLEX(arg)){\ - return complex_builtin##function(MORPHO_GETCOMPLEX(arg));\ - } else { \ - morpho_runtimeerror(v, MATH_ARGS, #function);\ - } \ - } \ - morpho_runtimeerror(v, MATH_NUMARGS, #function);\ - return MORPHO_NIL; \ -} - - BUILTIN_MATH_BOOL(isfinite) BUILTIN_MATH_BOOL(isinf) BUILTIN_MATH_BOOL(isnan) +#undef BUILTIN_VARMATH #undef BUILTIN_MATH_BOOL +#undef BUILTIN_MATH + /** The sqrt function is needs to be able to return a complex number for negative arguments */ value builtin_sqrt(vm *v, int nargs, value *args) { if (nargs==1) { @@ -622,10 +588,13 @@ value builtin_clock(vm *v, int nargs, value *args) { morpho_addfunction(label, "Complex (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ morpho_addfunction(label, "(...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); -#define BUILTIN_MATH(function) BUILTIN_VARMATH(#function, function) - #define BUILTIN_MATH_BOOL(function) \ - builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); + morpho_addfunction(#function, "Bool (Int)", builtin_int_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(#function, "Bool (Float)", builtin_float_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(#function, "Bool (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(#function, "(...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); + +#define BUILTIN_MATH(function) BUILTIN_VARMATH(#function, function) #define BUILTIN_TYPECHECK(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); @@ -713,6 +682,7 @@ void functiondefs_initialize(void) { builtin_addfunction(FUNCTION_APPLY, builtin_apply, BUILTIN_FLAGSEMPTY); + /* Define errors */ morpho_defineerror(MATH_ARGS, ERROR_HALT, MATH_ARGS_MSG); morpho_defineerror(MATH_NUMARGS, ERROR_HALT, MATH_NUMARGS_MSG); morpho_defineerror(MATH_ATANARGS, ERROR_HALT, MATH_ATANARGS_MSG); diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index 3009e2a9b..bf1d234fb 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -268,7 +268,7 @@ value complex_builtinceil(vm * v, objectcomplex *c) { #undef RET_DOUBLE #define COMPLEX_BUILTIN_BOOL(fcn,logicalop)\ -value complex_builtin##fcn(objectcomplex *c) {\ +value complex_builtin##fcn(vm *v, objectcomplex *c) {\ bool val = fcn(creal(c->Z)) logicalop fcn(cimag(c->Z));\ return MORPHO_BOOL(val);\ } diff --git a/src/classes/cmplx.h b/src/classes/cmplx.h index 377b57210..767e8521f 100644 --- a/src/classes/cmplx.h +++ b/src/classes/cmplx.h @@ -117,9 +117,9 @@ value complex_builtinsqrt(vm *v, objectcomplex *c); value complex_builtinfloor(vm *v, objectcomplex *c); value complex_builtinceil(vm *v, objectcomplex *c); -value complex_builtinisfinite(objectcomplex *c); -value complex_builtinisinf(objectcomplex *c); -value complex_builtinisnan(objectcomplex *c); +value complex_builtinisfinite(vm *v, objectcomplex *c); +value complex_builtinisinf(vm *v, objectcomplex *c); +value complex_builtinisnan(vm *v, objectcomplex *c); value complex_builtinatan(vm *v, value c); value complex_builtinatan2(vm *v, value c1, value c2); From dd8fead3283ce6d49c5ef3d21617a01731978bfc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 28 Sep 2025 22:02:58 -0400 Subject: [PATCH 015/473] Types for more function definitions --- src/builtin/functiondefs.c | 325 +++++++++++++---------- test/builtin/random.morpho | 13 + test/types/type_return_builtin_is.morpho | 5 + 3 files changed, 200 insertions(+), 143 deletions(-) create mode 100644 test/builtin/random.morpho create mode 100644 test/types/type_return_builtin_is.morpho diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index e960c05d6..2f354d15b 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -29,6 +29,149 @@ * Built in functions * ********************************************************************** */ +/* ************************************ + * System + * *************************************/ + +/** Call the operating system */ +value builtin_system(vm *v, int nargs, value *args) { + if (nargs==1) { + value arg=MORPHO_GETARG(args, 0); + if (MORPHO_ISSTRING(arg)) { + return MORPHO_INTEGER(system(MORPHO_GETCSTRING(arg))); + } + } + return MORPHO_NIL; +} + +/** Clock */ +value builtin_clock(vm *v, int nargs, value *args) { + clock_t time; + time = clock(); + return MORPHO_FLOAT( ((double) time)/((double) CLOCKS_PER_SEC) ); +} + +/* ************************************ + * Random numbers + * *************************************/ + +/** Generate a random float between 0 and 1 */ +value builtin_random(vm *v, int nargs, value *args) { + return MORPHO_FLOAT(random_double()); +} + +/** Generate a random integer with a bound. + Efficient and unbiased algorithm from: https://www.pcg-random.org/posts/bounded-rands.html */ +value builtin_randomint_norange(vm *v, int nargs, value *args) { + uint32_t x = random_int(); + return MORPHO_INTEGER((int) x); +} + +value builtin_randomint(vm *v, int nargs, value *args) { + uint32_t x = random_int(); + + /* Generate a number in range. */ + int r=0; + if (!morpho_valuetoint(MORPHO_GETARG(args, 0), &r)||r<0) { + morpho_runtimeerror(v, VM_INVALIDARGSDETAIL,FUNCTION_RANDOMINT, 1, "positive integer"); + } + + uint32_t range=(uint32_t) r; + uint64_t m = (uint64_t) x * (uint64_t) range; + uint32_t l = (uint32_t) m; + + if (l < range) { + uint32_t t = -range; + if (t >= range) { + t -= range; + if (t >= range) + t %= range; + } + while (l < t) { + x = random_int(); + m = (uint64_t) x * (uint64_t) range; + l = (uint32_t) m; + } + } + return MORPHO_INTEGER(m >> 32); +} + +/** Generate a random normally distributed number */ +value builtin_randomnormal(vm *v, int nargs, value *args) { + double x,y,r; + + do { + x=2.0*random_double()-1.0; + y=2.0*random_double()-1.0; + + r=x*x+y*y; + } while (r>=1.0); + + return MORPHO_FLOAT(x*sqrt((-2.0*log(r))/r)); +} + +/* ************************************ + * Value constructors + * *************************************/ + +/** Convert something to an integer */ +value builtin_int__int(vm *v, int nargs, value *args) { + return MORPHO_GETARG(args, 0); +} + +value builtin_int__float(vm *v, int nargs, value *args) { + return MORPHO_FLOATTOINTEGER(MORPHO_GETARG(args, 0)); +} + +value builtin_int__string(vm *v, int nargs, value *args) { + value arg = MORPHO_GETARG(args, 0); + string_tonumber(MORPHO_GETSTRING(arg), &arg); + if (MORPHO_ISFLOAT(arg)) return MORPHO_FLOATTOINTEGER(arg); + else if (MORPHO_ISINTEGER(arg)) return arg; + + morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_INT); + return MORPHO_INTEGER(0); +} + +value builtin_int__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_INT); + return MORPHO_INTEGER(0); +} + +/** Convert to a floating point number */ +value builtin_float__int(vm *v, int nargs, value *args) { + return MORPHO_INTEGERTOFLOAT(MORPHO_GETARG(args, 0)); +} + +value builtin_float__float(vm *v, int nargs, value *args) { + return MORPHO_GETARG(args, 0); +} + +value builtin_float__string(vm *v, int nargs, value *args) { + value arg = MORPHO_GETARG(args, 0); + string_tonumber(MORPHO_GETSTRING(arg), &arg); + if (MORPHO_ISFLOAT(arg)) return arg; + else if (MORPHO_ISINTEGER(arg)) return MORPHO_INTEGERTOFLOAT(arg); + + morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_FLOAT); + return MORPHO_INTEGER(0); +} + +value builtin_float__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_FLOAT); + return MORPHO_FLOAT(0.0); +} + +/** Convert to a boolean */ +value builtin_bool(vm *v, int nargs, value *args) { + return MORPHO_BOOL(MORPHO_ISTRUE(MORPHO_GETARG(args, 0))); +} + +value builtin_bool_err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_BOOL); + return MORPHO_FALSE; +} + /* ************************************ * Math * *************************************/ @@ -221,90 +364,37 @@ value builtin_conj(vm *v, int nargs, value *args) { return MORPHO_NIL; } -/* ************************************ - * Random numbers - * *************************************/ - -/** Generate a random float between 0 and 1 */ -value builtin_random(vm *v, int nargs, value *args) { - return MORPHO_FLOAT(random_double()); -} - -/** Generate a random normally distributed number */ -value builtin_randomnormal(vm *v, int nargs, value *args) { - double x,y,r; - - do { - x=2.0*random_double()-1.0; - y=2.0*random_double()-1.0; - - r=x*x+y*y; - } while (r>=1.0); - - return MORPHO_FLOAT(x*sqrt((-2.0*log(r))/r)); -} - -/** Generate a random integer with a bound. - Efficient and unbiased algorithm from: https://www.pcg-random.org/posts/bounded-rands.html */ -value builtin_randomint(vm *v, int nargs, value *args) { - uint32_t x = random_int(); - /* Leave quickly if no range was asked for */ - if (nargs==0) return MORPHO_INTEGER((int) x); - - /* Otherwise, generate a number in range. */ - int r=0; - if (!morpho_valuetoint(MORPHO_GETARG(args, 0), &r)||r<0) { - morpho_runtimeerror(v, VM_INVALIDARGSDETAIL,FUNCTION_RANDOMINT, 1, "positive integer"); - } - - uint32_t range=(uint32_t) r; - uint64_t m = (uint64_t) x * (uint64_t) range; - uint32_t l = (uint32_t) m; - - if (l < range) { - uint32_t t = -range; - if (t >= range) { - t -= range; - if (t >= range) - t %= range; - } - while (l < t) { - x = random_int(); - m = (uint64_t) x * (uint64_t) range; - l = (uint32_t) m; - } - } - return MORPHO_INTEGER(m >> 32); -} - /* ************************************ * Type checking and conversion * *************************************/ /** Typecheck functions to test for the type of a quantity */ + #define BUILTIN_TYPECHECK(type, test) \ - value builtin_##type(vm *v, int nargs, value *args) { \ - if (nargs==1) { \ - return MORPHO_BOOL(test(MORPHO_GETARG(args, 0))); \ - } else morpho_runtimeerror(v, TYPE_NUMARGS, #type); \ - \ - return MORPHO_NIL; \ - } +value builtin_##type(vm *v, int nargs, value *args) { \ + return MORPHO_BOOL(test(MORPHO_GETARG(args, 0))); \ +} \ + \ +value builtin_numargserr_##type(vm *v, int nargs, value *args) { \ + morpho_runtimeerror(v, TYPE_NUMARGS, #type); \ + return MORPHO_FALSE; \ +} \ BUILTIN_TYPECHECK(isnil, MORPHO_ISNIL) BUILTIN_TYPECHECK(isint, MORPHO_ISINTEGER) BUILTIN_TYPECHECK(isfloat, MORPHO_ISFLOAT) BUILTIN_TYPECHECK(isnumber, MORPHO_ISNUMBER) -BUILTIN_TYPECHECK(iscomplex, MORPHO_ISCOMPLEX) +BUILTIN_TYPECHECK(isarray, MORPHO_ISARRAY) BUILTIN_TYPECHECK(isbool, MORPHO_ISBOOL) +BUILTIN_TYPECHECK(isclass, MORPHO_ISCLASS) +BUILTIN_TYPECHECK(isclosure, MORPHO_ISCLOSURE) +BUILTIN_TYPECHECK(iscomplex, MORPHO_ISCOMPLEX) +BUILTIN_TYPECHECK(isdictionary, MORPHO_ISDICTIONARY) BUILTIN_TYPECHECK(isobject, MORPHO_ISOBJECT) BUILTIN_TYPECHECK(isstring, MORPHO_ISSTRING) -BUILTIN_TYPECHECK(isclass, MORPHO_ISCLASS) BUILTIN_TYPECHECK(isrange, MORPHO_ISRANGE) -BUILTIN_TYPECHECK(isdictionary, MORPHO_ISDICTIONARY) BUILTIN_TYPECHECK(islist, MORPHO_ISLIST) BUILTIN_TYPECHECK(istuple, MORPHO_ISTUPLE) -BUILTIN_TYPECHECK(isarray, MORPHO_ISARRAY) #ifdef MORPHO_INCLUDE_LINALG BUILTIN_TYPECHECK(ismatrix, MORPHO_ISMATRIX) @@ -330,53 +420,6 @@ value builtin_iscallablefunction(vm *v, int nargs, value *args) { return MORPHO_FALSE; } -/** Convert something to an integer */ -value builtin_int(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - - if (MORPHO_ISSTRING(arg)) { - string_tonumber(MORPHO_GETSTRING(arg), &arg); - } - - if (MORPHO_ISFLOAT(arg)) { - return MORPHO_FLOATTOINTEGER(arg); - } else if (MORPHO_ISINTEGER(arg)) { - return arg; - } - } - morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_INT); - return MORPHO_NIL; -} - -/** Convert to a floating point number */ -value builtin_float(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - - if (MORPHO_ISSTRING(arg)) { - string_tonumber(MORPHO_GETSTRING(arg), &arg); - } - - if (MORPHO_ISINTEGER(arg)) { - return MORPHO_INTEGERTOFLOAT(arg); - } else if (MORPHO_ISFLOAT(arg)){ - return arg; - } - } - morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_FLOAT); - return MORPHO_NIL; -} - -/** Convert to a boolean */ -value builtin_bool(vm *v, int nargs, value *args) { - if (nargs==1) { - return MORPHO_BOOL(MORPHO_ISTRUE(MORPHO_GETARG(args, 0))); - } - morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_BOOL); - return MORPHO_NIL; -} - /** Remainder */ value builtin_mod(vm *v, int nargs, value *args) { value out = MORPHO_NIL; @@ -557,28 +600,6 @@ value builtin_apply(vm *v, int nargs, value *args) { return ret; } -/* ************************************ - * System - * *************************************/ - -/** Call the operating system */ -value builtin_system(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg=MORPHO_GETARG(args, 0); - if (MORPHO_ISSTRING(arg)) { - return MORPHO_INTEGER(system(MORPHO_GETCSTRING(arg))); - } - } - return MORPHO_NIL; -} - -/** Clock */ -value builtin_clock(vm *v, int nargs, value *args) { - clock_t time; - time = clock(); - return MORPHO_FLOAT( ((double) time)/((double) CLOCKS_PER_SEC) ); -} - #define BUILTIN_MATH_OLD2(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); @@ -597,18 +618,40 @@ value builtin_clock(vm *v, int nargs, value *args) { #define BUILTIN_MATH(function) BUILTIN_VARMATH(#function, function) #define BUILTIN_TYPECHECK(function) \ - builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); + morpho_addfunction(#function, "Bool (_)", builtin_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(#function, "Bool (_,...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); void functiondefs_initialize(void) { + // System + builtin_addfunction(FUNCTION_SYSTEM, builtin_system, BUILTIN_FLAGSEMPTY); + + // Clock morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, BUILTIN_FLAGSEMPTY, NULL); + // Random numbers morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint_norange, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_RANDOMINT, "Int (_)", builtin_randomint, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_RANDOMNORMAL, "Float ()", builtin_randomnormal, BUILTIN_FLAGSEMPTY, NULL); - builtin_addfunction(FUNCTION_SYSTEM, builtin_system, BUILTIN_FLAGSEMPTY); + // Value constructors + morpho_addfunction(FUNCTION_INT, "Int (Int)", builtin_int__int, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_INT, "Int (Float)", builtin_int__float, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_INT, "Int (String)", builtin_int__string, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_INT, "Int (...)", builtin_int__err, BUILTIN_FLAGSEMPTY, NULL); + + morpho_addfunction(FUNCTION_FLOAT, "Float (Int)", builtin_float__int, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (Float)", builtin_float__float, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (String)", builtin_float__string, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (...)", builtin_float__err, BUILTIN_FLAGSEMPTY, NULL); + + morpho_addfunction(FUNCTION_BOOL, "Bool (_)", builtin_bool, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOOL, "Bool (_,...)", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); + + // builtin_addfunction(FUNCTION_ARCTAN, builtin_arctan, BUILTIN_FLAGSEMPTY); + // Math functions BUILTIN_VARMATH(FUNCTION_ABS, fabs) BUILTIN_MATH(exp) @@ -668,10 +711,6 @@ void functiondefs_initialize(void) { builtin_addfunction(FUNCTION_ISCALLABLE, builtin_iscallablefunction, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_INT, builtin_int, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_FLOAT, builtin_float, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_BOOL, builtin_bool, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_MOD, builtin_mod, BUILTIN_FLAGSEMPTY); builtin_addfunction(FUNCTION_BOUNDS, builtin_bounds, BUILTIN_FLAGSEMPTY); diff --git a/test/builtin/random.morpho b/test/builtin/random.morpho new file mode 100644 index 000000000..45adb3c02 --- /dev/null +++ b/test/builtin/random.morpho @@ -0,0 +1,13 @@ +// Check that random number generators work + +var a = random() +print a.clss() // expect: @Float + +var a = randomint() +print a.clss() // expect: @Int + +var a = randomint(10) +print a.clss() // expect: @Int + +var a = randomnormal() +print a.clss() // expect: @Float \ No newline at end of file diff --git a/test/types/type_return_builtin_is.morpho b/test/types/type_return_builtin_is.morpho new file mode 100644 index 000000000..8362ba0b0 --- /dev/null +++ b/test/types/type_return_builtin_is.morpho @@ -0,0 +1,5 @@ +// Return type of a function matches type qualifier + +Bool a = isstring("Hello") + +print a // expect: true From 6d85426639df17c003805e1e8145d5edd95af290 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 28 Sep 2025 22:04:18 -0400 Subject: [PATCH 016/473] Update functiondefs.c --- src/builtin/functiondefs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 2f354d15b..d74ab6ca8 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -672,10 +672,12 @@ void functiondefs_initialize(void) { BUILTIN_MATH(floor) BUILTIN_MATH(ceil) + // Math properties BUILTIN_MATH_BOOL(isfinite) BUILTIN_MATH_BOOL(isinf) BUILTIN_MATH_BOOL(isnan) + // Type checking BUILTIN_TYPECHECK(isnil) BUILTIN_TYPECHECK(isint) BUILTIN_TYPECHECK(isfloat) From 4d3379d736d5c17c0e6e52a7f82e848d90dd791e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 30 Sep 2025 07:23:57 -0400 Subject: [PATCH 017/473] Refactor --- src/builtin/functiondefs.c | 323 ++++++++++++++++++++----------------- src/builtin/functiondefs.h | 28 ++-- 2 files changed, 187 insertions(+), 164 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index d74ab6ca8..4211d84cb 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -51,6 +51,39 @@ value builtin_clock(vm *v, int nargs, value *args) { return MORPHO_FLOAT( ((double) time)/((double) CLOCKS_PER_SEC) ); } +/* ************************************ + * Apply + * *************************************/ + +/** Apply a function to a list of arguments */ +value builtin_apply(vm *v, int nargs, value *args) { + value ret = MORPHO_NIL; + + if (nargs<2) morpho_runtimeerror(v, APPLY_ARGS); + + value fn = MORPHO_GETARG(args, 0); + value x = MORPHO_GETARG(args, 1); + + if (!morpho_iscallable(fn)) { + morpho_runtimeerror(v, APPLY_NOTCALLABLE); + return MORPHO_NIL; + } + + if (nargs==2 && MORPHO_ISTUPLE(x)) { + objecttuple *t = MORPHO_GETTUPLE(x); + + morpho_call(v, fn, t->length, t->tuple, &ret); + } else if (nargs==2 && MORPHO_ISLIST(x)) { + objectlist *lst = MORPHO_GETLIST(x); + + morpho_call(v, fn, lst->val.count, lst->val.data, &ret); + } else { + morpho_call(v, fn, nargs-1, &MORPHO_GETARG(args, 1), &ret); + } + + return ret; +} + /* ************************************ * Random numbers * *************************************/ @@ -228,6 +261,10 @@ BUILTIN_MATH_BOOL(isnan) #undef BUILTIN_MATH_BOOL #undef BUILTIN_MATH +/* ************************************ + * Math functions with special cases + * *************************************/ + /** The sqrt function is needs to be able to return a complex number for negative arguments */ value builtin_sqrt(vm *v, int nargs, value *args) { if (nargs==1) { @@ -290,6 +327,61 @@ value builtin_arctan(vm *v, int nargs, value *args) { } } +/** Remainder */ +value builtin_mod(vm *v, int nargs, value *args) { + value out = MORPHO_NIL; + if (nargs==2) { + value a = MORPHO_GETARG(args, 0); + value b = MORPHO_GETARG(args, 1); + + if (MORPHO_ISINTEGER(a) && MORPHO_ISINTEGER(b)) { + out=MORPHO_INTEGER(MORPHO_GETINTEGERVALUE(a) % MORPHO_GETINTEGERVALUE(b)); + } else { + if (MORPHO_ISINTEGER(a)) a=MORPHO_INTEGERTOFLOAT(a); + if (MORPHO_ISINTEGER(b)) b=MORPHO_INTEGERTOFLOAT(b); + + if (MORPHO_ISFLOAT(a) && MORPHO_ISFLOAT(b)) { + out=MORPHO_FLOAT(fmod(MORPHO_GETFLOATVALUE(a), MORPHO_GETFLOATVALUE(b))); + } else morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_INT); + } + } else morpho_runtimeerror(v, VM_INVALIDARGS, 2, nargs); + return out; +} + +/** find the sign of a number */ +static value builtin_sign(vm *v, int nargs, value *args){ + if (nargs==1) { + value arg = MORPHO_GETARG(args, 0); + if (MORPHO_ISFLOAT(arg)) { + + if (MORPHO_GETFLOATVALUE(arg)>0) { + return MORPHO_FLOAT(1); + } + else if (MORPHO_GETFLOATVALUE(arg)<0){ + return MORPHO_FLOAT(-1); + } + else return MORPHO_FLOAT(0); + + } else if (MORPHO_ISINTEGER(arg)) { + if (MORPHO_GETINTEGERVALUE(arg)>0) { + return MORPHO_FLOAT(1); + } + else if (MORPHO_GETINTEGERVALUE(arg)<0){ + return MORPHO_FLOAT(-1); + } + else return MORPHO_FLOAT(0); + } else { + morpho_runtimeerror(v, MATH_ARGS,FUNCTION_SIGN); + } + } + morpho_runtimeerror(v, MATH_NUMARGS,FUNCTION_SIGN); + return MORPHO_NIL; +} + +/* ************************************ + * Elementary complex functions + * *************************************/ + value builtin_real(vm *v, int nargs, value *args) { if (nargs==1) { value arg = MORPHO_GETARG(args, 0); @@ -365,82 +457,9 @@ value builtin_conj(vm *v, int nargs, value *args) { } /* ************************************ - * Type checking and conversion + * Min/max * *************************************/ -/** Typecheck functions to test for the type of a quantity */ - -#define BUILTIN_TYPECHECK(type, test) \ -value builtin_##type(vm *v, int nargs, value *args) { \ - return MORPHO_BOOL(test(MORPHO_GETARG(args, 0))); \ -} \ - \ -value builtin_numargserr_##type(vm *v, int nargs, value *args) { \ - morpho_runtimeerror(v, TYPE_NUMARGS, #type); \ - return MORPHO_FALSE; \ -} \ - -BUILTIN_TYPECHECK(isnil, MORPHO_ISNIL) -BUILTIN_TYPECHECK(isint, MORPHO_ISINTEGER) -BUILTIN_TYPECHECK(isfloat, MORPHO_ISFLOAT) -BUILTIN_TYPECHECK(isnumber, MORPHO_ISNUMBER) -BUILTIN_TYPECHECK(isarray, MORPHO_ISARRAY) -BUILTIN_TYPECHECK(isbool, MORPHO_ISBOOL) -BUILTIN_TYPECHECK(isclass, MORPHO_ISCLASS) -BUILTIN_TYPECHECK(isclosure, MORPHO_ISCLOSURE) -BUILTIN_TYPECHECK(iscomplex, MORPHO_ISCOMPLEX) -BUILTIN_TYPECHECK(isdictionary, MORPHO_ISDICTIONARY) -BUILTIN_TYPECHECK(isobject, MORPHO_ISOBJECT) -BUILTIN_TYPECHECK(isstring, MORPHO_ISSTRING) -BUILTIN_TYPECHECK(isrange, MORPHO_ISRANGE) -BUILTIN_TYPECHECK(islist, MORPHO_ISLIST) -BUILTIN_TYPECHECK(istuple, MORPHO_ISTUPLE) - -#ifdef MORPHO_INCLUDE_LINALG -BUILTIN_TYPECHECK(ismatrix, MORPHO_ISMATRIX) -#endif - -#ifdef MORPHO_INCLUDE_SPARSE -BUILTIN_TYPECHECK(issparse, MORPHO_ISSPARSE) -#endif - -#ifdef MORPHO_INCLUDE_GEOMETRY -BUILTIN_TYPECHECK(ismesh, MORPHO_ISMESH) -BUILTIN_TYPECHECK(isselection, MORPHO_ISSELECTION) -BUILTIN_TYPECHECK(isfield, MORPHO_ISFIELD) -#endif - -#undef BUILTIN_TYPECHECK - -/** Check if something is callable */ -value builtin_iscallablefunction(vm *v, int nargs, value *args) { - if (nargs==1) { - if (builtin_iscallable(MORPHO_GETARG(args, 0))) return MORPHO_TRUE; - } else morpho_runtimeerror(v, TYPE_NUMARGS, FUNCTION_ISCALLABLE); - return MORPHO_FALSE; -} - -/** Remainder */ -value builtin_mod(vm *v, int nargs, value *args) { - value out = MORPHO_NIL; - if (nargs==2) { - value a = MORPHO_GETARG(args, 0); - value b = MORPHO_GETARG(args, 1); - - if (MORPHO_ISINTEGER(a) && MORPHO_ISINTEGER(b)) { - out=MORPHO_INTEGER(MORPHO_GETINTEGERVALUE(a) % MORPHO_GETINTEGERVALUE(b)); - } else { - if (MORPHO_ISINTEGER(a)) a=MORPHO_INTEGERTOFLOAT(a); - if (MORPHO_ISINTEGER(b)) b=MORPHO_INTEGERTOFLOAT(b); - - if (MORPHO_ISFLOAT(a) && MORPHO_ISFLOAT(b)) { - out=MORPHO_FLOAT(fmod(MORPHO_GETFLOATVALUE(a), MORPHO_GETFLOATVALUE(b))); - } else morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_INT); - } - } else morpho_runtimeerror(v, VM_INVALIDARGS, 2, nargs); - return out; -} - /** Find the minimum and maximum values in an enumerable object */ typedef struct { value min; @@ -537,69 +556,69 @@ static value builtin_max(vm *v, int nargs, value *args) { return out; } -/** find the sign of a number */ -static value builtin_sign(vm *v, int nargs, value *args){ - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - if (MORPHO_ISFLOAT(arg)) { - - if (MORPHO_GETFLOATVALUE(arg)>0) { - return MORPHO_FLOAT(1); - } - else if (MORPHO_GETFLOATVALUE(arg)<0){ - return MORPHO_FLOAT(-1); - } - else return MORPHO_FLOAT(0); - - } else if (MORPHO_ISINTEGER(arg)) { - if (MORPHO_GETINTEGERVALUE(arg)>0) { - return MORPHO_FLOAT(1); - } - else if (MORPHO_GETINTEGERVALUE(arg)<0){ - return MORPHO_FLOAT(-1); - } - else return MORPHO_FLOAT(0); - } else { - morpho_runtimeerror(v, MATH_ARGS,FUNCTION_SIGN); - } - } - morpho_runtimeerror(v, MATH_NUMARGS,FUNCTION_SIGN); - return MORPHO_NIL; -} - /* ************************************ - * Apply + * Type checking and conversion * *************************************/ -/** Apply a function to a list of arguments */ -value builtin_apply(vm *v, int nargs, value *args) { - value ret = MORPHO_NIL; - - if (nargs<2) morpho_runtimeerror(v, APPLY_ARGS); - - value fn = MORPHO_GETARG(args, 0); - value x = MORPHO_GETARG(args, 1); - - if (!morpho_iscallable(fn)) { - morpho_runtimeerror(v, APPLY_NOTCALLABLE); - return MORPHO_NIL; - } - - if (nargs==2 && MORPHO_ISTUPLE(x)) { - objecttuple *t = MORPHO_GETTUPLE(x); - - morpho_call(v, fn, t->length, t->tuple, &ret); - } else if (nargs==2 && MORPHO_ISLIST(x)) { - objectlist *lst = MORPHO_GETLIST(x); - - morpho_call(v, fn, lst->val.count, lst->val.data, &ret); - } else { - morpho_call(v, fn, nargs-1, &MORPHO_GETARG(args, 1), &ret); - } +/** Typecheck functions to test for the type of a quantity */ + +#define BUILTIN_TYPECHECK(type, test) \ +value builtin_##type(vm *v, int nargs, value *args) { \ + return MORPHO_BOOL(test(MORPHO_GETARG(args, 0))); \ +} \ + \ +value builtin_numargserr_##type(vm *v, int nargs, value *args) { \ + morpho_runtimeerror(v, TYPE_NUMARGS, #type); \ + return MORPHO_FALSE; \ +} \ - return ret; +BUILTIN_TYPECHECK(isnil, MORPHO_ISNIL) +BUILTIN_TYPECHECK(isint, MORPHO_ISINTEGER) +BUILTIN_TYPECHECK(isfloat, MORPHO_ISFLOAT) +BUILTIN_TYPECHECK(isnumber, MORPHO_ISNUMBER) +BUILTIN_TYPECHECK(isarray, MORPHO_ISARRAY) +BUILTIN_TYPECHECK(isbool, MORPHO_ISBOOL) +BUILTIN_TYPECHECK(isclass, MORPHO_ISCLASS) +BUILTIN_TYPECHECK(isclosure, MORPHO_ISCLOSURE) +BUILTIN_TYPECHECK(iscomplex, MORPHO_ISCOMPLEX) +BUILTIN_TYPECHECK(isdictionary, MORPHO_ISDICTIONARY) +BUILTIN_TYPECHECK(isobject, MORPHO_ISOBJECT) +BUILTIN_TYPECHECK(isstring, MORPHO_ISSTRING) +BUILTIN_TYPECHECK(isrange, MORPHO_ISRANGE) +BUILTIN_TYPECHECK(islist, MORPHO_ISLIST) +BUILTIN_TYPECHECK(istuple, MORPHO_ISTUPLE) + +#ifdef MORPHO_INCLUDE_LINALG +BUILTIN_TYPECHECK(ismatrix, MORPHO_ISMATRIX) +#endif + +#ifdef MORPHO_INCLUDE_SPARSE +BUILTIN_TYPECHECK(issparse, MORPHO_ISSPARSE) +#endif + +#ifdef MORPHO_INCLUDE_GEOMETRY +BUILTIN_TYPECHECK(ismesh, MORPHO_ISMESH) +BUILTIN_TYPECHECK(isselection, MORPHO_ISSELECTION) +BUILTIN_TYPECHECK(isfield, MORPHO_ISFIELD) +#endif + +#undef BUILTIN_TYPECHECK + +/** Check if something is callable */ +value builtin_iscallablefunction(vm *v, int nargs, value *args) { + if (builtin_iscallable(MORPHO_GETARG(args, 0))) return MORPHO_TRUE; + return MORPHO_FALSE; } +value builtin_iscallablefunction_err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, TYPE_NUMARGS, FUNCTION_ISCALLABLE); + return MORPHO_FALSE; +} + +/* ********************************************************************** + * Initialization + * ********************************************************************** */ + #define BUILTIN_MATH_OLD2(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); @@ -628,6 +647,9 @@ void functiondefs_initialize(void) { // Clock morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, BUILTIN_FLAGSEMPTY, NULL); + // Apply + builtin_addfunction(FUNCTION_APPLY, builtin_apply, BUILTIN_FLAGSEMPTY); + // Random numbers morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint_norange, BUILTIN_FLAGSEMPTY, NULL); @@ -648,9 +670,6 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_BOOL, "Bool (_)", builtin_bool, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_BOOL, "Bool (_,...)", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); - // - builtin_addfunction(FUNCTION_ARCTAN, builtin_arctan, BUILTIN_FLAGSEMPTY); - // Math functions BUILTIN_VARMATH(FUNCTION_ABS, fabs) @@ -667,7 +686,6 @@ void functiondefs_initialize(void) { BUILTIN_MATH(sinh) BUILTIN_MATH(cosh) BUILTIN_MATH(tanh) - BUILTIN_MATH_OLD2(sqrt) BUILTIN_MATH(floor) BUILTIN_MATH(ceil) @@ -677,6 +695,23 @@ void functiondefs_initialize(void) { BUILTIN_MATH_BOOL(isinf) BUILTIN_MATH_BOOL(isnan) + // Math functions with special cases + builtin_addfunction(FUNCTION_ARCTAN, builtin_arctan, BUILTIN_FLAGSEMPTY); + BUILTIN_MATH_OLD2(sqrt); + builtin_addfunction(FUNCTION_MOD, builtin_mod, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_SIGN, builtin_sign, BUILTIN_FLAGSEMPTY); + + // Complex + builtin_addfunction(FUNCTION_REAL, builtin_real, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_IMAG, builtin_imag, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_ANGLE, builtin_angle, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_CONJ, builtin_conj, BUILTIN_FLAGSEMPTY); + + // Min/max + builtin_addfunction(FUNCTION_BOUNDS, builtin_bounds, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_MIN, builtin_min, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_MAX, builtin_max, BUILTIN_FLAGSEMPTY); + // Type checking BUILTIN_TYPECHECK(isnil) BUILTIN_TYPECHECK(isint) @@ -705,23 +740,9 @@ void functiondefs_initialize(void) { BUILTIN_TYPECHECK(isselection) BUILTIN_TYPECHECK(isfield) #endif - - builtin_addfunction(FUNCTION_REAL,builtin_real,BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_IMAG,builtin_imag,BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_ANGLE,builtin_angle,BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_CONJ,builtin_conj,BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_ISCALLABLE, builtin_iscallablefunction, BUILTIN_FLAGSEMPTY); - - builtin_addfunction(FUNCTION_MOD, builtin_mod, BUILTIN_FLAGSEMPTY); - - builtin_addfunction(FUNCTION_BOUNDS, builtin_bounds, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_MIN, builtin_min, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_MAX, builtin_max, BUILTIN_FLAGSEMPTY); - - builtin_addfunction(FUNCTION_SIGN, builtin_sign, BUILTIN_FLAGSEMPTY); - - builtin_addfunction(FUNCTION_APPLY, builtin_apply, BUILTIN_FLAGSEMPTY); + morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_)", builtin_iscallablefunction, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_,...)", builtin_iscallablefunction_err, BUILTIN_FLAGSEMPTY, NULL); /* Define errors */ morpho_defineerror(MATH_ARGS, ERROR_HALT, MATH_ARGS_MSG); diff --git a/src/builtin/functiondefs.h b/src/builtin/functiondefs.h index f77b31904..df4c660ec 100644 --- a/src/builtin/functiondefs.h +++ b/src/builtin/functiondefs.h @@ -13,32 +13,34 @@ * Built in function labels * ------------------------------------------------------- */ +#define FUNCTION_SYSTEM "system" +#define FUNCTION_CLOCK "clock" + +#define FUNCTION_APPLY "apply" + #define FUNCTION_RANDOM "random" #define FUNCTION_RANDOMINT "randomint" #define FUNCTION_RANDOMNORMAL "randomnormal" -#define FUNCTION_CLOCK "clock" -#define FUNCTION_SYSTEM "system" #define FUNCTION_INT "Int" #define FUNCTION_FLOAT "Float" #define FUNCTION_BOOL "Bool" + #define FUNCTION_MOD "mod" #define FUNCTION_ABS "abs" -#define FUNCTION_ISCALLABLE "iscallable" +#define FUNCTION_SIGN "sign" +#define FUNCTION_ARCTAN "arctan" + +#define FUNCTION_REAL "real" +#define FUNCTION_IMAG "imag" +#define FUNCTION_ANGLE "angle" +#define FUNCTION_CONJ "conj" + #define FUNCTION_MIN "min" #define FUNCTION_MAX "max" #define FUNCTION_BOUNDS "bounds" -#define FUNCTION_REAL "real" -#define FUNCTION_IMAG "imag" -#define FUNCTION_ANGLE "angle" -#define FUNCTION_CONJ "conj" - -#define FUNCTION_SIGN "sign" - -#define FUNCTION_APPLY "apply" - -#define FUNCTION_ARCTAN "arctan" +#define FUNCTION_ISCALLABLE "iscallable" /* ------------------------------------------------------- * Errors thrown by builtin functions From 22872886d4dc7402457fa212033ae1e0b1a7997c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 1 Oct 2025 07:48:44 -0400 Subject: [PATCH 018/473] Implement types on methods for add Ensure current class is visible from within its definition. Prototype implementation for Matrix. --- src/builtin/builtin.c | 12 +++++----- src/core/compile.c | 46 ++++++++++++++++++++++++++++++------- src/linalg/matrix.c | 8 +++---- test/types/type_add.morpho | 7 ++++++ test/types/type_addr.morpho | 7 ++++++ 5 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 test/types/type_add.morpho create mode 100644 test/types/type_addr.morpho diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index d49a274c4..771d2046e 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -306,6 +306,12 @@ value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { if (!new) return MORPHO_NIL; + if (dictionary_get(_currentclasstable, label, NULL)) { + UNREACHABLE("Redefinition of class in same extension [in builtin.c]"); + } + + dictionary_insert(_currentclasstable, label, MORPHO_OBJECT(new)); + /** Copy methods from superclass */ if (MORPHO_ISCLASS(superclass)) { superklass = MORPHO_GETCLASS(superclass); @@ -334,12 +340,6 @@ value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { } } - if (dictionary_get(_currentclasstable, label, NULL)) { - UNREACHABLE("Redefinition of class in same extension [in builtin.c]"); - } - - dictionary_insert(_currentclasstable, label, MORPHO_OBJECT(new)); - return MORPHO_OBJECT(new); } diff --git a/src/core/compile.c b/src/core/compile.c index 0da83552f..04b9d9843 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -2079,7 +2079,38 @@ static codeinfo compiler_not(compiler *c, syntaxtreenode *node, registerindx req return CODEINFO(REGISTER, out, ninstructions); } -bool compiler_arithmetictype(compiler *c, registerindx left, registerindx right, value *type) { +/** Finds a method */ +bool compiler_findmethodreturntype(value klass, char *label, value *type) { + if (!MORPHO_ISCLASS(klass)) return false; + + objectstring selector = MORPHO_STATICSTRING(label); + value method = MORPHO_NIL; + if (dictionary_get(&MORPHO_GETCLASS(klass)->methods, MORPHO_OBJECT(&selector), &method)) { + signature *s = metafunction_getsignature(method); + *type = signature_getreturntype(s); + return true; + } + + return false; +} + +/** Opcode redirection */ +typedef struct { + instruction op; /** Opcode */ + char *lfunc; /** Label for reg */ + char *rfunc; /** Display code - rX is register, cX is constant X, gX is global X, uX is upvalue, + refers to signed B */ +} opcodedispatchrule; + +/** Define how opcodes are redirected @warning: Must match opcode definition order */ +opcodedispatchrule opcodedispatchrules[] ={ + { OP_ADD, MORPHO_ADD_METHOD, MORPHO_ADDR_METHOD }, + { OP_SUB, MORPHO_SUB_METHOD, MORPHO_SUBR_METHOD }, + { OP_MUL, MORPHO_MUL_METHOD, MORPHO_MULR_METHOD }, + { OP_DIV, MORPHO_DIV_METHOD, MORPHO_DIVR_METHOD }, + { OP_POW, MORPHO_POW_METHOD, MORPHO_POWR_METHOD }, +}; + +bool compiler_arithmetictype(compiler *c, opcode op, registerindx left, registerindx right, value *type) { bool success=false; value ltype=MORPHO_NIL, rtype=MORPHO_NIL; value inttype=MORPHO_NIL, floattype=MORPHO_NIL; @@ -2091,15 +2122,16 @@ bool compiler_arithmetictype(compiler *c, registerindx left, registerindx right, if (ltype==inttype && rtype==inttype) { *type=inttype; + success=true; } else if ((ltype==inttype && rtype==floattype) || (ltype==floattype && rtype==inttype) || (ltype==floattype && rtype==floattype)) { *type=floattype; + success=true; } else { - *type=MORPHO_NIL; // TODO: Lookup appropriate selector + success=compiler_findmethodreturntype(ltype, opcodedispatchrules[op-OP_ADD].lfunc, type); + if (!success) success=compiler_findmethodreturntype(rtype, opcodedispatchrules[op-OP_ADD].rfunc, type); } - - success=true; } return success; } @@ -2162,7 +2194,7 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx // TODO: Check input types? value type = MORPHO_NIL; if (op<=OP_DIV) { // Arithmetic type - compiler_arithmetictype(c, left.dest, right.dest, &type); + compiler_arithmetictype(c, op, left.dest, right.dest, &type); } else if (op==OP_POW) { // Powers always generate floats compiler_findtypefromcstring(c, FLOAT_CLASSNAME, &type); } else { // Comparison operations @@ -2172,9 +2204,7 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx compiler_releaseoperand(c, left); // Release operands after type information determined compiler_releaseoperand(c, right); - if (!MORPHO_ISNIL(type) && - !compiler_regsetcurrenttype(c, node, out, type)) return CODEINFO_EMPTY; - // TODO: This should change; we always need to set the output type! + if (!compiler_regsetcurrenttype(c, node, out, type)) return CODEINFO_EMPTY; return CODEINFO(REGISTER, out, ninstructions); } diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index a73c9b96e..b71e1aed6 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1525,10 +1525,10 @@ MORPHO_METHOD(MATRIX_SETCOLUMN_METHOD, Matrix_setcolumn, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Matrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_FORMAT_METHOD, Matrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ASSIGN_METHOD, Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADD_METHOD, Matrix_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADDR_METHOD, Matrix_addr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUB_METHOD, Matrix_sub, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUBR_METHOD, Matrix_subr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_addr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_MUL_METHOD, Matrix_mul, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_MULR_METHOD, Matrix_mulr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_DIV_METHOD, Matrix_div, BUILTIN_FLAGSEMPTY), diff --git a/test/types/type_add.morpho b/test/types/type_add.morpho new file mode 100644 index 000000000..1ced2918d --- /dev/null +++ b/test/types/type_add.morpho @@ -0,0 +1,7 @@ +// Type propagation through add + +{ + var A = Matrix([1,1]) + Matrix b = A+1 + print b +} \ No newline at end of file diff --git a/test/types/type_addr.morpho b/test/types/type_addr.morpho new file mode 100644 index 000000000..a61a2e4be --- /dev/null +++ b/test/types/type_addr.morpho @@ -0,0 +1,7 @@ +// Type propagation through add + +{ + var A = Matrix([1,1]) + Matrix b = 1+A + print b +} \ No newline at end of file From 403abbce34bcdbfa41ddaa290813166bf515130b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 1 Oct 2025 20:49:23 -0400 Subject: [PATCH 019/473] CFunction veneer class --- src/builtin/builtin.c | 1 + src/classes/CMakeLists.txt | 3 +++ src/classes/cfunction.c | 52 +++++++++++++++++++++++++++++++++++++ src/classes/cfunction.h | 26 +++++++++++++++++++ src/classes/classes.h | 1 + test/builtin/veneer.morpho | 6 +++++ test/types/type_add.morpho | 4 +-- test/types/type_addr.morpho | 4 +-- 8 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 src/classes/cfunction.c create mode 100644 src/classes/cfunction.h create mode 100644 test/builtin/veneer.morpho diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 771d2046e..40fa4d943 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -402,6 +402,7 @@ void builtin_initialize(void) { string_initialize(); // Classes function_initialize(); + cfunction_initialize(); metafunction_initialize(); class_initialize(); upvalue_initialize(); diff --git a/src/classes/CMakeLists.txt b/src/classes/CMakeLists.txt index ceed8d925..af5764d31 100644 --- a/src/classes/CMakeLists.txt +++ b/src/classes/CMakeLists.txt @@ -3,6 +3,7 @@ target_sources(morpho classes.h array.c array.h bool.c bool.h + cfunction.c cfunction.h closure.c closure.h clss.c clss.h cmplx.c cmplx.h @@ -31,6 +32,8 @@ target_sources(morpho FILES classes.h array.h + bool.h + cfunction.h closure.h clss.h cmplx.h diff --git a/src/classes/cfunction.c b/src/classes/cfunction.c new file mode 100644 index 000000000..ba35a4150 --- /dev/null +++ b/src/classes/cfunction.c @@ -0,0 +1,52 @@ +/** @file cfunction.c + * @author T J Atherton + * + * @brief Veneer class for C functions + */ + +#include "morpho.h" +#include "classes.h" +#include "common.h" + +/* ********************************************************************** + * CFunction veneer class + * ********************************************************************** */ + +value CFunction_tostring(vm *v, int nargs, value *args) { + objectbuiltinfunction *func=MORPHO_GETBUILTINFUNCTION(MORPHO_SELF(args)); + value out = MORPHO_NIL; + + varray_char buffer; + varray_charinit(&buffer); + + varray_charadd(&buffer, "name, &buffer); + varray_charwrite(&buffer, '>'); + + out = object_stringfromvarraychar(&buffer); + if (MORPHO_ISSTRING(out)) { + morpho_bindobjects(v, 1, &out); + } + varray_charclear(&buffer); + + return out; +} + +MORPHO_BEGINCLASS(CFunction) +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, CFunction_tostring, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY) +MORPHO_ENDCLASS + +/* ********************************************************************** + * Initialization and finalization + * ********************************************************************** */ + +void cfunction_initialize(void) { + // Locate the Object class to use as the parent class of CFunction + objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); + value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + + // Create CFunction veneer class + value cfunctionclass=builtin_addclass(CFUNCTION_CLASSNAME, MORPHO_GETCLASSDEFINITION(CFunction), objclass); + object_setveneerclass(OBJECT_BUILTINFUNCTION, cfunctionclass); +} diff --git a/src/classes/cfunction.h b/src/classes/cfunction.h new file mode 100644 index 000000000..04fb51f93 --- /dev/null +++ b/src/classes/cfunction.h @@ -0,0 +1,26 @@ +/** @file cfunction.h + * @author T J Atherton + * + * @brief Veneer class for C functions + */ + +#ifndef cfunction_h +#define cfunction_h + +/* ------------------------------------------------------- + * CFunction veneer class + * ------------------------------------------------------- */ + +#define CFUNCTION_CLASSNAME "CFunction" + +/* ------------------------------------------------------- + * CFunction error messages + * ------------------------------------------------------- */ + +/* ------------------------------------------------------- + * CFunction interface + * ------------------------------------------------------- */ + +void cfunction_initialize(void); + +#endif diff --git a/src/classes/classes.h b/src/classes/classes.h index 4422bf2cc..2a19438a2 100644 --- a/src/classes/classes.h +++ b/src/classes/classes.h @@ -13,6 +13,7 @@ #include "function.h" #include "metafunction.h" #include "clss.h" +#include "cfunction.h" #include "cmplx.h" #include "closure.h" #include "invocation.h" diff --git a/test/builtin/veneer.morpho b/test/builtin/veneer.morpho new file mode 100644 index 000000000..3f7df1b46 --- /dev/null +++ b/test/builtin/veneer.morpho @@ -0,0 +1,6 @@ +// Veneer class for builtin functions + +print apply.clss() // expect: @CFunction + +print apply.tostring() +// expect: \ No newline at end of file diff --git a/test/types/type_add.morpho b/test/types/type_add.morpho index 1ced2918d..06cc6ffb3 100644 --- a/test/types/type_add.morpho +++ b/test/types/type_add.morpho @@ -1,7 +1,7 @@ // Type propagation through add { - var A = Matrix([1,1]) + var A = Matrix([1]) Matrix b = A+1 - print b + print b // expect: [ 2 ] } \ No newline at end of file diff --git a/test/types/type_addr.morpho b/test/types/type_addr.morpho index a61a2e4be..0f5a61e45 100644 --- a/test/types/type_addr.morpho +++ b/test/types/type_addr.morpho @@ -1,7 +1,7 @@ // Type propagation through add { - var A = Matrix([1,1]) + var A = Matrix([1]) Matrix b = 1+A - print b + print b // expect: [ 2 ] } \ No newline at end of file From 68ffe528eb3174c739b0eca49fd3f01098e082fa Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 1 Oct 2025 21:37:02 -0400 Subject: [PATCH 020/473] Callable class implemented --- src/builtin/builtin.c | 8 +++++++- src/builtin/builtin.h | 1 + src/classes/array.c | 7 +++---- src/classes/cfunction.c | 7 ++++--- src/classes/closure.c | 5 ++--- src/classes/clss.c | 3 +-- src/classes/cmplx.c | 3 +-- src/classes/dict.c | 3 +-- src/classes/err.c | 3 +-- src/classes/file.c | 3 +-- src/classes/function.c | 18 ++++++++++++++---- src/classes/function.h | 2 ++ src/classes/invocation.c | 5 ++--- src/classes/json.c | 3 +-- src/classes/list.c | 3 +-- src/classes/metafunction.c | 3 +-- src/classes/range.c | 3 +-- src/classes/strng.c | 5 ++--- src/classes/system.c | 3 +-- src/classes/tuple.c | 3 +-- test/types/multiple_dispatch/callable.morpho | 11 +++++++++++ 21 files changed, 59 insertions(+), 43 deletions(-) create mode 100644 test/types/multiple_dispatch/callable.morpho diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 40fa4d943..8236dc380 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -343,13 +343,19 @@ value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { return MORPHO_OBJECT(new); } -/** Finds a builtin class from its name */ +/** Finds a builtin class from its label */ value builtin_findclass(value name) { value out=MORPHO_NIL; dictionary_get(&builtin_classtable, name, &out); return out; } +/** Finds a builtin class from a cstring label */ +value builtin_findclassfromcstring(char *label) { + objectstring objname = MORPHO_STATICSTRING(label); + return builtin_findclass(MORPHO_OBJECT(&objname)); +} + /** Copies the built in symbol table into a new dictionary */ void builtin_copysymboltable(dictionary *out) { dictionary_copy(&builtin_symboltable, out); diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index 46b13cc8e..fee186786 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -127,6 +127,7 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built value builtin_addclass(char *name, builtinclassentry desc[], value superclass); value builtin_findclass(value name); +value builtin_findclassfromcstring(char *label); void builtin_copysymboltable(dictionary *out); diff --git a/src/classes/array.c b/src/classes/array.c index 558abe6f3..29011b8f4 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -616,13 +616,12 @@ void array_initialize(void) { // Create array object type objectarraytype=object_addtype(&objectarraydefn); - // Locate the Object class to use as the parent class of Array - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); - // Array constructor function morpho_addfunction(ARRAY_CLASSNAME, ARRAY_CLASSNAME " (...)", array_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + // Locate the Object class to use as the parent class of Array + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); + // Create Array veneer class value arrayclass=builtin_addclass(ARRAY_CLASSNAME, MORPHO_GETCLASSDEFINITION(Array), objclass); object_setveneerclass(OBJECT_ARRAY, arrayclass); diff --git a/src/classes/cfunction.c b/src/classes/cfunction.c index ba35a4150..e97059e0d 100644 --- a/src/classes/cfunction.c +++ b/src/classes/cfunction.c @@ -42,9 +42,10 @@ MORPHO_ENDCLASS * ********************************************************************** */ void cfunction_initialize(void) { - // Locate the Object class to use as the parent class of CFunction - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + // Locate the Callable class to use as the parent class of CFunction + value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); + + // No constructor function; cfunctions are defined in C. // Create CFunction veneer class value cfunctionclass=builtin_addclass(CFUNCTION_CLASSNAME, MORPHO_GETCLASSDEFINITION(CFunction), objclass); diff --git a/src/classes/closure.c b/src/classes/closure.c index e6dc10a66..5ddbd52ed 100644 --- a/src/classes/closure.c +++ b/src/classes/closure.c @@ -117,9 +117,8 @@ void closure_initialize(void) { // Create closure object type objectclosuretype=object_addtype(&objectclosuredefn); - // Locate the Object class to use as the parent class of Closure - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + // Locate the Callable class to use as the parent class of Closure + value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); // No constructor function; closures are generated by the runtime diff --git a/src/classes/clss.c b/src/classes/clss.c index b08944967..5665617c3 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -188,8 +188,7 @@ void class_initialize(void) { // objectclass is a core type so is intialized earlier // Locate the Object class to use as the parent class of Class - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); value classclass=builtin_addclass(CLASS_CLASSNAME, MORPHO_GETCLASSDEFINITION(Class), objclass); object_setveneerclass(OBJECT_CLASS, classclass); diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index bf1d234fb..25e9fc3ab 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -699,8 +699,7 @@ void complex_initialize(void) { // Complex constructor function morpho_addfunction(COMPLEX_CLASSNAME, COMPLEX_CLASSNAME " (...)", complex_constructor, MORPHO_FN_CONSTRUCTOR, NULL); - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Define Complex class value complexclass=builtin_addclass(COMPLEX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexNum), objclass); diff --git a/src/classes/dict.c b/src/classes/dict.c index 3f56ccb8c..e611889bd 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -282,8 +282,7 @@ void dict_initialize(void) { objectdictionarytype=object_addtype(&objectdictionarydefn); // Locate the Object class to use as the parent class of Dictionary - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Dictionary constructor function morpho_addfunction(DICTIONARY_CLASSNAME, DICTIONARY_CLASSNAME " (...)", dictionary_constructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/classes/err.c b/src/classes/err.c index cfaf7fe89..a41b3ee91 100644 --- a/src/classes/err.c +++ b/src/classes/err.c @@ -104,8 +104,7 @@ MORPHO_ENDCLASS void err_initialize(void) { // Locate the Object class to use as the parent class of Error - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Create Error class builtin_addclass(ERROR_CLASSNAME, MORPHO_GETCLASSDEFINITION(Error), objclass); diff --git a/src/classes/file.c b/src/classes/file.c index b6f588c58..ea5055f2e 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -451,8 +451,7 @@ void file_initialize(void) { objectfiletype=object_addtype(&objectfiledefn); - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); morpho_addfunction(FILE_CLASSNAME, FILE_CLASSNAME " (...)", file_constructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/classes/function.c b/src/classes/function.c index 10cf8bac6..6f2da5158 100644 --- a/src/classes/function.c +++ b/src/classes/function.c @@ -206,6 +206,14 @@ MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Function_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS +/* ********************************************************************** + * Callable class + * ********************************************************************** */ + +MORPHO_BEGINCLASS(Callable) +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS + /* ********************************************************************** * Initialization and finalization * ********************************************************************** */ @@ -216,12 +224,14 @@ void function_initialize(void) { // Create function object type objectfunctiontype=object_addtype(&objectfunctiondefn); - // Locate the Object class to use as the parent class of Function - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + // Locate the Object class to use as the parent class of Callable + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); + + // Create callable class + value callableclass=builtin_addclass(CALLABLE_CLASSNAME, MORPHO_GETCLASSDEFINITION(Callable), objclass); // Create function veneer class - value functionclass=builtin_addclass(FUNCTION_CLASSNAME, MORPHO_GETCLASSDEFINITION(Function), objclass); + value functionclass=builtin_addclass(FUNCTION_CLASSNAME, MORPHO_GETCLASSDEFINITION(Function), callableclass); object_setveneerclass(OBJECT_FUNCTION, functionclass); // No constructor as objectfunctions are generated by the compiler diff --git a/src/classes/function.h b/src/classes/function.h index f60ad71cb..64d9329fb 100644 --- a/src/classes/function.h +++ b/src/classes/function.h @@ -55,6 +55,8 @@ typedef struct sobjectfunction { #define FUNCTION_CLASSNAME "Function" +#define CALLABLE_CLASSNAME "Callable" + /* ------------------------------------------------------- * Function error messages * ------------------------------------------------------- */ diff --git a/src/classes/invocation.c b/src/classes/invocation.c index c0a1a65bd..7eba71abd 100644 --- a/src/classes/invocation.c +++ b/src/classes/invocation.c @@ -144,9 +144,8 @@ void invocation_initialize(void) { // Create invocation object type objectinvocationtype=object_addtype(&objectinvocationdefn); - // Locate the Object class to use as the parent class of Invocation - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + // Locate the Callable class to use as the parent class of Closure + value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); // Invocation constructor function morpho_addfunction(INVOCATION_CLASSNAME, INVOCATION_CLASSNAME " (...)", invocation_constructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/classes/json.c b/src/classes/json.c index 1c0b785ba..6468b1750 100644 --- a/src/classes/json.c +++ b/src/classes/json.c @@ -607,8 +607,7 @@ MORPHO_ENDCLASS void json_initialize(void) { // Locate the Object class to use as the parent class of JSON - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // JSON class builtin_addclass(JSON_CLASSNAME, MORPHO_GETCLASSDEFINITION(JSON), objclass); diff --git a/src/classes/list.c b/src/classes/list.c index 00facedc0..734fc1375 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -711,8 +711,7 @@ void list_initialize(void) { objectlisttype=object_addtype(&objectlistdefn); // Locate the Object class to use as the parent class of List - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Define List class value listclass=builtin_addclass(LIST_CLASSNAME, MORPHO_GETCLASSDEFINITION(List), objclass); diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 3c9e602cf..15826ca88 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -988,8 +988,7 @@ void metafunction_initialize(void) { objectmetafunctiontype=object_addtype(&objectmetafunctiondefn); // Locate the Object class to use as the parent class of Metafunction - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); // Metafunction constructor function morpho_addfunction(METAFUNCTION_CLASSNAME, METAFUNCTION_CLASSNAME " (...)", metafunction_constructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/classes/range.c b/src/classes/range.c index f7ac9e1dd..414006219 100644 --- a/src/classes/range.c +++ b/src/classes/range.c @@ -226,8 +226,7 @@ void range_initialize(void) { objectrangetype=object_addtype(&objectrangedefn); // Locate the Object class to use as the parent class of Range - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Create range veneer class value rangeclass=builtin_addclass(RANGE_CLASSNAME, MORPHO_GETCLASSDEFINITION(Range), objclass); diff --git a/src/classes/strng.c b/src/classes/strng.c index e74282451..2353a4798 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -309,9 +309,8 @@ void string_initialize(void) { // Create string object type //objectstringtype=object_addtype(&objectstringdefn); - // Locate the Object class to use as the parent class of Range - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + // Locate the Object class to use as the parent class of String + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Create String veneer class value stringclass=builtin_addclass(STRING_CLASSNAME, MORPHO_GETCLASSDEFINITION(String), objclass); diff --git a/src/classes/system.c b/src/classes/system.c index 90550bd63..31fae2c38 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -181,8 +181,7 @@ MORPHO_ENDCLASS * ********************************************************************** */ void system_initialize(void) { - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); builtin_addclass(SYSTEM_CLASSNAME, MORPHO_GETCLASSDEFINITION(System), objclass); diff --git a/src/classes/tuple.c b/src/classes/tuple.c index 23bbea040..225215b94 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -291,8 +291,7 @@ void tuple_initialize(void) { objecttupletype=object_addtype(&objecttupledefn); // Locate the Object class to use as the parent class of Range - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Create tuple veneer class value tupleclass=builtin_addclass(TUPLE_CLASSNAME, MORPHO_GETCLASSDEFINITION(Tuple), objclass); diff --git a/test/types/multiple_dispatch/callable.morpho b/test/types/multiple_dispatch/callable.morpho new file mode 100644 index 000000000..0208a7c5b --- /dev/null +++ b/test/types/multiple_dispatch/callable.morpho @@ -0,0 +1,11 @@ +// Dispatch with apply + +fn f(Metafunction g, x) { + print g(x) +} + +fn f(Float x, y) { + print x+y +} + +f(cos, 0) // expect: 1 From 4342a30df1e694f30438742935cdae681f9e873f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 2 Oct 2025 05:54:06 -0400 Subject: [PATCH 021/473] Added signatures to many methods --- src/classes/array.c | 6 +++--- src/classes/dict.c | 16 ++++++++-------- src/classes/file.c | 4 ++-- src/classes/flt.c | 2 +- src/classes/int.c | 2 +- src/classes/strng.c | 6 +++--- src/classes/tuple.c | 10 +++++----- test/types/multiple_dispatch/callable.morpho | 6 ++++-- test/types/type_method_call.morpho | 5 +++++ 9 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 test/types/type_method_call.morpho diff --git a/src/classes/array.c b/src/classes/array.c index 29011b8f4..f5494210b 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -598,11 +598,11 @@ value Array_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Array) MORPHO_METHOD(MORPHO_PRINT_METHOD, Array_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Array_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(ARRAY_DIMENSIONS_METHOD, Array_dimensions, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Array_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Array_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Array_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Array_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (_)", Array_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_CLONE_METHOD, Array_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/dict.c b/src/classes/dict.c index e611889bd..600ede1f9 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -259,15 +259,15 @@ MORPHO_METHOD(MORPHO_CONTAINS_METHOD, Dictionary_contains, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(DICTIONARY_REMOVE_METHOD, Dictionary_remove, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Dictionary_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Dictionary_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Dictionary_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(DICTIONARY_KEYS_METHOD, Dictionary_keys, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Dictionary_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_UNION_METHOD, Dictionary_union, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_INTERSECTION_METHOD, Dictionary_intersection, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_DIFFERENCE_METHOD, Dictionary_difference, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADD_METHOD, Dictionary_union, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUB_METHOD, Dictionary_difference, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (_)", Dictionary_union, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (_)", Dictionary_intersection, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (_)", Dictionary_difference, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (_)", Dictionary_union, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (_)", Dictionary_difference, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/file.c b/src/classes/file.c index ea5055f2e..552d8cc59 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -438,8 +438,8 @@ value Folder_contents(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Folder) -MORPHO_METHOD(FOLDER_ISFOLDER, Folder_isfolder, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FOLDER_CONTENTS, Folder_contents, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (_)", Folder_isfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (_)", Folder_contents, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/flt.c b/src/classes/flt.c index a1de4b667..112c6c918 100644 --- a/src/classes/flt.c +++ b/src/classes/flt.c @@ -41,7 +41,7 @@ MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_FORMAT_METHOD, Value_format, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (_)", Value_format, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/int.c b/src/classes/int.c index 810fa04ab..17a807411 100644 --- a/src/classes/int.c +++ b/src/classes/int.c @@ -20,7 +20,7 @@ MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_FORMAT_METHOD, Value_format, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (_)", Value_format, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/strng.c b/src/classes/strng.c index 2353a4798..7119a9f08 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -292,11 +292,11 @@ value String_split(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(String) MORPHO_METHOD(MORPHO_COUNT_METHOD, String_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, String_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, String_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, String_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, String_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(STRING_ISNUMBER_METHOD, String_isnumber, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(STRING_SPLIT_METHOD, String_split, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Int ()", String_isnumber, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (_)", String_split, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/tuple.c b/src/classes/tuple.c index 225215b94..a73ec2d25 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -269,15 +269,15 @@ value Tuple_ismember(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Tuple) -MORPHO_METHOD(MORPHO_COUNT_METHOD, Tuple_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Tuple_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Tuple_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_JOIN_METHOD, Tuple_join, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_ISMEMBER_METHOD, Tuple_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CONTAINS_METHOD, Tuple_ismember, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (_)", Tuple_join, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/test/types/multiple_dispatch/callable.morpho b/test/types/multiple_dispatch/callable.morpho index 0208a7c5b..cb7bb5f95 100644 --- a/test/types/multiple_dispatch/callable.morpho +++ b/test/types/multiple_dispatch/callable.morpho @@ -1,6 +1,7 @@ -// Dispatch with apply +// Dispatch on Callable -fn f(Metafunction g, x) { +/* +fn f(Callable g, x) { print g(x) } @@ -9,3 +10,4 @@ fn f(Float x, y) { } f(cos, 0) // expect: 1 +*/ \ No newline at end of file diff --git a/test/types/type_method_call.morpho b/test/types/type_method_call.morpho new file mode 100644 index 000000000..1a1263713 --- /dev/null +++ b/test/types/type_method_call.morpho @@ -0,0 +1,5 @@ +// Type propagation through a method call + +var a = Array(2,2) + +Int b = a.count() From fdc6876c72dcb799dd9b16a8583680b8073846f8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 2 Oct 2025 22:16:40 -0400 Subject: [PATCH 022/473] Method lookup --- src/builtin/builtin.c | 8 ++-- src/core/compile.c | 42 ++++++++++++++++++-- test/invocation/invocation.morpho | 2 +- test/types/multiple_dispatch/callable.morpho | 2 +- test/types/type_method_call.morpho | 4 +- 5 files changed, 47 insertions(+), 11 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 8236dc380..af5c67ee9 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -406,6 +406,10 @@ void builtin_initialize(void) { /* Initialize builtin classes and functions */ instance_initialize(); // Must initialize first so that Object exists + float_initialize(); // Veneer classes + int_initialize(); + bool_initialize(); + string_initialize(); // Classes function_initialize(); cfunction_initialize(); @@ -422,10 +426,6 @@ void builtin_initialize(void) { err_initialize(); tuple_initialize(); - float_initialize();// Veneer classes - int_initialize(); - bool_initialize(); - file_initialize(); system_initialize(); json_initialize(); diff --git a/src/core/compile.c b/src/core/compile.c index 04b9d9843..26e8da3ba 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -6,6 +6,7 @@ #include #include +#include #include "compile.h" #include "error.h" #include "vm.h" @@ -244,6 +245,15 @@ void compiler_getreturntype(compiler *c, value target, value *type) { } } +/** Infer the return type of an invocation target */ +void compiler_getmethodreturntype(compiler *c, value klass, value target, value *type) { + value method=MORPHO_NIL; + if (MORPHO_ISCLASS(klass) && + dictionary_get(&MORPHO_GETCLASS(klass)->methods, target, &method)) { + compiler_getreturntype(c, method, type); + } +} + /* ------------------------------------------ * Types * ------------------------------------------- */ @@ -972,6 +982,8 @@ static registerindx compiler_getlocal(compiler *c, value symbol) { return false; }*/ +bool compiler_getglobaltype(compiler *c, globalindx indx, value *type); + /** @brief Moves the results of a codeinfo block into a register * @details includes constants, upvalues etc. * @param c the current compiler @@ -1004,6 +1016,11 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei /* Move globals */ out.dest=compiler_regtemp(c, reg); out.returntype=REGISTER; + + if (compiler_getglobaltype(c, info.dest, &type)) { + compiler_regsetcurrenttype(c, node, out.dest, type); + } + compiler_addinstruction(c, ENCODE_LONG(OP_LGL, out.dest, info.dest), node); out.ninstructions++; } else { @@ -1135,6 +1152,11 @@ void compiler_setglobaltype(compiler *c, globalindx indx, value type) { program_globalsettype(c->out, indx, type); } +/** Gets the type of a global variable */ +bool compiler_getglobaltype(compiler *c, globalindx indx, value *type) { + return program_globaltype(c->out, indx, type); +} + /** Checks if the type match satisfies the type of the global variable indx */ bool compiler_checkglobaltype(compiler *c, syntaxtreenode *node, globalindx indx, value match) { value type=MORPHO_NIL; @@ -3502,7 +3524,7 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re return CODEINFO(REGISTER, func.dest, ninstructions); } -#include + /* Compiles a method invocation: node | node @@ -3569,6 +3591,14 @@ static codeinfo compiler_invoke(compiler *c, syntaxtreenode *node, registerindx object=compiler_movetoregister(c, selectornode, object, rObj); ninstructions+=object.ninstructions; + // Attempt to infer return type + value otype=MORPHO_NIL, rtype=MORPHO_NIL; + if (compiler_regcurrenttype(c, rObj, &otype) && + !MORPHO_ISNIL(otype) && + MORPHO_ISSTRING(methodnode->content)) { + compiler_getmethodreturntype(c, otype, methodnode->content, &rtype); + } + // Compile the arguments codeinfo args = CODEINFO_EMPTY; if (node->right!=SYNTAXTREE_UNCONNECTED) args=compiler_nodetobytecode(c, node->right, REGISTER_UNALLOCATED); @@ -3585,7 +3615,7 @@ static codeinfo compiler_invoke(compiler *c, syntaxtreenode *node, registerindx compiler_endargs(c); - // Generate the call instruction + // Generate the invoke instruction int nposn=0, nopt=0; compiler_regcountargs(c, object.dest+1, lastarg, &nposn, &nopt); compiler_addinstruction(c, ENCODE(OP_INVOKE, rSel, nposn, nopt), node); @@ -3595,10 +3625,14 @@ static codeinfo compiler_invoke(compiler *c, syntaxtreenode *node, registerindx compiler_regfreetemp(c, rSel); compiler_regfreetoend(c, rObj+1); + /* Set the current type of the register */ + compiler_regsetcurrenttype(c, node, rObj, rtype); + // Move the result to the requested register if (reqout!=REGISTER_UNALLOCATED && object.dest!=reqout) { - compiler_addinstruction(c, ENCODE_DOUBLE(OP_MOV, reqout, rObj), node); - ninstructions++; + codeinfo cmov=compiler_movetoregister(c, node, object, reqout); + ninstructions+=cmov.ninstructions; + compiler_regfreetemp(c, rObj); object.dest=reqout; } diff --git a/test/invocation/invocation.morpho b/test/invocation/invocation.morpho index 7edcf25d1..a7fe8d380 100644 --- a/test/invocation/invocation.morpho +++ b/test/invocation/invocation.morpho @@ -11,7 +11,7 @@ print b.clss() // expect: @Invocation print b.superclass() -// expect: @Object +// expect: @Callable print b.clone()("respondsto") // expect: true diff --git a/test/types/multiple_dispatch/callable.morpho b/test/types/multiple_dispatch/callable.morpho index cb7bb5f95..92d34156e 100644 --- a/test/types/multiple_dispatch/callable.morpho +++ b/test/types/multiple_dispatch/callable.morpho @@ -9,5 +9,5 @@ fn f(Float x, y) { print x+y } -f(cos, 0) // expect: 1 +f(cos, 0) // Xexpect: 1 */ \ No newline at end of file diff --git a/test/types/type_method_call.morpho b/test/types/type_method_call.morpho index 1a1263713..c7d9b6451 100644 --- a/test/types/type_method_call.morpho +++ b/test/types/type_method_call.morpho @@ -1,5 +1,7 @@ // Type propagation through a method call -var a = Array(2,2) +Array a = Array(2,2) Int b = a.count() + +print b // expect: 4 From 87a1fc73d1315f95a3b9d4dff117af360cb4259f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 3 Oct 2025 07:31:29 -0400 Subject: [PATCH 023/473] More signatures --- src/classes/dict.c | 2 +- src/classes/invocation.c | 4 ++-- src/classes/list.c | 10 +++++----- src/classes/range.c | 4 ++-- src/classes/upvalue.c | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/classes/dict.c b/src/classes/dict.c index 600ede1f9..900f2691b 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -255,7 +255,7 @@ DICTIONARY_SETOP(difference) MORPHO_BEGINCLASS(Dictionary) MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Dictionary_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Dictionary_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CONTAINS_METHOD, Dictionary_contains, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Dictionary_contains, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(DICTIONARY_REMOVE_METHOD, Dictionary_remove, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, BUILTIN_FLAGSEMPTY), diff --git a/src/classes/invocation.c b/src/classes/invocation.c index 7eba71abd..a39ad6ed2 100644 --- a/src/classes/invocation.c +++ b/src/classes/invocation.c @@ -130,8 +130,8 @@ value Invocation_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Invocation) MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Invocation_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Invocation_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Invocation_tostring, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Invocation ()", Invocation_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/list.c b/src/classes/list.c index 734fc1375..4f79f53e5 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -683,21 +683,21 @@ MORPHO_METHOD(LIST_POP_METHOD, List_pop, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, List_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, List_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, List_tostring, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, List_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_COUNT_METHOD, List_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_TUPLES_METHOD, List_tuples, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_SETS_METHOD, List_sets, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, List_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, BUILTIN_FLAGSEMPTY), //MORPHO_METHOD(MORPHO_ADD_METHOD, List_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_JOIN_METHOD, List_join, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (_)", List_join, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ROLL_METHOD, List_roll, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "()", List_sort, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "(_)", List_sort_fn, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_ORDER_METHOD, List_order, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_REVERSE_METHOD, List_reverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_ISMEMBER_METHOD, List_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CONTAINS_METHOD, List_ismember, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/range.c b/src/classes/range.c index 414006219..3ee5a72a0 100644 --- a/src/classes/range.c +++ b/src/classes/range.c @@ -211,8 +211,8 @@ MORPHO_BEGINCLASS(Range) MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Range_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Range_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Range_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Range_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Range_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Range ()", Range_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/upvalue.c b/src/classes/upvalue.c index 1e6b792cf..ad93b8bcf 100644 --- a/src/classes/upvalue.c +++ b/src/classes/upvalue.c @@ -33,7 +33,6 @@ objecttypedefn objectupvaluedefn = { .cmpfn=NULL }; - /** Initializes a new upvalue object. */ void object_upvalueinit(objectupvalue *c) { object_init(&c->obj, OBJECT_UPVALUE); From 1ca61c578b8e83f1048f4997987b8d8db711159b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 4 Oct 2025 10:15:14 -0400 Subject: [PATCH 024/473] Simple help interface --- src/classes/system.c | 26 ++++++++++++++++++++++++++ src/classes/system.h | 1 + src/support/help.c | 10 +++++++++- src/support/help.h | 2 ++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/classes/system.c b/src/classes/system.c index 90550bd63..2c2705566 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -10,6 +10,7 @@ #include "classes.h" #include "system.h" #include "platform.h" +#include "help.h" /* ********************************************************************** * System utility functions @@ -128,6 +129,30 @@ value System_setworkingfolder(vm *v, int nargs, value *args) { return MORPHO_NIL; } +/** Help query */ +value System_help(vm *v, int nargs, value *args) { + value out = MORPHO_NIL; + + if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { + char *query = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); + + varray_char result; + varray_charinit(&result); + + if (morpho_help(query, &result)) { + objectstring *new=object_stringfromvarraychar(&result); + if (new) { + out = MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + } + + varray_charclear(&result); + } + + return out; +} + /** Get working folder */ value System_workingfolder(vm *v, int nargs, value *args) { value out = MORPHO_NIL; @@ -172,6 +197,7 @@ MORPHO_METHOD(SYSTEM_READLINE_METHOD, System_readline, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(SYSTEM_ARGUMENTS_METHOD, System_arguments, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(SYSTEM_EXIT_METHOD, System_exit, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(SYSTEM_SETWORKINGFOLDER_METHOD, System_setworkingfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(SYSTEM_HELP_METHOD, System_help, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(SYSTEM_WORKINGFOLDER_METHOD, System_workingfolder, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(SYSTEM_HOMEFOLDER_METHOD, System_homefolder, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/system.h b/src/classes/system.h index 53123fe48..5710eb144 100644 --- a/src/classes/system.h +++ b/src/classes/system.h @@ -22,6 +22,7 @@ #define SYSTEM_READLINE_METHOD "readline" #define SYSTEM_SLEEP_METHOD "sleep" #define SYSTEM_ARGUMENTS_METHOD "arguments" +#define SYSTEM_HELP_METHOD "help" #define SYSTEM_EXIT_METHOD "exit" #define SYSTEM_HOMEFOLDER_METHOD "homefolder" diff --git a/src/support/help.c b/src/support/help.c index a45d048ac..b57370d68 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -4,7 +4,15 @@ * @brief Morpho help */ -#include #include +#include +#include +#include #include "help.h" + +/** Interface to the morpho help system */ +bool morpho_help(char *query, varray_char *result) { + return false; +} + diff --git a/src/support/help.h b/src/support/help.h index 737d9a405..25e1ef6d1 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -7,4 +7,6 @@ #ifndef help_h #define help_h +bool morpho_help(char *query, varray_char *result); + #endif /* help_h */ From fd7fa9b6214274baadb23c2ca481e4fa31601f37 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 11 Oct 2025 11:52:04 -0400 Subject: [PATCH 025/473] Fix bug in System_setworkingfolder --- src/classes/system.c | 2 +- test/types/type_loop_exterior.morpho | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 test/types/type_loop_exterior.morpho diff --git a/src/classes/system.c b/src/classes/system.c index 31fae2c38..585a10f33 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -122,7 +122,7 @@ value System_setworkingfolder(vm *v, int nargs, value *args) { MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { char *path = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); - if (platform_setcurrentdirectory(path)) morpho_runtimeerror(v, SYS_STWRKDR); + if (!platform_setcurrentdirectory(path)) morpho_runtimeerror(v, SYS_STWRKDR); } else morpho_runtimeerror(v, STWRKDR_ARGS); return MORPHO_NIL; diff --git a/test/types/type_loop_exterior.morpho b/test/types/type_loop_exterior.morpho new file mode 100644 index 000000000..26b6e2cc6 --- /dev/null +++ b/test/types/type_loop_exterior.morpho @@ -0,0 +1,11 @@ +// Exterior type in loop + +{ + Int a +} + +Int b + +/*for (a=0; i<3; i+=1) { + print i +}*/ From d04af596db1678c531b1858be162c2b8dfa06072 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 11 Oct 2025 12:04:35 -0400 Subject: [PATCH 026/473] Fix setworkingfolder and add test --- src/classes/system.c | 2 +- test/system/setworkingfolder.morpho | 8 ++++++++ test/system/workingfolder.morpho | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/system/setworkingfolder.morpho create mode 100644 test/system/workingfolder.morpho diff --git a/src/classes/system.c b/src/classes/system.c index 90550bd63..55cf68feb 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -122,7 +122,7 @@ value System_setworkingfolder(vm *v, int nargs, value *args) { MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { char *path = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); - if (platform_setcurrentdirectory(path)) morpho_runtimeerror(v, SYS_STWRKDR); + if (!platform_setcurrentdirectory(path)) morpho_runtimeerror(v, SYS_STWRKDR); } else morpho_runtimeerror(v, STWRKDR_ARGS); return MORPHO_NIL; diff --git a/test/system/setworkingfolder.morpho b/test/system/setworkingfolder.morpho new file mode 100644 index 000000000..f5b8c0832 --- /dev/null +++ b/test/system/setworkingfolder.morpho @@ -0,0 +1,8 @@ +// Test setworkingfolder + +var a = System.workingfolder() +System.setworkingfolder(a) +var b = System.workingfolder() + +print (a==b) +// expect: true diff --git a/test/system/workingfolder.morpho b/test/system/workingfolder.morpho new file mode 100644 index 000000000..bfe60bab2 --- /dev/null +++ b/test/system/workingfolder.morpho @@ -0,0 +1,4 @@ +// Test workingfolder + +print isstring(System.workingfolder()) +// expect: true From f9d5a77966d3d7dbe1e6c13ab23039b69b1ab5f1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 14:01:49 -0400 Subject: [PATCH 027/473] Type in loop --- src/core/compile.c | 1 + test/types/type_loop_exterior.morpho | 11 ----------- test/types/type_loop_interior.morpho | 5 +++++ test/types/type_no_initializer.morpho | 11 +++++++++++ 4 files changed, 17 insertions(+), 11 deletions(-) delete mode 100644 test/types/type_loop_exterior.morpho create mode 100644 test/types/type_loop_interior.morpho create mode 100644 test/types/type_no_initializer.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 26e8da3ba..df7bb560c 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3097,6 +3097,7 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register right=compiler_movetoregister(c, decnode, right, reg); ninstructions+=right.ninstructions; } else { /* Otherwise, we should zero out the register */ + // TODO: Raise error if typed and missing initializer registerindx cnil = compiler_addconstant(c, decnode, MORPHO_NIL, false, false); compiler_addinstruction(c, ENCODE_LONG(OP_LCT, reg, cnil), node); ninstructions++; diff --git a/test/types/type_loop_exterior.morpho b/test/types/type_loop_exterior.morpho deleted file mode 100644 index 26b6e2cc6..000000000 --- a/test/types/type_loop_exterior.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Exterior type in loop - -{ - Int a -} - -Int b - -/*for (a=0; i<3; i+=1) { - print i -}*/ diff --git a/test/types/type_loop_interior.morpho b/test/types/type_loop_interior.morpho new file mode 100644 index 000000000..bd7538e89 --- /dev/null +++ b/test/types/type_loop_interior.morpho @@ -0,0 +1,5 @@ +// Interior type in loop + +for (Int a=0; i<3; i+=1) { + print i +} diff --git a/test/types/type_no_initializer.morpho b/test/types/type_no_initializer.morpho new file mode 100644 index 000000000..8dd4cd3ca --- /dev/null +++ b/test/types/type_no_initializer.morpho @@ -0,0 +1,11 @@ +// No initializer for typed variable + +{ + Int a +} + +Int b + +/*for (a=0; i<3; i+=1) { + print i +}*/ From abf2c9107d84840fdbfa8ef821771c26aae2ac20 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 14:46:58 -0400 Subject: [PATCH 028/473] Can now parse type declarations in a loop --- src/support/parse.c | 7 +++++-- test/types/type_loop_interior.morpho | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/support/parse.c b/src/support/parse.c index 384be9cda..230ce8918 100644 --- a/src/support/parse.c +++ b/src/support/parse.c @@ -1055,9 +1055,9 @@ bool parse_typedvardeclaration(parser *p, void *out) { PARSE_CHECK(parse_addnode(p, NODE_DOT, MORPHO_NIL, &start, namespace, type, &type)); PARSE_CHECK(parse_addnode(p, NODE_TYPE, MORPHO_NIL, &start, type, var, &new)); - } else { // Perhaps it was really an expression statement + } else { // Return failure parse_restorestate(&op, &ol, p); - PARSE_CHECK(parse_statement(p, &new)); + return false; } *((syntaxtreeindx *) out) = new; @@ -1324,6 +1324,8 @@ bool parse_forstatement(parser *p, void *out) { } else if (parse_checktokenadvance(p, TOKEN_VAR)) { PARSE_CHECK(parse_vardeclaration(p, &init)); + } else if (parse_checktoken(p, TOKEN_SYMBOL) && + parse_typedvardeclaration(p, &init)) { } else { PARSE_CHECK(parse_expression(p, &init)); while (parse_checktokenadvance(p, TOKEN_COMMA)) { @@ -1535,6 +1537,7 @@ bool parse_declaration(parser *p, void *out) { success=parse_importdeclaration(p, out); } else if (parse_checktoken(p, TOKEN_SYMBOL)) { // Typed var declaration ? success=parse_typedvardeclaration(p, out); + if (!success) success=parse_statement(p, out); // Try statement instead } else { success=parse_statement(p, out); } diff --git a/test/types/type_loop_interior.morpho b/test/types/type_loop_interior.morpho index bd7538e89..d0308fd58 100644 --- a/test/types/type_loop_interior.morpho +++ b/test/types/type_loop_interior.morpho @@ -1,5 +1,9 @@ // Interior type in loop -for (Int a=0; i<3; i+=1) { +for (Int i=0; i<3; i+=1) { print i } + +// expect: 0 +// expect: 1 +// expect: 2 From ff1e1f5819f3e080b40eadc22b824035578cb0aa Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 15:47:44 -0400 Subject: [PATCH 029/473] Set type for CAT --- src/core/compile.c | 9 +++++++-- test/types/type_interpolation.morpho | 7 +++++++ .../types/violations/type_violation_interpolation.morpho | 7 +++++++ 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 test/types/type_interpolation.morpho create mode 100644 test/types/violations/type_violation_interpolation.morpho diff --git a/src/core/compile.c b/src/core/compile.c index df7bb560c..2d6f81c28 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -259,6 +259,7 @@ void compiler_getmethodreturntype(compiler *c, value klass, value target, value * ------------------------------------------- */ value _closuretype; +value _stringtype; /* ------------------------------------------ * Argument declarations @@ -2367,13 +2368,16 @@ static codeinfo compiler_interpolation(compiler *c, syntaxtreenode *node, regist } } - compiler_addinstruction(c, ENCODE(OP_CAT, (reqout!=REGISTER_UNALLOCATED ? reqout : start), start, r), node); + registerindx rout = (reqout!=REGISTER_UNALLOCATED ? reqout : start); + compiler_addinstruction(c, ENCODE(OP_CAT, rout, start, r), node); ninstructions++; + + compiler_regsetcurrenttype(c, node, rout, _stringtype); /* Free all the registers used, including start if it wasn't the destination for the output */ if (start!=REGISTER_UNALLOCATED) compiler_regfreetoend(c, start + (reqout!=REGISTER_UNALLOCATED ? 0: 1)); - return CODEINFO(REGISTER, (reqout!=REGISTER_UNALLOCATED ? reqout : start), ninstructions); + return CODEINFO(REGISTER, rout, ninstructions); } /** Inserts instructions to close upvalues */ @@ -4657,6 +4661,7 @@ void compile_initialize(void) { /** Types we need to refer to */ _closuretype = MORPHO_OBJECT(object_getveneerclass(OBJECT_CLOSURE)); + _stringtype = MORPHO_OBJECT(object_getveneerclass(OBJECT_STRING)); optimizer = NULL; diff --git a/test/types/type_interpolation.morpho b/test/types/type_interpolation.morpho new file mode 100644 index 000000000..08d796ffc --- /dev/null +++ b/test/types/type_interpolation.morpho @@ -0,0 +1,7 @@ +// Type propagation from interpolation + +{ + var a = 1 + String b = "a=${a}" + print b // expect: a=1 +} diff --git a/test/types/violations/type_violation_interpolation.morpho b/test/types/violations/type_violation_interpolation.morpho new file mode 100644 index 000000000..bce5d8395 --- /dev/null +++ b/test/types/violations/type_violation_interpolation.morpho @@ -0,0 +1,7 @@ +// Type propagation from interpolation + +{ + var a = 1 + Int b = "a=${a}" + // expect error 'TypeErr' +} From 8e4223a8c569fcd530465892d394ab39e97ec0bb Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 19:53:51 -0400 Subject: [PATCH 030/473] Require initializers for typed variable declarations --- src/core/compile.c | 6 ++++-- src/core/compile.h | 3 +++ test/types/type_no_initializer.morpho | 6 +----- test/types/violations/type_violation_arithmetic.morpho | 2 +- test/types/violations/type_violation_comparison.morpho | 2 +- test/types/violations/type_violation_dictionary.morpho | 2 +- test/types/violations/type_violation_in_function.morpho | 2 +- test/types/violations/type_violation_matrix.morpho | 2 +- test/types/violations/type_violation_power.morpho | 2 +- test/types/violations/type_violation_propagation.morpho | 2 +- test/types/violations/type_violation_range.morpho | 2 +- test/types/violations/type_violation_tuple.morpho | 2 +- 12 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index 2d6f81c28..8b9377587 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3100,8 +3100,9 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register /* Ensure operand is in the desired register */ right=compiler_movetoregister(c, decnode, right, reg); ninstructions+=right.ninstructions; - } else { /* Otherwise, we should zero out the register */ - // TODO: Raise error if typed and missing initializer + } else if (MORPHO_ISOBJECT(type)) { // A typed variable must have an initializer + //compiler_error(c, node, COMPILE_NOINITIALIZER, MORPHO_GETCSTRING(var)); + } else { // An untyped variable is simply initialized to nil registerindx cnil = compiler_addconstant(c, decnode, MORPHO_NIL, false, false); compiler_addinstruction(c, ENCODE_LONG(OP_LCT, reg, cnil), node); ninstructions++; @@ -4696,6 +4697,7 @@ void compile_initialize(void) { morpho_defineerror(COMPILE_INVLDLBL, ERROR_COMPILE, COMPILE_INVLDLBL_MSG); morpho_defineerror(COMPILE_MSSNGINDX, ERROR_COMPILE, COMPILE_MSSNGINDX_MSG); morpho_defineerror(COMPILE_TYPEVIOLATION, ERROR_COMPILE, COMPILE_TYPEVIOLATION_MSG); + morpho_defineerror(COMPILE_NOINITIALIZER, ERROR_COMPILE, COMPILE_NOINITIALIZER_MSG); morpho_defineerror(COMPILE_UNKNWNTYPE, ERROR_COMPILE, COMPILE_UNKNWNTYPE_MSG); morpho_defineerror(COMPILE_UNKNWNNMSPC, ERROR_COMPILE, COMPILE_UNKNWNNMSPC_MSG); morpho_defineerror(COMPILE_UNKNWNTYPENMSPC, ERROR_COMPILE, COMPILE_UNKNWNTYPENMSPC_MSG); diff --git a/src/core/compile.h b/src/core/compile.h index 6f1737164..59eeead41 100644 --- a/src/core/compile.h +++ b/src/core/compile.h @@ -108,6 +108,9 @@ #define COMPILE_TYPEVIOLATION "TypeErr" #define COMPILE_TYPEVIOLATION_MSG "Type violation: Attempting to assign type %s to %s variable %s." +#define COMPILE_NOINITIALIZER "MssngIntlzr" +#define COMPILE_NOINITIALIZER_MSG "Missing initializer for typed variable %s." + #define COMPILE_UNKNWNTYPE "UnknwnType" #define COMPILE_UNKNWNTYPE_MSG "Unknown type '%s'." diff --git a/test/types/type_no_initializer.morpho b/test/types/type_no_initializer.morpho index 8dd4cd3ca..8aeb6838c 100644 --- a/test/types/type_no_initializer.morpho +++ b/test/types/type_no_initializer.morpho @@ -4,8 +4,4 @@ Int a } -Int b - -/*for (a=0; i<3; i+=1) { - print i -}*/ +// expect error 'MssngIntlzr' diff --git a/test/types/violations/type_violation_arithmetic.morpho b/test/types/violations/type_violation_arithmetic.morpho index 96d46ddac..e3936c2a3 100644 --- a/test/types/violations/type_violation_arithmetic.morpho +++ b/test/types/violations/type_violation_arithmetic.morpho @@ -1,7 +1,7 @@ // Type violation in function from an arithmetic operation fn f() { - String u + String u = "" u = 1+3 } diff --git a/test/types/violations/type_violation_comparison.morpho b/test/types/violations/type_violation_comparison.morpho index 890791814..61a591e0f 100644 --- a/test/types/violations/type_violation_comparison.morpho +++ b/test/types/violations/type_violation_comparison.morpho @@ -1,7 +1,7 @@ // Type violation in function from a type comparison fn f() { - String u + String u = "" u = 1<3 } diff --git a/test/types/violations/type_violation_dictionary.morpho b/test/types/violations/type_violation_dictionary.morpho index dc29b6670..f129f0b47 100644 --- a/test/types/violations/type_violation_dictionary.morpho +++ b/test/types/violations/type_violation_dictionary.morpho @@ -1,7 +1,7 @@ // Type violation in function from a Dictionary fn f() { - String u + String u = "" u = { "a" : "b" } } diff --git a/test/types/violations/type_violation_in_function.morpho b/test/types/violations/type_violation_in_function.morpho index f1ed09745..6682fff9d 100644 --- a/test/types/violations/type_violation_in_function.morpho +++ b/test/types/violations/type_violation_in_function.morpho @@ -1,7 +1,7 @@ // Type violation in function fn f() { - String u + String u = "" u = [] } diff --git a/test/types/violations/type_violation_matrix.morpho b/test/types/violations/type_violation_matrix.morpho index bdf0d7f93..ac0e55a8c 100644 --- a/test/types/violations/type_violation_matrix.morpho +++ b/test/types/violations/type_violation_matrix.morpho @@ -1,7 +1,7 @@ // Type violation in function from a Matrix fn f() { - String u + String u = "" u = Matrix(2,2) } diff --git a/test/types/violations/type_violation_power.morpho b/test/types/violations/type_violation_power.morpho index eaca6cb98..b2a5d2d35 100644 --- a/test/types/violations/type_violation_power.morpho +++ b/test/types/violations/type_violation_power.morpho @@ -1,7 +1,7 @@ // Type violation in function from a power operation fn f() { - String u + String u = "" u = 2^2 } diff --git a/test/types/violations/type_violation_propagation.morpho b/test/types/violations/type_violation_propagation.morpho index 7b48732ca..b3593d7eb 100644 --- a/test/types/violations/type_violation_propagation.morpho +++ b/test/types/violations/type_violation_propagation.morpho @@ -1,7 +1,7 @@ // Detect type violations from propagation fn f() { - String u + String u = "" var a = 1 diff --git a/test/types/violations/type_violation_range.morpho b/test/types/violations/type_violation_range.morpho index 16cfb4fa7..d22e0419c 100644 --- a/test/types/violations/type_violation_range.morpho +++ b/test/types/violations/type_violation_range.morpho @@ -1,7 +1,7 @@ // Type violation in function from a Range fn f() { - String u + String u = "" u = 1..3 } diff --git a/test/types/violations/type_violation_tuple.morpho b/test/types/violations/type_violation_tuple.morpho index d54c2f7ae..6b216114e 100644 --- a/test/types/violations/type_violation_tuple.morpho +++ b/test/types/violations/type_violation_tuple.morpho @@ -1,7 +1,7 @@ // Type violation due to a constructor fn f() { - String u + String u = "" u = Tuple(1,2,3) } From 11c3f07e00648fe4c07ad40032b35e27269b0d33 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 20:13:38 -0400 Subject: [PATCH 031/473] Set type of forin index variable --- src/core/compile.c | 31 +++++++++++++++++------------- test/types/type_forin_index.morpho | 10 ++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 test/types/type_forin_index.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 8b9377587..311213941 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -261,6 +261,10 @@ void compiler_getmethodreturntype(compiler *c, value klass, value target, value value _closuretype; value _stringtype; +value _inttype; +value _floattype; +value _booltype; + /* ------------------------------------------ * Argument declarations * ------------------------------------------- */ @@ -2091,9 +2095,7 @@ static codeinfo compiler_not(compiler *c, syntaxtreenode *node, registerindx req ninstructions+=left.ninstructions; } - value type=MORPHO_NIL; - compiler_findtypefromcstring(c, BOOL_CLASSNAME, &type); - compiler_regsetcurrenttype(c, node, out, type); + compiler_regsetcurrenttype(c, node, out, _booltype); compiler_addinstruction(c, ENCODE_DOUBLE(OP_NOT, out, left.dest), node); ninstructions++; @@ -2136,20 +2138,17 @@ opcodedispatchrule opcodedispatchrules[] ={ bool compiler_arithmetictype(compiler *c, opcode op, registerindx left, registerindx right, value *type) { bool success=false; value ltype=MORPHO_NIL, rtype=MORPHO_NIL; - value inttype=MORPHO_NIL, floattype=MORPHO_NIL; - if (!compiler_findtypefromcstring(c, INT_CLASSNAME, &inttype)) return success; - if (!compiler_findtypefromcstring(c, FLOAT_CLASSNAME, &floattype)) return success; if (compiler_regcurrenttype(c, left, <ype) && compiler_regcurrenttype(c, right, &rtype)) { - if (ltype==inttype && rtype==inttype) { - *type=inttype; + if (ltype==_inttype && rtype==_inttype) { + *type=_inttype; success=true; - } else if ((ltype==inttype && rtype==floattype) || - (ltype==floattype && rtype==inttype) || - (ltype==floattype && rtype==floattype)) { - *type=floattype; + } else if ((ltype==_inttype && rtype==_floattype) || + (ltype==_floattype && rtype==_inttype) || + (ltype==_floattype && rtype==_floattype)) { + *type=_floattype; success=true; } else { success=compiler_findmethodreturntype(ltype, opcodedispatchrules[op-OP_ADD].lfunc, type); @@ -2705,6 +2704,8 @@ static codeinfo compiler_for(compiler *c, syntaxtreenode *node, registerindx req compiler_addinstruction(c, ENCODE_LONG(OP_LCT, rIndx, cNil), node); ninstructions++; + compiler_regsetcurrenttype(c, node, rIndx, _inttype); + /* Obtain the maximum value of rIndx by invoking enumerate */ // Allocate register to contain maximum value of the counter @@ -3101,7 +3102,7 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register right=compiler_movetoregister(c, decnode, right, reg); ninstructions+=right.ninstructions; } else if (MORPHO_ISOBJECT(type)) { // A typed variable must have an initializer - //compiler_error(c, node, COMPILE_NOINITIALIZER, MORPHO_GETCSTRING(var)); + compiler_error(c, node, COMPILE_NOINITIALIZER, MORPHO_GETCSTRING(var)); } else { // An untyped variable is simply initialized to nil registerindx cnil = compiler_addconstant(c, decnode, MORPHO_NIL, false, false); compiler_addinstruction(c, ENCODE_LONG(OP_LCT, reg, cnil), node); @@ -4664,6 +4665,10 @@ void compile_initialize(void) { _closuretype = MORPHO_OBJECT(object_getveneerclass(OBJECT_CLOSURE)); _stringtype = MORPHO_OBJECT(object_getveneerclass(OBJECT_STRING)); + _inttype = MORPHO_OBJECT(value_getveneerclass(MORPHO_INTEGER(0))); + _floattype = MORPHO_OBJECT(value_getveneerclass(MORPHO_FLOAT(0.0))); + _booltype = MORPHO_OBJECT(value_getveneerclass(MORPHO_TRUE)); + optimizer = NULL; /* Compile errors */ diff --git a/test/types/type_forin_index.morpho b/test/types/type_forin_index.morpho new file mode 100644 index 000000000..05e82f6a5 --- /dev/null +++ b/test/types/type_forin_index.morpho @@ -0,0 +1,10 @@ +// Index variable is correctly typed in for..in loop + +for (x, k in [1,2,3]) { + Int i = k + print i +} + +// expect: 0 +// expect: 1 +// expect: 2 From 9537aff01fac1b205924934253adbcf1095e989c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 21:19:35 -0400 Subject: [PATCH 032/473] Add in demo of type system --- test/types/demos/shapes.morpho | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 test/types/demos/shapes.morpho diff --git a/test/types/demos/shapes.morpho b/test/types/demos/shapes.morpho new file mode 100644 index 000000000..26e89b4af --- /dev/null +++ b/test/types/demos/shapes.morpho @@ -0,0 +1,88 @@ +// Demonstrate use of type system + +import constants + +class Shape { } + +class Circle is Shape { + init(Float radius) { + self.radius = radius + } +} + +class Rectangle is Shape { + init(Float width, Float height) { + self.width = width + self.height = height + } +} + +class Triangle is Shape { + init(Float base, Float height) { + self.base = base + self.height = height + } +} + +class Polygon is Shape { + init(Int sides, Float sideLength) { + self.sides = sides + self.sideLength = sideLength + } +} + +// Use multiple dispatch to compute area +fn area(Circle c) { return Pi*c.radius*c.radius} +fn area(Rectangle r) { return r.width*r.height } +fn area(Triangle t) { return t.base*t.height/2 } +fn area(Polygon p) { + var apothem = p.sideLength / (2 * tan(Pi / p.sides)) + return 0.5 * p.sides * p.sideLength * apothem +} + +// Compare shapes +fn compare_shapes(Circle c1, Circle c2) { + if (c1.radius > c2.radius) return "first circle is larger" + if (c1.radius < c2.radius) return "second circle is larger" + return "circles are equal"; +} + +fn compare_shapes(Rectangle r1, Rectangle r2) { + var area1 = area(r1) + var area2 = area(r2) + + if (area1 > area2) return "first rectangle is larger" + if (area1 < area2) return "second rectangle is larger" + return "rectangles are equal" +} + +fn compare_shapes(Circle c1, Rectangle r2) { + var area1 = area(c1) + var area2 = area(r2) + + if (area1 > area2) return "circle is larger" + if (area1 < area2) return "rectangle is larger" + return "shapes have equal area" +} + +fn compare_shapes(Shape a, Shape b) { + return "cannot compare different shape types"; +} + +Shape circle = Circle(5.0) +Shape rectangle = Rectangle(10.0, 8.0) + +{ + Shape triangle = Triangle(6.0, 4.0) + Shape polygon = Polygon(6, 3.0) + + area(circle) + area(rectangle) + area(triangle) + area(polygon) +} + +Shape comparison = compare_shapes(circle, rectangle) +print "Shape comparison: ${comparison}" + +// expect: Shape comparison: rectangle is larger \ No newline at end of file From 71eb715fe45338ec277afa72d663d6ea9ba3b5b6 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 13 Oct 2025 21:26:58 -0400 Subject: [PATCH 033/473] Minor fixes to signatures --- src/classes/array.c | 2 +- src/classes/cmplx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/array.c b/src/classes/array.c index f5494210b..a1ef3c968 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -603,7 +603,7 @@ MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, BU MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Array_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Array_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (_)", Array_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Array_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Array ()", Array_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index 25e9fc3ab..1d2e84f44 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -685,7 +685,7 @@ MORPHO_METHOD(COMPLEX_CONJUGATE_METHOD, Complex_conjugate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(COMPLEX_REAL_METHOD, Complex_getreal, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(COMPLEX_IMAG_METHOD, Complex_getimag, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(COMPLEX_ABS_METHOD, Complex_abs, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Complex_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** From d212070b51d85863695ae05371463e610e9abc73 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 14 Oct 2025 10:05:24 -0400 Subject: [PATCH 034/473] Initial commit of morpho help system --- src/core/vm.c | 2 ++ src/support/help.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ src/support/help.h | 3 +++ 3 files changed, 66 insertions(+) diff --git a/src/core/vm.c b/src/core/vm.c index 6e3d4f2aa..46eec4639 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -15,6 +15,7 @@ #include "profile.h" #include "resources.h" #include "extensions.h" +#include "help.h" value initselector = MORPHO_NIL; value indexselector = MORPHO_NIL; @@ -2137,6 +2138,7 @@ void morpho_initialize(void) { compile_initialize(); debugger_initialize(); extensions_initialize(); + help_initialize(); #ifdef MORPHO_DEBUG_GCSIZETRACKING dictionary_init(&sizecheck); diff --git a/src/support/help.c b/src/support/help.c index b57370d68..0bd942a8e 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -9,10 +9,71 @@ #include #include +#include "classes.h" #include "help.h" +#include "resources.h" + +/** The interactive help system uses a collection of Markdown files, located in + * MORPHO_HELPFOLDER, that define available topics. Help files are all + * valid Markdown, although only a subset is used, and the help system interprets + * Markdown syntax in special ways: + * + * Headers defined with #, ##, etc are used to identify discrete topics. + * Successive levels of header are used to create subtopics. + * + * Link definitions are used to include metadata: + * + * [tag]: # () is used to define additional synonyms for the topic. + * + * The help system also recognizes code blocks etc. */ + + +/* ********************************************************************** + * Morpho help files + * ********************************************************************** */ + +/** Loads a help file + * @param file file to load + * @returns true if any help entries were successfully loaded */ +bool help_load(char *file) { + +} + +/** Searches for help files + * @returns true if any help files were successfully processed. */ +void help_findfiles(void) { + varray_value files; + varray_valueinit(&files); + + if (morpho_listresources(MORPHO_RESOURCE_HELP, &files)) { + for (int i=0; i Date: Tue, 14 Oct 2025 21:17:20 -0400 Subject: [PATCH 035/473] Implementation of jacobian and invjacobian for the integrals --- src/geometry/functional.c | 100 +++++++++++++++++- src/geometry/functional.h | 2 + test/functionals/areaintegral/jacobian.morpho | 33 ++++++ 3 files changed, 133 insertions(+), 2 deletions(-) create mode 100644 test/functionals/areaintegral/jacobian.morpho diff --git a/src/geometry/functional.c b/src/geometry/functional.c index ab571011b..5f4eb0ce5 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4334,13 +4334,105 @@ static value integral_cgfn(vm *v, int nargs, value *args) { return out; } +/* ------------------- + * Jacobian + * ------------------- */ + +/* + * A reference triangle is mapped to a target triangle through a + * linear transformation (the pushforward); an inverse transformation (the pullback) + * exists if the triangle is not degenerate. This function computes the forward + * and inverse jacobians. + */ + +int jacobianhandle; // TL storage handle for Jacobian +int invjacobianhandle; // TL storage handle for inverse Jacobian + +void _fetchvertices(objectintegralelementref *elref, objectmesh *mesh, int nv, elementid *vid, double **x) { + // Fetch reference vertices + for (int j=0; jiref->mref->vert, vid[j], &x[j]); +} + +void _edgevectors(grade g, int dim, double **x, double *out) { + for (int i=0; imesh->dim; // Dimension of the mesh + + // Allocate matrices + objectmatrix *J=object_newmatrix(dim, dim, true); + objectmatrix *Jinv=object_newmatrix(dim, dim, true); + + if (J) vm_settlvar(v, jacobianhandle, MORPHO_OBJECT(J)); + if (Jinv) vm_settlvar(v, invjacobianhandle, MORPHO_OBJECT(Jinv)); + + if (!J || !Jinv) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return; } + + // Now compute them + grade g = elref->g; // Grade of the element + int nv = elref->nv; // + + double **X = elref->vertexposn; // Vertex positions of the target element + double *x[nv]; // Vertex positions of the reference element + + objectmesh *mref = elref->iref->mref; // Reference mesh + if (mref) _fetchvertices(elref, mref, nv, elref->vid, x); + + // Construct matrix of edge vectors for target and reference elements + double starget[dim*dim], sref[dim*dim], sinv[dim*dim]; + objectmatrix St = MORPHO_STATICMATRIX(starget, dim, dim), + Sr = MORPHO_STATICMATRIX(sref, dim, dim), + Sinv = MORPHO_STATICMATRIX(sinv, dim, dim); + + _edgevectors(g, dim, X, starget); + if (mref) { + _edgevectors(g, dim, x, sref); + matrix_inverse(&Sr, &Sinv); + } else { + matrix_identity(&Sinv); // If no reference, the reference is the unit triangle + } + + matrix_mul(&St, &Sinv, J); // J = S . s^-1 + + matrix_inverse(J, Jinv); // Compute J^-1 + + if (jac) *jac = MORPHO_OBJECT(J); + if (invjac) *invjac = MORPHO_OBJECT(Jinv); +} + +static value integral_jacobian(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + + vm_gettlvar(v, jacobianhandle, &out); + if (MORPHO_ISNIL(out)) integral_evaluatejacobian(v, &out, NULL); + + return out; +} + +static value integral_invjacobian(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + + vm_gettlvar(v, invjacobianhandle, &out); + if (MORPHO_ISNIL(out)) integral_evaluatejacobian(v, NULL, &out); + + return out; +} + /* ---------------------- * General initialization * ---------------------- */ /** Clears threadlocal storage */ void integral_cleartlvars(vm *v) { - int handles[] = { elementhandle, normlhandle, tangenthandle, cauchygreenhandle, -1 }; + int handles[] = { elementhandle, normlhandle, tangenthandle, cauchygreenhandle, jacobianhandle, invjacobianhandle, -1 }; for (int i=0; handles[i]>=0; i++) { vm_settlvar(v, handles[i], MORPHO_NIL); @@ -4348,7 +4440,7 @@ void integral_cleartlvars(vm *v) { } void integral_freetlvars(vm *v) { - int handles[] = { normlhandle, tangenthandle, cauchygreenhandle, -1 }; + int handles[] = { normlhandle, tangenthandle, cauchygreenhandle,jacobianhandle, invjacobianhandle, -1 }; for (int i=0; handles[i]>=0; i++) { value val; @@ -4952,6 +5044,8 @@ void functional_initialize(void) { builtin_addfunction(NORMAL_FUNCTION, integral_normal, BUILTIN_FLAGSEMPTY); builtin_addfunction(GRAD_FUNCTION, integral_gradfn, BUILTIN_FLAGSEMPTY); builtin_addfunction(CGTENSOR_FUNCTION, integral_cgfn, BUILTIN_FLAGSEMPTY); + builtin_addfunction(JACOBIAN_FUNCTION, integral_jacobian, BUILTIN_FLAGSEMPTY); + builtin_addfunction(INVJACOBIAN_FUNCTION, integral_invjacobian, BUILTIN_FLAGSEMPTY); morpho_defineerror(VOLUMEENCLOSED_ZERO, ERROR_HALT, VOLUMEENCLOSED_ZERO_MSG); morpho_defineerror(FUNC_INTEGRAND_MESH, ERROR_HALT, FUNC_INTEGRAND_MESH_MSG); @@ -4990,6 +5084,8 @@ void functional_initialize(void) { tangenthandle=vm_addtlvar(); normlhandle=vm_addtlvar(); cauchygreenhandle=vm_addtlvar(); + jacobianhandle=vm_addtlvar(); + invjacobianhandle=vm_addtlvar(); morpho_addfinalizefn(functional_finalize); } diff --git a/src/geometry/functional.h b/src/geometry/functional.h index dcfb0bd1a..0bf28b466 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -60,6 +60,8 @@ #define NORMAL_FUNCTION "normal" #define GRAD_FUNCTION "grad" #define CGTENSOR_FUNCTION "cgtensor" +#define JACOBIAN_FUNCTION "jacobian" +#define INVJACOBIAN_FUNCTION "invjacobian" /* Functional names */ #define LENGTH_CLASSNAME "Length" diff --git a/test/functionals/areaintegral/jacobian.morpho b/test/functionals/areaintegral/jacobian.morpho new file mode 100644 index 000000000..5ad1bd929 --- /dev/null +++ b/test/functionals/areaintegral/jacobian.morpho @@ -0,0 +1,33 @@ +// Test the jacobian() function + +import meshtools + +// Create the reference triangle +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addedge([0,1]) +mb.addedge([1,2]) +mb.addedge([2,0]) +mb.addface([0,1,2]) + +var mref = mb.build() + +// Make the target triangle by cloning the reference.. +var m = mref.clone() +m.setvertexmatrix(2*m.vertexmatrix()) // ... and scaling by 2 + +fn integrand(x) { + var F = jacobian() + //var Jinv = invjacobian() + var Ft = F.transpose() + + return (F*Ft).trace() +} + +var a=AreaIntegral(integrand, reference=mref, weightByReference=true).total(m) + +print a +// expect: 4 +// because Tr(F*Ft)=8; and the area of the reference tri. is 1/2 From 07155f9b4ae61f7cb4317bc3b3e251d0e33da486 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 19 Oct 2025 10:42:28 -0400 Subject: [PATCH 036/473] Get type from upvalues --- src/classes/upvalue.h | 1 + src/core/compile.c | 44 ++++++++++++++++--- test/types/demos/shapes.morpho | 2 +- .../nparams_typecheck.morpho | 12 +++++ test/types/type_from_upvalue.morpho | 15 +++++++ 5 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 test/types/multiple_dispatch/nparams_typecheck.morpho create mode 100644 test/types/type_from_upvalue.morpho diff --git a/src/classes/upvalue.h b/src/classes/upvalue.h index 7673b8ef8..181169ef5 100644 --- a/src/classes/upvalue.h +++ b/src/classes/upvalue.h @@ -21,6 +21,7 @@ typedef struct { indx reg; /** An index that either: if islocal - refers to the register OR otherwise - refers to the upvalue array in the current closure */ + value type; /** Type of the upvalue, if type protected (only set if islocal is true */ } upvalue; DECLARE_VARRAY(upvalue, upvalue) diff --git a/src/core/compile.c b/src/core/compile.c index 311213941..f563998b7 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -621,14 +621,19 @@ void compiler_regsettype(compiler *c, registerindx reg, value type) { f->registers.data[reg].type=type; } -/** Gets the current type of a register */ -bool compiler_regtype(compiler *c, registerindx reg, value *type) { - functionstate *f = compiler_currentfunctionstate(c); +/** Gets the current type of a register in a given functionstate */ +bool compiler_regtypefromfunctionstate(functionstate *f, registerindx reg, value *type) { if (reg>=f->registers.count) return false; *type = f->registers.data[reg].type; return true; } +/** Gets the current type of a register */ +bool compiler_regtype(compiler *c, registerindx reg, value *type) { + functionstate *f = compiler_currentfunctionstate(c); + return compiler_regtypefromfunctionstate(f, reg, type); +} + /** Raises a type violation error */ void compiler_typeviolation(compiler *c, syntaxtreenode *node, value type, value badtype, value symbol) { char *tname="(unknown)", *bname="(unknown)"; @@ -988,6 +993,7 @@ static registerindx compiler_getlocal(compiler *c, value symbol) { }*/ bool compiler_getglobaltype(compiler *c, globalindx indx, value *type); +bool compiler_getupvaluetype(compiler *c, registerindx ix, value *type); /** @brief Moves the results of a codeinfo block into a register * @details includes constants, upvalues etc. @@ -1017,6 +1023,10 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei out.returntype=REGISTER; compiler_addinstruction(c, ENCODE_DOUBLE(OP_LUP, out.dest, info.dest), node); out.ninstructions++; + + if (compiler_getupvaluetype(c, info.dest, &type)) { + compiler_regsetcurrenttype(c, node, out.dest, type); + } } else if (CODEINFO_ISGLOBAL(info)) { /* Move globals */ out.dest=compiler_regtemp(c, reg); @@ -1241,8 +1251,8 @@ codeinfo compiler_addvariable(compiler *c, syntaxtreenode *node, value symbol) { * ------------------------------------------- */ /** Adds an upvalue to a functionstate */ -registerindx compiler_addupvalue(functionstate *f, bool islocal, indx ix) { - upvalue v = (upvalue) { .islocal = islocal, .reg = ix}; +registerindx compiler_addupvalue(functionstate *f, bool islocal, registerindx ix) { + upvalue v = (upvalue) { .islocal = islocal, .reg = ix, .type=MORPHO_NIL }; /* Does this upvalue already exist? */ for (registerindx i=0; iupvalues.count; i++) { @@ -1253,7 +1263,11 @@ registerindx compiler_addupvalue(functionstate *f, bool islocal, indx ix) { } } - /* If not, add it */ + /* If not, get type information and add it */ + if (islocal) { + compiler_regtypefromfunctionstate(f, (registerindx) ix, &v.type); + } + varray_upvalueadd(&f->upvalues, &v, 1); return (registerindx) f->upvalues.count-1; } @@ -1271,6 +1285,24 @@ registerindx compiler_propagateupvalues(compiler *c, functionstate *start, regis return indx; } +/** Determines the type associated with an upvalue in the current scope */ +bool compiler_getupvaluetype(compiler *c, registerindx ix, value *type) { + registerindx i=ix; + for (functionstate *f = compiler_currentfunctionstate(c)-1; f>=c->fstack; f--) { + upvalue *u = &f->upvalues.data[i]; + + if (u->islocal) { + *type=u->type; + return true; + } else { + i=(registerindx) u->reg; + } + } + + return false; +} + + /** @brief Determines whether a symbol refers to something outside its scope @param c the compiler @param symbol symbol to resolve diff --git a/test/types/demos/shapes.morpho b/test/types/demos/shapes.morpho index 26e89b4af..fddba27fd 100644 --- a/test/types/demos/shapes.morpho +++ b/test/types/demos/shapes.morpho @@ -82,7 +82,7 @@ Shape rectangle = Rectangle(10.0, 8.0) area(polygon) } -Shape comparison = compare_shapes(circle, rectangle) +String comparison = compare_shapes(circle, rectangle) print "Shape comparison: ${comparison}" // expect: Shape comparison: rectangle is larger \ No newline at end of file diff --git a/test/types/multiple_dispatch/nparams_typecheck.morpho b/test/types/multiple_dispatch/nparams_typecheck.morpho new file mode 100644 index 000000000..e877a9d2f --- /dev/null +++ b/test/types/multiple_dispatch/nparams_typecheck.morpho @@ -0,0 +1,12 @@ +// Variable numbers of parameters with typecheck + +fn f(Int x) { + return 0 +} + +fn f(...x) { + return 1 +} + +print f(1) // expect: 0 +print f(1,2) // expect: 1 diff --git a/test/types/type_from_upvalue.morpho b/test/types/type_from_upvalue.morpho new file mode 100644 index 000000000..4d7c50adf --- /dev/null +++ b/test/types/type_from_upvalue.morpho @@ -0,0 +1,15 @@ +// Retrieve type from upvalue + +fn f(x) { + Int y = Int(x) + + fn g() { + Int z = y + 1 + return z + } + + return g +} + +print f(1)() // expect: 2 +print f(2)() // expect: 3 From 4465f7c90615a02471ce717d7f88a0af4cbfd1db Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 19 Oct 2025 12:53:45 -0400 Subject: [PATCH 037/473] Type checking for assignment to upvalues --- src/classes/upvalue.h | 1 + src/core/compile.c | 48 +++++++++++++++---- test/types/type_to_upvalue.morpho | 19 ++++++++ .../type_violation_assign_upvalue.morpho | 14 ++++++ 4 files changed, 74 insertions(+), 8 deletions(-) create mode 100644 test/types/type_to_upvalue.morpho create mode 100644 test/types/violations/type_violation_assign_upvalue.morpho diff --git a/src/classes/upvalue.h b/src/classes/upvalue.h index 181169ef5..5d689dd1d 100644 --- a/src/classes/upvalue.h +++ b/src/classes/upvalue.h @@ -22,6 +22,7 @@ typedef struct { if islocal - refers to the register OR otherwise - refers to the upvalue array in the current closure */ value type; /** Type of the upvalue, if type protected (only set if islocal is true */ + value symbol; /** Symbol associated with the upvalue (only set if islocal is true) */ } upvalue; DECLARE_VARRAY(upvalue, upvalue) diff --git a/src/core/compile.c b/src/core/compile.c index f563998b7..a82be52b4 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -628,6 +628,15 @@ bool compiler_regtypefromfunctionstate(functionstate *f, registerindx reg, value return true; } +/** Gets the symbol associated with a register */ +bool compiler_regsymbolfromfunctionstate(functionstate *f, registerindx reg, value *symbol) { + if (regregisters.count && f->registers.data[reg].isallocated) { + *symbol = f->registers.data[reg].symbol; + return true; + } + return false; +} + /** Gets the current type of a register */ bool compiler_regtype(compiler *c, registerindx reg, value *type) { functionstate *f = compiler_currentfunctionstate(c); @@ -1252,7 +1261,7 @@ codeinfo compiler_addvariable(compiler *c, syntaxtreenode *node, value symbol) { /** Adds an upvalue to a functionstate */ registerindx compiler_addupvalue(functionstate *f, bool islocal, registerindx ix) { - upvalue v = (upvalue) { .islocal = islocal, .reg = ix, .type=MORPHO_NIL }; + upvalue v = (upvalue) { .islocal = islocal, .reg = ix, .type=MORPHO_NIL, .symbol=MORPHO_NIL }; /* Does this upvalue already exist? */ for (registerindx i=0; iupvalues.count; i++) { @@ -1266,6 +1275,7 @@ registerindx compiler_addupvalue(functionstate *f, bool islocal, registerindx ix /* If not, get type information and add it */ if (islocal) { compiler_regtypefromfunctionstate(f, (registerindx) ix, &v.type); + compiler_regsymbolfromfunctionstate(f, ix, &v.symbol); } varray_upvalueadd(&f->upvalues, &v, 1); @@ -1285,23 +1295,33 @@ registerindx compiler_propagateupvalues(compiler *c, functionstate *start, regis return indx; } -/** Determines the type associated with an upvalue in the current scope */ -bool compiler_getupvaluetype(compiler *c, registerindx ix, value *type) { +/** Find the original upvalue from the */ +bool compiler_getupvalue(compiler *c, registerindx ix, upvalue **v) { registerindx i=ix; for (functionstate *f = compiler_currentfunctionstate(c)-1; f>=c->fstack; f--) { upvalue *u = &f->upvalues.data[i]; if (u->islocal) { - *type=u->type; - return true; - } else { - i=(registerindx) u->reg; - } + *v = u; return true; + } else i=(registerindx) u->reg; } return false; } +/** Determines the type associated with an upvalue in the current scope */ +bool compiler_getupvaluetype(compiler *c, registerindx ix, value *type) { + upvalue *u = NULL; + if (compiler_getupvalue(c, ix, &u)) *type=u->type; + return u; +} + +/** Determines the symbol associated with an upvalue in the current scope */ +bool compiler_getupvaluesymbol(compiler *c, registerindx ix, value *symbol) { + upvalue *u = NULL; + if (compiler_getupvalue(c, ix, &u)) *symbol=u->symbol; + return u; +} /** @brief Determines whether a symbol refers to something outside its scope @param c the compiler @@ -1340,6 +1360,18 @@ static codeinfo compiler_movetoupvalue(compiler *c, syntaxtreenode *node, codein tmp=true; } + // Typecheck the assignment + value uptype, rtype; + if (compiler_getupvaluetype(c, slot, &uptype) && + compiler_regcurrenttype(c, use.dest, &rtype) && + !compiler_checktype(c, uptype, rtype)) { + + value upsymbol=MORPHO_NIL; + compiler_getupvaluesymbol(c, slot, &upsymbol); + + compiler_typeviolation(c, node, uptype, rtype, upsymbol); + } + compiler_addinstruction(c, ENCODE_DOUBLE(OP_SUP, slot, use.dest), node); out.ninstructions++; diff --git a/test/types/type_to_upvalue.morpho b/test/types/type_to_upvalue.morpho new file mode 100644 index 000000000..94ccb5598 --- /dev/null +++ b/test/types/type_to_upvalue.morpho @@ -0,0 +1,19 @@ +// Store to upvalue + +fn f(x) { + Int y = Int(x) + + fn g() { + y+=1 + return y + } + + return g +} + +var p = f(0) + +print p() // expect: 1 +print p() // expect: 2 +print p() // expect: 3 +print p() // expect: 4 diff --git a/test/types/violations/type_violation_assign_upvalue.morpho b/test/types/violations/type_violation_assign_upvalue.morpho new file mode 100644 index 000000000..27f31b7bf --- /dev/null +++ b/test/types/violations/type_violation_assign_upvalue.morpho @@ -0,0 +1,14 @@ +// Store to upvalue with type violation + +fn f(x) { + Int y = Int(x) + + fn g() { + y+=1.5 + return y + } + + return g +} + +// expect error 'TypeErr' From a37a76b23d83e1b36fff54c0904ba50df381999f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 19 Oct 2025 17:45:44 -0400 Subject: [PATCH 038/473] Update compile.c --- src/core/compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/compile.c b/src/core/compile.c index a82be52b4..56c6b2bb6 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -1360,7 +1360,7 @@ static codeinfo compiler_movetoupvalue(compiler *c, syntaxtreenode *node, codein tmp=true; } - // Typecheck the assignment + // Typecheck the assignment value uptype, rtype; if (compiler_getupvaluetype(c, slot, &uptype) && compiler_regcurrenttype(c, use.dest, &rtype) && From 29ffce9355316aa2d0f482ae1ca36c8fec0c15ac Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 20 Oct 2025 12:38:17 -0400 Subject: [PATCH 039/473] Callable class correctly implemented --- src/builtin/builtin.c | 46 +++++++++++++++----- src/classes/function.c | 32 ++++++++++++++ src/core/compile.c | 2 +- test/types/multiple_dispatch/callable.morpho | 9 ++-- 4 files changed, 74 insertions(+), 15 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index af5c67ee9..822e45fd8 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -4,6 +4,8 @@ * @brief Morpho built in functions and classes */ +#include + #include "builtin.h" #include "common.h" #include "object.h" @@ -184,7 +186,7 @@ void builtin_setclasstable(dictionary *dict) { _currentclasstable=dict; } -/** Add a builtin function. +/** Add a builtin function (old interface) * @param name name of the function * @param func the corresponding C function * @param flags flags to define the function @@ -295,16 +297,17 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built /** Defines a built in class * @param[in] name the name of the class * @param[in] desc class description; use MORPHO_GETCLASSDEFINITION(name) to obtain this - * @param[in] superclass the class's superclass - * @returns the class object */ -value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { + * @param[in] nparents number of parent classes + * @param[in] parents the parent classes + * @param[out] out the class object + * @returns true on success */ +bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value *parents, value *out) { value label = object_stringfromcstring(name, strlen(name)); builtin_bindobject(MORPHO_GETOBJECT(label)); objectclass *new = object_newclass(label); builtin_bindobject((object *) new); - objectclass *superklass = NULL; - if (!new) return MORPHO_NIL; + if (!new) return false; if (dictionary_get(_currentclasstable, label, NULL)) { UNREACHABLE("Redefinition of class in same extension [in builtin.c]"); @@ -313,10 +316,19 @@ value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { dictionary_insert(_currentclasstable, label, MORPHO_OBJECT(new)); /** Copy methods from superclass */ - if (MORPHO_ISCLASS(superclass)) { - superklass = MORPHO_GETCLASS(superclass); - dictionary_copy(&superklass->methods, &new->methods); - new->superclass=superklass; + for (int i=0; imethods, &new->methods); + if (i==0) new->superclass=parentclass; + varray_valuewrite(&new->parents, parents[i]); + varray_valuewrite(&parentclass->children, MORPHO_OBJECT(new)); + } + } + + /** Compute the class linearization */ + if (!class_linearize(new)) { + UNREACHABLE("Class definition not linearizable."); } for (unsigned int i=0; desc[i].name!=NULL; i++) { @@ -340,7 +352,19 @@ value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { } } - return MORPHO_OBJECT(new); + *out = MORPHO_OBJECT(new); + return true; +} + +/** Defines a built in class (old interface) + * @param[in] name the name of the class + * @param[in] desc class description; use MORPHO_GETCLASSDEFINITION(name) to obtain this + * @param[in] superclass the class's superclass + * @returns the class object */ +value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { + value out = MORPHO_NIL; + morpho_addclass(name, desc, 1, &superclass, &out); + return out; } /** Finds a builtin class from its label */ diff --git a/src/classes/function.c b/src/classes/function.c index 6f2da5158..fb097ee2e 100644 --- a/src/classes/function.c +++ b/src/classes/function.c @@ -206,6 +206,34 @@ MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Function_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS +/* ********************************************************************** + * objectcallable definitions + * ********************************************************************** */ + +/** A callable object */ +typedef struct { + object obj; + value name; +} objectcallable; + +size_t objectcallable_sizefn(object *obj) { + return sizeof(objectcallable); +} + +void objectcallable_printfn(object *obj, void *v) { + objectcallable *f = (objectcallable *) obj; + if (f) morpho_printf(v, "", (MORPHO_ISNIL(f->name) ? "" : MORPHO_GETCSTRING(f->name))); +} + +objecttypedefn objectcallabledefn = { + .printfn=objectcallable_printfn, + .markfn=NULL, + .freefn=NULL, + .sizefn=objectcallable_sizefn, + .hashfn=NULL, + .cmpfn=NULL +}; + /* ********************************************************************** * Callable class * ********************************************************************** */ @@ -219,16 +247,20 @@ MORPHO_ENDCLASS * ********************************************************************** */ objecttype objectfunctiontype; +objecttype objectcallabletype; void function_initialize(void) { // Create function object type objectfunctiontype=object_addtype(&objectfunctiondefn); + objectcallabletype=object_addtype(&objectcallabledefn); + // Locate the Object class to use as the parent class of Callable value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); // Create callable class value callableclass=builtin_addclass(CALLABLE_CLASSNAME, MORPHO_GETCLASSDEFINITION(Callable), objclass); + object_setveneerclass(objectcallabletype, callableclass); // Create function veneer class value functionclass=builtin_addclass(FUNCTION_CLASSNAME, MORPHO_GETCLASSDEFINITION(Function), callableclass); diff --git a/src/core/compile.c b/src/core/compile.c index 56c6b2bb6..e76857ccc 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3919,7 +3919,7 @@ static codeinfo compiler_class(compiler *c, syntaxtreenode *node, registerindx r if (superclass!=klass) { if (!klass->superclass) klass->superclass=superclass; // Only the first class is the super class, all others are mixins. compiler_addparent(c, klass, superclass); - dictionary_copy(&superclass->methods, &klass->methods); + dictionary_copy(&superclass->methods, &klass->methods); // TODO: Need clearer inheritance rule for metamethods } else { compiler_error(c, snode, COMPILE_CLASSINHERITSELF); } diff --git a/test/types/multiple_dispatch/callable.morpho b/test/types/multiple_dispatch/callable.morpho index 92d34156e..c9be50b87 100644 --- a/test/types/multiple_dispatch/callable.morpho +++ b/test/types/multiple_dispatch/callable.morpho @@ -1,6 +1,5 @@ // Dispatch on Callable -/* fn f(Callable g, x) { print g(x) } @@ -9,5 +8,9 @@ fn f(Float x, y) { print x+y } -f(cos, 0) // Xexpect: 1 -*/ \ No newline at end of file +fn h(x) { return 1 } + +f(h, 0) // expect: 1 +f(cos, 0) // expect: 1 + +f("H", 0) // expect error 'MltplDsptchFld' From 12742cf150a54063bb45b6e266ce1830ea99ac25 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 20 Oct 2025 13:10:13 -0400 Subject: [PATCH 040/473] Closures are Callable --- .../multiple_dispatch/callable_closure.morpho | 21 +++++++++++++++++++ .../callable_closure_upvaluepriority.morpho | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 test/types/multiple_dispatch/callable_closure.morpho create mode 100644 test/types/multiple_dispatch/callable_closure_upvaluepriority.morpho diff --git a/test/types/multiple_dispatch/callable_closure.morpho b/test/types/multiple_dispatch/callable_closure.morpho new file mode 100644 index 000000000..496543502 --- /dev/null +++ b/test/types/multiple_dispatch/callable_closure.morpho @@ -0,0 +1,21 @@ +// Dispatch on Callable + +fn f(Callable g, x) { + print g(x) +} + +fn f(Float x, y) { + print x+y +} + +fn m(p) { + fn g(x) { + return p(x) + } + + return g +} + +var p = m(cos) + +f(p, 0) // expect: 1 diff --git a/test/types/multiple_dispatch/callable_closure_upvaluepriority.morpho b/test/types/multiple_dispatch/callable_closure_upvaluepriority.morpho new file mode 100644 index 000000000..54f4bd79a --- /dev/null +++ b/test/types/multiple_dispatch/callable_closure_upvaluepriority.morpho @@ -0,0 +1,21 @@ +// Dispatch on Callable + +fn f(Callable g, x) { + print g(x) +} + +fn f(Float x, y) { + print x+y +} + +fn m(f) { + fn g(x) { + return f(x) + } + + return g +} + +var p = m(cos) + +f(p, 0) // expect: 1 From 004c8d9ea290cab8eebb1f9306f223e39d784c69 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 23 Oct 2025 22:19:33 -0400 Subject: [PATCH 041/473] Fix metafunction collection bug Ensure that the search for implementations only extends to contexts where the symbol is used as for callables --- src/core/compile.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index e76857ccc..69bf9dccf 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -791,9 +791,7 @@ static bool compiler_iscodeinfotop(compiler *c, codeinfo func) { } /** @brief Shows the current allocation of the registers */ -static void compiler_regshow(compiler *c) { - functionstate *f = compiler_currentfunctionstate(c); - +void compiler_regshowwithfunctionstate(functionstate *f) { printf("--Registers (%u in use)\n",f->nreg); for (unsigned int i=0; iregisters.count; i++) { registeralloc *r=f->registers.data+i; @@ -826,6 +824,11 @@ static void compiler_regshow(compiler *c) { printf("--End registers\n"); } +void compiler_regshow(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + compiler_regshowwithfunctionstate(f); +} + /* ------------------------------------------ * Track scope * ------------------------------------------- */ @@ -1518,7 +1521,7 @@ static void _findfunctionref(compiler *c, value symbol, bool *hasclosure, varray varray_functionrefinit(&refs); functionstate *fc = compiler_currentfunctionstate(c); - for (functionstate *f=fc; f>=c->fstack; f--) { // Go backwards to prioritize recent def'ns + for (functionstate *f=fc; f>=c->fstack; f--) { // Go backwards on the functionstate stack to prioritize recent def'ns for (int i=f->functionref.count-1; i>=0; i--) { // Go backwards functionref *ref=&f->functionref.data[i]; if (MORPHO_ISEQUAL(ref->symbol, symbol) && @@ -1527,6 +1530,15 @@ static void _findfunctionref(compiler *c, value symbol, bool *hasclosure, varray varray_functionrefadd(&refs, ref, 1); } } + + // Check to see if there was a matching symbol in this scope that *isn't* a closure + registerindx rsym = compiler_findsymbol(f, symbol); + value type; + if (rsym>=0 && + compiler_regcurrenttype(c, rsym, &type) && + type!=_closuretype) { + break; // If there is, then we halt the search + } } // Return the collected implementations @@ -4032,8 +4044,8 @@ static codeinfo compiler_symbol(compiler *c, syntaxtreenode *node, registerindx !MORPHO_ISEQUAL(type, _closuretype)) { return ret; } - - /* Is it a reference to a function? */ + + /* Is it (unambiguously) a reference to a function? */ if (compiler_resolvefunctionref(c, node, node->content, &ret)) { return ret; } From dc97567c66c27fe36f6b8427a94058f490750049 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 23 Oct 2025 22:39:57 -0400 Subject: [PATCH 042/473] Check invocations and metafunctions are Callable --- .../callable_invocation.morpho | 17 +++++++++++++++++ .../callable_metafunction.morpho | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/types/multiple_dispatch/callable_invocation.morpho create mode 100644 test/types/multiple_dispatch/callable_metafunction.morpho diff --git a/test/types/multiple_dispatch/callable_invocation.morpho b/test/types/multiple_dispatch/callable_invocation.morpho new file mode 100644 index 000000000..c35087365 --- /dev/null +++ b/test/types/multiple_dispatch/callable_invocation.morpho @@ -0,0 +1,17 @@ +// Dispatch on Callable + +fn f(Callable g, x) { + print g(x) +} + +fn f(Float x, y) { + print x+y +} + +class Foo { + boo(x) { + return 2*x + } +} + +f(Foo().boo, 1) // expect: 2 diff --git a/test/types/multiple_dispatch/callable_metafunction.morpho b/test/types/multiple_dispatch/callable_metafunction.morpho new file mode 100644 index 000000000..6c13728c2 --- /dev/null +++ b/test/types/multiple_dispatch/callable_metafunction.morpho @@ -0,0 +1,16 @@ +// Dispatch on Callable + +fn f(Callable g, x) { + print g(x) +} + +fn f(Float x, y) { + print x+y +} + +fn g(Int x) { return 2*x } + +fn g(Float x) { return x/2 } + +f(g, 1) // expect: 2 +f(g, 2.5) // expect: 1.25 From e9d9cde7c73e8730970f6b198a7863bdb9550e08 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 25 Oct 2025 13:22:46 -0400 Subject: [PATCH 043/473] Load help files --- src/classes/file.c | 1 + src/support/help.c | 74 +++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/src/classes/file.c b/src/classes/file.c index b6f588c58..a115ddd38 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -165,6 +165,7 @@ bool file_readintovarray(FILE *f, varray_char *string) { if (varray_charresize(string, (int) size+1)) { size_t nread=fread(string->data, sizeof(char), size, f); string->data[nread]='\0'; + string->count=(unsigned int) nread+1; } return true; diff --git a/src/support/help.c b/src/support/help.c index 0bd942a8e..d7e2e8af0 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -13,6 +13,9 @@ #include "help.h" #include "resources.h" +#include "lex.h" +#include "file.h" + /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all * valid Markdown, although only a subset is used, and the help system interprets @@ -27,6 +30,59 @@ * * The help system also recognizes code blocks etc. */ +/* ********************************************************************** + * Markdown lexer + * ********************************************************************** */ + +enum { + MD_LEFTBRACE, + MD_RIGHTBRACE, + MD_LEFTSQUAREBRACE, + MD_RIGHTSQUAREBRACE, + MD_BOLD, + MD_ITALIC, + MD_BOLDITALIC, + MD_EOF +}; + +tokendefn mdtokens[] = { + { "(", MD_LEFTBRACE , NULL }, + { ")", MD_RIGHTBRACE , NULL }, + { "[", MD_LEFTSQUAREBRACE , NULL }, + { "]", MD_RIGHTSQUAREBRACE , NULL }, + { "*", MD_ITALIC , NULL }, + { "_", MD_ITALIC , NULL }, + { "**", MD_BOLD , NULL }, + { "__", MD_BOLD , NULL }, + { "***", MD_BOLDITALIC , NULL }, + { "___", MD_BOLDITALIC , NULL }, + { "", TOKEN_NONE , NULL } +}; + + +/* ------------------------------------------------------- + * Initialize a JSON lexer + * ------------------------------------------------------- */ + +void help_initializemdlexer(lexer *l, char *src) { + lex_init(l, src, 0); + lex_settokendefns(l, mdtokens); + //lex_setprefn(l, json_lexpreprocess); + //lex_setwhitespacefn(l, json_lexwhitespace); + lex_seteof(l, MD_EOF); +} + +/* ********************************************************************** + * Parse help files + * ********************************************************************** */ + +bool help_parse(char *src) { + lexer l; + help_initializemdlexer(&l, src); + + + return false; +} /* ********************************************************************** * Morpho help files @@ -35,8 +91,24 @@ /** Loads a help file * @param file file to load * @returns true if any help entries were successfully loaded */ -bool help_load(char *file) { +bool help_load(char *filename) { + bool success=false; + + FILE *f = fopen(filename, "r"); + if (f) { + varray_char contents; + varray_charinit(&contents); + + if (file_readintovarray(f, &contents)) { + success=help_parse(contents.data); + } + + varray_charclear(&contents); + + fclose(f); + } + return success; } /** Searches for help files From adbcce50ec3fa83d8a974930d14c5c5c4b0eeefc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 25 Oct 2025 14:32:17 -0400 Subject: [PATCH 044/473] Configure parser --- src/support/help.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index d7e2e8af0..7dcc1c87d 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -14,6 +14,7 @@ #include "resources.h" #include "lex.h" +#include "parse.h" #include "file.h" /** The interactive help system uses a collection of Markdown files, located in @@ -61,7 +62,7 @@ tokendefn mdtokens[] = { /* ------------------------------------------------------- - * Initialize a JSON lexer + * Initialize a Markdown lexer * ------------------------------------------------------- */ void help_initializemdlexer(lexer *l, char *src) { @@ -72,14 +73,56 @@ void help_initializemdlexer(lexer *l, char *src) { lex_seteof(l, MD_EOF); } +/* ------------------------------------------------------- + * Markdown parse rules + * ------------------------------------------------------- */ + +/** Parses a markdown link */ +bool md_parselink(parser *p, void *out) { + return true; +} + +/** Base markdown parse type */ +bool md_parse(parser *p, void *out) { + return true; +} + +/* ------------------------------------------------------- + * Markdown parse table + * ------------------------------------------------------- */ + +parserule md_rules[] = { + PARSERULE_PREFIX(MD_LEFTSQUAREBRACE, md_parselink), + PARSERULE_UNUSED(TOKEN_NONE) +}; + +/* ------------------------------------------------------- + * Initialize a Markdown parser + * ------------------------------------------------------- */ + +/** Initializes a parser to parse JSON */ +void help_initializemdparser(parser *p, lexer *l, error *err, void *out) { + parse_init(p, l, err, out); + parse_setbaseparsefn(p, md_parse); + parse_setparsetable(p, md_rules); + parse_setskipnewline(p, false, TOKEN_NONE); +} + /* ********************************************************************** * Parse help files * ********************************************************************** */ bool help_parse(char *src) { + error err; + error_init(&err); + lexer l; help_initializemdlexer(&l, src); + parser p; + help_initializemdparser(&p, &l, &err, NULL); + + parse(&p); return false; } From 07a31e6623fb80e39edf8a78fe148a49a5c1964a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 25 Oct 2025 21:10:42 -0400 Subject: [PATCH 045/473] Basic Markdown lexing --- src/support/help.c | 39 +++++++++++++++++++++++++++++++++++---- src/support/lex.c | 9 +++++---- src/support/lex.h | 1 + 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 7dcc1c87d..827d0de88 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -36,6 +36,11 @@ * ********************************************************************** */ enum { + MD_TEXT, + MD_HASH, + MD_HASH2, + MD_HASH3, + MD_COLON, MD_LEFTBRACE, MD_RIGHTBRACE, MD_LEFTSQUAREBRACE, @@ -47,6 +52,10 @@ enum { }; tokendefn mdtokens[] = { + { "#", MD_HASH , NULL }, + { "##", MD_HASH2 , NULL }, + { "###", MD_HASH3 , NULL }, + { ":", MD_COLON , NULL }, { "(", MD_LEFTBRACE , NULL }, { ")", MD_RIGHTBRACE , NULL }, { "[", MD_LEFTSQUAREBRACE , NULL }, @@ -60,6 +69,22 @@ tokendefn mdtokens[] = { { "", TOKEN_NONE , NULL } }; +/** Lexer token preprocessor function */ +bool md_lexpreprocess(lexer *l, token *tok, error *err) { + // Keep going until we match a token or reach the end + while (!lex_identifytoken(l, false, NULL) && + !lex_isatend(l)) { + lex_advance(l); + } + + // If we captured anything, record it as text + if (l->current>l->start) { + lex_recordtoken(l, MD_TEXT, tok); + return true; + } + + return false; +} /* ------------------------------------------------------- * Initialize a Markdown lexer @@ -68,8 +93,8 @@ tokendefn mdtokens[] = { void help_initializemdlexer(lexer *l, char *src) { lex_init(l, src, 0); lex_settokendefns(l, mdtokens); - //lex_setprefn(l, json_lexpreprocess); - //lex_setwhitespacefn(l, json_lexwhitespace); + lex_setprefn(l, md_lexpreprocess); + lex_setwhitespacefn(l, NULL); lex_seteof(l, MD_EOF); } @@ -119,12 +144,18 @@ bool help_parse(char *src) { lexer l; help_initializemdlexer(&l, src); + token tok; + while (lex(&l, &tok, &err)) { + if (tok.type==MD_EOF) break; + } + + /* parser p; help_initializemdparser(&p, &l, &err, NULL); - parse(&p); + parse(&p);*/ - return false; + return true; } /* ********************************************************************** diff --git a/src/support/lex.c b/src/support/lex.c index 53a2ca1f8..8bd155e05 100644 --- a/src/support/lex.c +++ b/src/support/lex.c @@ -157,11 +157,12 @@ bool lex_matchtoken(lexer *l, tokendefn **defn) { return def; } -/** @brief Attempts to identify a token from the current point, advances if it finds one. +/** @brief Attempts to identify a token from the current point * @param[in] l The lexer in use + * @param[in] advance Should we advance if we find the token? * @param[out] defn Type of token, if found * @returns true if the token matched, false if not */ -bool lex_identifytoken(lexer *l, tokendefn **defn) { +bool lex_identifytoken(lexer *l, bool advance, tokendefn **defn) { char c = lex_peek(l); // Match first character @@ -177,7 +178,7 @@ bool lex_identifytoken(lexer *l, tokendefn **defn) { for (; def->string[0]==c && def>=l->defns; def--) { size_t len=strlen(def->string); if (strncmp(def->string, l->current, len)==0) { - lex_advanceby(l, len); + if (advance) lex_advanceby(l, len); if (defn) *defn = def; return true; } @@ -673,7 +674,7 @@ bool lex(lexer *l, token *tok, error *err) { } tokendefn *defn=NULL; - if (lex_identifytoken(l, &defn)) { + if (lex_identifytoken(l, true, &defn)) { lex_recordtoken(l, defn->type, tok); } else { morpho_writeerrorwithid(err, LEXER_UNRECOGNIZEDTOKEN, NULL, l->line, l->posn); diff --git a/src/support/lex.h b/src/support/lex.h index 597f22bc0..808f2b860 100644 --- a/src/support/lex.h +++ b/src/support/lex.h @@ -168,6 +168,7 @@ enum { bool lex_findtoken(lexer *l, tokendefn **defn); bool lex_matchtoken(lexer *l, tokendefn **defn); +bool lex_identifytoken(lexer *l, bool advance, tokendefn **defn); void lex_recordtoken(lexer *l, tokentype type, token *tok); char lex_advance(lexer *l); bool lex_back(lexer *l); From 200a5fa24874099176d15601eced5cfed1271443 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Oct 2025 09:51:51 -0400 Subject: [PATCH 046/473] Rough parser --- src/support/help.c | 75 +++++++++++++++++++++++++++++++++++++++------ src/support/parse.c | 3 -- src/support/parse.h | 3 ++ 3 files changed, 69 insertions(+), 12 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 827d0de88..1c4f4b15b 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -41,23 +41,29 @@ enum { MD_HASH2, MD_HASH3, MD_COLON, - MD_LEFTBRACE, - MD_RIGHTBRACE, + MD_LEFTPAREN, + MD_RIGHTPAREN, MD_LEFTSQUAREBRACE, MD_RIGHTSQUAREBRACE, MD_BOLD, MD_ITALIC, MD_BOLDITALIC, + MD_NEWLINE, MD_EOF }; +bool md_lexnewline(lexer *l, token *tok, error *err) { + lex_newline(l); + return true; +} + tokendefn mdtokens[] = { { "#", MD_HASH , NULL }, { "##", MD_HASH2 , NULL }, { "###", MD_HASH3 , NULL }, { ":", MD_COLON , NULL }, - { "(", MD_LEFTBRACE , NULL }, - { ")", MD_RIGHTBRACE , NULL }, + { "(", MD_LEFTPAREN , NULL }, + { ")", MD_RIGHTPAREN , NULL }, { "[", MD_LEFTSQUAREBRACE , NULL }, { "]", MD_RIGHTSQUAREBRACE , NULL }, { "*", MD_ITALIC , NULL }, @@ -66,6 +72,7 @@ tokendefn mdtokens[] = { { "__", MD_BOLD , NULL }, { "***", MD_BOLDITALIC , NULL }, { "___", MD_BOLDITALIC , NULL }, + { "\n", MD_NEWLINE , md_lexnewline }, { "", TOKEN_NONE , NULL } }; @@ -102,13 +109,62 @@ void help_initializemdlexer(lexer *l, char *src) { * Markdown parse rules * ------------------------------------------------------- */ +/** Parses a markdown header */ +bool md_parseheader(parser *p, void *out) { + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + PARSE_CHECK(parse_checktokenadvance(p, MD_NEWLINE)); + return true; +} + +bool md_parseurl(parser *p, void *out) { // TODO: This is a placeholder + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + PARSE_CHECK(parse_checktokenadvance(p, MD_HASH)); + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + return true; +} + /** Parses a markdown link */ bool md_parselink(parser *p, void *out) { + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); + PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); + PARSE_CHECK(md_parseurl(p, out)); + if (parse_checktokenadvance(p, MD_LEFTPAREN)) { + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTPAREN)); + } + PARSE_CHECK(parse_checktokenadvance(p, MD_NEWLINE)); + return true; } +/** Parses a markdown paragraph */ +bool md_parseparagraph(parser *p, void *out) { + return true; +} + +/** Parse a markdown 'block' */ +bool md_parseblock(parser *p, void *out) { + if (parse_checktokenadvance(p, MD_TEXT)) { + return md_parseparagraph(p, out); + } else if (parse_checktokenadvance(p, MD_LEFTSQUAREBRACE)) { + return md_parselink(p, out); + } else if (parse_checktokenadvance(p, MD_HASH)) { + return md_parseheader(p, out); + } else if (parse_checktokenadvance(p, MD_NEWLINE)) { // A blank line + return true; + } else { + return md_parseparagraph(p, out); + } + + return false; +} + /** Base markdown parse type */ bool md_parse(parser *p, void *out) { + while(md_parseblock(p, out)) { + } + return true; } @@ -117,7 +173,9 @@ bool md_parse(parser *p, void *out) { * ------------------------------------------------------- */ parserule md_rules[] = { - PARSERULE_PREFIX(MD_LEFTSQUAREBRACE, md_parselink), + PARSERULE_PREFIX(MD_HASH, NULL ), + PARSERULE_PREFIX(MD_LEFTSQUAREBRACE, NULL ), + PARSERULE_PREFIX(MD_BOLD, NULL ), PARSERULE_UNUSED(TOKEN_NONE) }; @@ -144,16 +202,15 @@ bool help_parse(char *src) { lexer l; help_initializemdlexer(&l, src); - token tok; + /*token tok; while (lex(&l, &tok, &err)) { if (tok.type==MD_EOF) break; - } + }*/ - /* parser p; help_initializemdparser(&p, &l, &err, NULL); - parse(&p);*/ + parse(&p); return true; } diff --git a/src/support/parse.c b/src/support/parse.c index 384be9cda..6c1f5cb97 100644 --- a/src/support/parse.c +++ b/src/support/parse.c @@ -18,9 +18,6 @@ /** Varrays of parse rules */ DEFINE_VARRAY(parserule, parserule) -/** Macro to check return of a bool function */ -#define PARSE_CHECK(f) if (!(f)) return false; - /* ********************************************************************** * Parser utility functions * ********************************************************************** */ diff --git a/src/support/parse.h b/src/support/parse.h index 9c1ec984d..e74e551eb 100644 --- a/src/support/parse.h +++ b/src/support/parse.h @@ -70,6 +70,9 @@ typedef struct { /** Varrays of parse rules */ DECLARE_VARRAY(parserule, parserule) +/** Macro to check return of a bool function */ +#define PARSE_CHECK(f) if (!(f)) return false; + /* ------------------------------------------------------- * Define a Parser * ------------------------------------------------------- */ From 14c8f496e1b54e35993c127b5b07a6d4ef4fe811 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Oct 2025 10:09:58 -0400 Subject: [PATCH 047/473] Parse paragraphs --- src/support/help.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 1c4f4b15b..4f387f9be 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -140,6 +140,14 @@ bool md_parselink(parser *p, void *out) { /** Parses a markdown paragraph */ bool md_parseparagraph(parser *p, void *out) { + tokentype intokens[] = { MD_TEXT, MD_COLON, MD_LEFTPAREN, MD_RIGHTPAREN }; + + while (parse_checktokenmulti(p, 4, intokens)) { + parse_advance(p); + } + + PARSE_CHECK(parse_checktokenadvance(p, MD_NEWLINE)); + return true; } @@ -202,11 +210,6 @@ bool help_parse(char *src) { lexer l; help_initializemdlexer(&l, src); - /*token tok; - while (lex(&l, &tok, &err)) { - if (tok.type==MD_EOF) break; - }*/ - parser p; help_initializemdparser(&p, &l, &err, NULL); From d06d6b94fa23deb012ae305759e071c1dd1eb900 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Oct 2025 16:23:51 -0400 Subject: [PATCH 048/473] Complete rough parser Now has sufficient token types and elements to parse all morpho help files so far. --- src/support/help.c | 97 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 30 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 4f387f9be..f592c5dc0 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -45,9 +45,16 @@ enum { MD_RIGHTPAREN, MD_LEFTSQUAREBRACE, MD_RIGHTSQUAREBRACE, - MD_BOLD, - MD_ITALIC, - MD_BOLDITALIC, + MD_ASTERISK, + MD_PLUS, + MD_DASH, + MD_UNDERSCORE, + MD_ASTERISK2, + MD_UNDERSCORE2, + MD_ASTERISK3, + MD_UNDERSCORE3, + MD_FOURSPACES, + MD_TAB, MD_NEWLINE, MD_EOF }; @@ -66,12 +73,16 @@ tokendefn mdtokens[] = { { ")", MD_RIGHTPAREN , NULL }, { "[", MD_LEFTSQUAREBRACE , NULL }, { "]", MD_RIGHTSQUAREBRACE , NULL }, - { "*", MD_ITALIC , NULL }, - { "_", MD_ITALIC , NULL }, - { "**", MD_BOLD , NULL }, - { "__", MD_BOLD , NULL }, - { "***", MD_BOLDITALIC , NULL }, - { "___", MD_BOLDITALIC , NULL }, + { "*", MD_ASTERISK , NULL }, + { "+", MD_PLUS , NULL }, + { "-", MD_DASH , NULL }, + { "_", MD_UNDERSCORE , NULL }, + { "**", MD_ASTERISK2 , NULL }, + { "__", MD_UNDERSCORE2 , NULL }, + { "***", MD_ASTERISK3 , NULL }, + { "___", MD_UNDERSCORE3 , NULL }, + { " ", MD_FOURSPACES , NULL }, + { "\t", MD_TAB , NULL }, { "\n", MD_NEWLINE , md_lexnewline }, { "", TOKEN_NONE , NULL } }; @@ -109,13 +120,43 @@ void help_initializemdlexer(lexer *l, char *src) { * Markdown parse rules * ------------------------------------------------------- */ +/** Parses text writen in markdown; stops at a non-textual token */ +bool md_parsetext(parser *p, void *out) { + tokentype intokens[] = { MD_TEXT, MD_COLON, MD_LEFTPAREN, MD_RIGHTPAREN }; + + while (parse_checktokenmulti(p, 4, intokens)) { + parse_advance(p); + } + + parse_checktokenadvance(p, MD_NEWLINE); + + return true; +} + /** Parses a markdown header */ bool md_parseheader(parser *p, void *out) { PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); - PARSE_CHECK(parse_checktokenadvance(p, MD_NEWLINE)); + parse_checktokenadvance(p, MD_NEWLINE); return true; } +/** Parses markdown code. */ +bool md_parsecode(parser *p, void *out) { + while (!parse_checktoken(p, MD_NEWLINE) && + !parse_checktoken(p, MD_EOF)) { + parse_advance(p); + } + + parse_checktokenadvance(p, MD_NEWLINE); + + return true; +} + +/** Parses a markdown list. */ +bool md_parselist(parser *p, void *out) { + return md_parsetext(p, out); +} + bool md_parseurl(parser *p, void *out) { // TODO: This is a placeholder PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); PARSE_CHECK(parse_checktokenadvance(p, MD_HASH)); @@ -133,20 +174,7 @@ bool md_parselink(parser *p, void *out) { PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTPAREN)); } - PARSE_CHECK(parse_checktokenadvance(p, MD_NEWLINE)); - - return true; -} - -/** Parses a markdown paragraph */ -bool md_parseparagraph(parser *p, void *out) { - tokentype intokens[] = { MD_TEXT, MD_COLON, MD_LEFTPAREN, MD_RIGHTPAREN }; - - while (parse_checktokenmulti(p, 4, intokens)) { - parse_advance(p); - } - - PARSE_CHECK(parse_checktokenadvance(p, MD_NEWLINE)); + parse_checktokenadvance(p, MD_NEWLINE); return true; } @@ -154,15 +182,23 @@ bool md_parseparagraph(parser *p, void *out) { /** Parse a markdown 'block' */ bool md_parseblock(parser *p, void *out) { if (parse_checktokenadvance(p, MD_TEXT)) { - return md_parseparagraph(p, out); + return md_parsetext(p, out); + } else if (parse_checktokenadvance(p, MD_HASH) || + parse_checktokenadvance(p, MD_HASH2)) { + return md_parseheader(p, out); + } else if (parse_checktokenadvance(p, MD_FOURSPACES) || + parse_checktokenadvance(p, MD_TAB)) { + return md_parsecode(p, out); + } else if (parse_checktokenadvance(p, MD_ASTERISK) || + parse_checktokenadvance(p, MD_PLUS) || + parse_checktokenadvance(p, MD_DASH)) { + return md_parselist(p, out); } else if (parse_checktokenadvance(p, MD_LEFTSQUAREBRACE)) { return md_parselink(p, out); - } else if (parse_checktokenadvance(p, MD_HASH)) { - return md_parseheader(p, out); } else if (parse_checktokenadvance(p, MD_NEWLINE)) { // A blank line return true; } else { - return md_parseparagraph(p, out); + UNREACHABLE("Unrecognized token."); } return false; @@ -170,7 +206,8 @@ bool md_parseblock(parser *p, void *out) { /** Base markdown parse type */ bool md_parse(parser *p, void *out) { - while(md_parseblock(p, out)) { + while (parse_checktoken(p, MD_EOF)) { + PARSE_CHECK(md_parseblock(p, out)); } return true; @@ -183,7 +220,7 @@ bool md_parse(parser *p, void *out) { parserule md_rules[] = { PARSERULE_PREFIX(MD_HASH, NULL ), PARSERULE_PREFIX(MD_LEFTSQUAREBRACE, NULL ), - PARSERULE_PREFIX(MD_BOLD, NULL ), + PARSERULE_PREFIX(MD_ASTERISK, NULL ), PARSERULE_UNUSED(TOKEN_NONE) }; From 0287b32e732f8a43346e64130fefb58f532b12ba Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 27 Oct 2025 10:14:23 -0400 Subject: [PATCH 049/473] Parse headers --- src/support/help.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index f592c5dc0..7e4b34e55 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -184,7 +184,8 @@ bool md_parseblock(parser *p, void *out) { if (parse_checktokenadvance(p, MD_TEXT)) { return md_parsetext(p, out); } else if (parse_checktokenadvance(p, MD_HASH) || - parse_checktokenadvance(p, MD_HASH2)) { + parse_checktokenadvance(p, MD_HASH2) || + parse_checktokenadvance(p, MD_HASH3)) { return md_parseheader(p, out); } else if (parse_checktokenadvance(p, MD_FOURSPACES) || parse_checktokenadvance(p, MD_TAB)) { From b4de710d11bf83a68f22e2f1dea60f962432108b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 27 Oct 2025 22:02:55 -0400 Subject: [PATCH 050/473] Parse inline tokens --- src/support/help.c | 54 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 7e4b34e55..b66feb50d 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -45,6 +45,7 @@ enum { MD_RIGHTPAREN, MD_LEFTSQUAREBRACE, MD_RIGHTSQUAREBRACE, + MD_BACKTICK, MD_ASTERISK, MD_PLUS, MD_DASH, @@ -73,6 +74,7 @@ tokendefn mdtokens[] = { { ")", MD_RIGHTPAREN , NULL }, { "[", MD_LEFTSQUAREBRACE , NULL }, { "]", MD_RIGHTSQUAREBRACE , NULL }, + { "`", MD_BACKTICK , NULL }, { "*", MD_ASTERISK , NULL }, { "+", MD_PLUS , NULL }, { "-", MD_DASH , NULL }, @@ -116,16 +118,47 @@ void help_initializemdlexer(lexer *l, char *src) { lex_seteof(l, MD_EOF); } +/* ------------------------------------------------------- + * Markdown parse table (for inline syntax) + * ------------------------------------------------------- */ + +bool md_parseinlinecode(parser *p, void *out) { + while (parse_checktokenadvance(p, MD_TEXT)); + parse_checktokenadvance(p, MD_BACKTICK); + return true; +} + +bool md_parsebold(parser *p, void *out) { + +} + +parserule md_rules[] = { + PARSERULE_PREFIX(MD_ASTERISK2, md_parsebold ), + PARSERULE_PREFIX(MD_UNDERSCORE2, md_parsebold ), + PARSERULE_PREFIX(MD_BACKTICK, md_parseinlinecode ), + PARSERULE_UNUSED(TOKEN_NONE) +}; + /* ------------------------------------------------------- * Markdown parse rules * ------------------------------------------------------- */ +/** Check if a token type is a 'textual' token */ +tokentype _inlinetokens[] = { MD_TEXT, MD_COLON, MD_BACKTICK, MD_LEFTPAREN, MD_RIGHTPAREN }; +int _ninlinetokens = sizeof(_inlinetokens)/sizeof(tokentype); + +bool md_checktexttoken(parser *p) { + return parse_checktokenmulti(p, _ninlinetokens, _inlinetokens); +} + /** Parses text writen in markdown; stops at a non-textual token */ bool md_parsetext(parser *p, void *out) { - tokentype intokens[] = { MD_TEXT, MD_COLON, MD_LEFTPAREN, MD_RIGHTPAREN }; - - while (parse_checktokenmulti(p, 4, intokens)) { + while (md_checktexttoken(p)) { parse_advance(p); + parserule *rule = parse_getrule(p, p->previous.type); + if (rule && rule->prefix) { + if (!rule->prefix(p, out)) return false; + } } parse_checktokenadvance(p, MD_NEWLINE); @@ -181,7 +214,7 @@ bool md_parselink(parser *p, void *out) { /** Parse a markdown 'block' */ bool md_parseblock(parser *p, void *out) { - if (parse_checktokenadvance(p, MD_TEXT)) { + if (md_checktexttoken(p)) { return md_parsetext(p, out); } else if (parse_checktokenadvance(p, MD_HASH) || parse_checktokenadvance(p, MD_HASH2) || @@ -207,24 +240,13 @@ bool md_parseblock(parser *p, void *out) { /** Base markdown parse type */ bool md_parse(parser *p, void *out) { - while (parse_checktoken(p, MD_EOF)) { + while (!parse_checktoken(p, MD_EOF)) { PARSE_CHECK(md_parseblock(p, out)); } return true; } -/* ------------------------------------------------------- - * Markdown parse table - * ------------------------------------------------------- */ - -parserule md_rules[] = { - PARSERULE_PREFIX(MD_HASH, NULL ), - PARSERULE_PREFIX(MD_LEFTSQUAREBRACE, NULL ), - PARSERULE_PREFIX(MD_ASTERISK, NULL ), - PARSERULE_UNUSED(TOKEN_NONE) -}; - /* ------------------------------------------------------- * Initialize a Markdown parser * ------------------------------------------------------- */ From dd1af96e4668d0f89e2dc941f6f6c6a3753ddd0c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 27 Oct 2025 22:14:41 -0400 Subject: [PATCH 051/473] md_parsebold --- src/support/help.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/support/help.c b/src/support/help.c index b66feb50d..8de489ad3 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -129,7 +129,11 @@ bool md_parseinlinecode(parser *p, void *out) { } bool md_parsebold(parser *p, void *out) { + while (parse_checktokenadvance(p, MD_TEXT)); + if (parse_checktoken(p, MD_ASTERISK2) || + parse_checktoken(p, MD_UNDERSCORE2)) parse_advance(p); + return true; } parserule md_rules[] = { From 4863a990a078ec4e0630998f1f623c1b24550d8c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 30 Oct 2025 17:45:00 -0400 Subject: [PATCH 052/473] Check if a function set contains a variadic function --- src/classes/metafunction.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 15826ca88..4847db4d3 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -374,6 +374,14 @@ void mfcompile_countparams(mfcompiler *c, mfset *set, int *min, int *max) { if (max) *max = imax; } +/** Check if a set contains a variadic */ +bool mfcompile_containsvariadic(mfcompiler *c, mfset *set) { + for (int i=0; icount; i++) { + if (signature_isvarg(set->rlist[i].sig)) return true; + } + return false; +} + /** Places the various outcomes for a parameter into a dictionary */ bool mfcompile_outcomes(mfcompiler *c, mfset *set, int i, dictionary *out) { for (int k=0; kcount; k++) { // Loop over outcomes @@ -769,6 +777,8 @@ mfindx mfcompile_set(mfcompiler *c, mfset *set) { int min, max; // Count the range of possible parameters mfcompile_countparams(c, set, &min, &max); + bool isvariadic = mfcompile_containsvariadic(c, set); + // Dispatch on the number of parameters if it's in doubt if (min!=max) return mfcompile_dispatchonnarg(c, set, min, max); @@ -810,7 +820,7 @@ bool metafunction_compile(objectmetafunction *fn, error *err) { mfcompiler_init(&compiler, fn); mfcompile_set(&compiler, &set); - //mfcompiler_disassemble(&compiler); + mfcompiler_disassemble(&compiler); bool success=!morpho_checkerror(&compiler.err); if (!success && err) *err=compiler.err; From 16beb7554c28695820d014c3997b55516095972f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 30 Oct 2025 18:10:32 -0400 Subject: [PATCH 053/473] Ensure variadics are checked at least once --- src/classes/metafunction.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 4847db4d3..f61209a83 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -241,6 +241,7 @@ DEFINE_VARRAY(mfset, mfset) typedef struct { objectmetafunction *fn; varray_int checked; // Stack of checked parameters + bool varchecked; // Have we checked for a variadic function? error err; } mfcompiler; @@ -249,6 +250,7 @@ void mfcompiler_init(mfcompiler *c, objectmetafunction *fn) { c->fn=fn; varray_intinit(&c->checked); error_init(&c->err); + c->varchecked=false; } /** Clear the metafunction compiler */ @@ -767,6 +769,7 @@ mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max) { mfcompile_setbranch(c, bindx, varg); // Correct branchargs branch destination to point to the varg resolution } } + return bindx; } @@ -780,7 +783,10 @@ mfindx mfcompile_set(mfcompiler *c, mfset *set) { bool isvariadic = mfcompile_containsvariadic(c, set); // Dispatch on the number of parameters if it's in doubt - if (min!=max) return mfcompile_dispatchonnarg(c, set, min, max); + if (min!=max || (isvariadic && !c->varchecked)) { + c->varchecked=true; + return mfcompile_dispatchonnarg(c, set, min, max); + } // If just one parameter, dispatch on it if (min==1 && !mfcompiler_ischecked(c, 0)) { @@ -820,7 +826,7 @@ bool metafunction_compile(objectmetafunction *fn, error *err) { mfcompiler_init(&compiler, fn); mfcompile_set(&compiler, &set); - mfcompiler_disassemble(&compiler); + //mfcompiler_disassemble(&compiler); bool success=!morpho_checkerror(&compiler.err); if (!success && err) *err=compiler.err; From 3c3d507cc07ea1770a6dd83b4ed5c47c1dc68234 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 2 Nov 2025 09:56:58 -0500 Subject: [PATCH 054/473] Correct variadic dispatch --- src/classes/metafunction.c | 6 ++++-- test/types/multiple_dispatch/dispatch_nargs_variadic.morpho | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 test/types/multiple_dispatch/dispatch_nargs_variadic.morpho diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index f61209a83..4b2772116 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -758,9 +758,11 @@ mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max) { // Compile the branch table mfcompile_branchtable(c, set, bindx, &btable); - // Correct branch table for varg resolution + // Insert variadic resolution into branch table if necessary if (set->rlist[0].sig->varg) { - mfindx varg = bindx+1; + mfinstruction vargres = MFINSTRUCTION_RESOLVE(set->rlist[0].fn); + mfindx varg = mfcompile_insertinstruction(c, vargres)-1; + int nmin = set->rlist[0].sig->types.count-1; // varg can match this many args or more for (int i=nmin; i Date: Sun, 2 Nov 2025 16:56:08 -0500 Subject: [PATCH 055/473] Fix type check on store to global --- src/core/compile.c | 2 +- test/types/violations/type_violation_global.morpho | 5 +++-- .../violations/type_violation_global_initializer.morpho | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 test/types/violations/type_violation_global_initializer.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 69bf9dccf..85c733035 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -1231,7 +1231,7 @@ codeinfo compiler_movetoglobal(compiler *c, syntaxtreenode *node, codeinfo in, g } value type=MORPHO_NIL; - if (compiler_regcurrenttype(c, in.dest, &type)) { + if (compiler_regcurrenttype(c, use.dest, &type)) { if (!compiler_checkglobaltype(c, node, slot, type)) goto compiler_movetoglobal_cleanup; } diff --git a/test/types/violations/type_violation_global.morpho b/test/types/violations/type_violation_global.morpho index f964ad406..4eba5b742 100644 --- a/test/types/violations/type_violation_global.morpho +++ b/test/types/violations/type_violation_global.morpho @@ -1,5 +1,6 @@ -// Type definition in global context +// Type violation due to a constructor -String u = 1 +String u = "" +u = 1 // expect error 'TypeErr' diff --git a/test/types/violations/type_violation_global_initializer.morpho b/test/types/violations/type_violation_global_initializer.morpho new file mode 100644 index 000000000..f964ad406 --- /dev/null +++ b/test/types/violations/type_violation_global_initializer.morpho @@ -0,0 +1,5 @@ +// Type definition in global context + +String u = 1 + +// expect error 'TypeErr' From 507433521482c9c37a27787d2434aeb0cc628eb0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 2 Nov 2025 17:18:39 -0500 Subject: [PATCH 056/473] Check for type violations with nil --- test/types/violations/type_violation_nil.morpho | 7 +++++++ test/types/violations/type_violation_nil_return.morpho | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 test/types/violations/type_violation_nil.morpho create mode 100644 test/types/violations/type_violation_nil_return.morpho diff --git a/test/types/violations/type_violation_nil.morpho b/test/types/violations/type_violation_nil.morpho new file mode 100644 index 000000000..37d946928 --- /dev/null +++ b/test/types/violations/type_violation_nil.morpho @@ -0,0 +1,7 @@ +// Assign nil to a type protected variable + +Int a = 1 + +a = nil + +// expect error 'TypeErr' diff --git a/test/types/violations/type_violation_nil_return.morpho b/test/types/violations/type_violation_nil_return.morpho new file mode 100644 index 000000000..7535d9fa5 --- /dev/null +++ b/test/types/violations/type_violation_nil_return.morpho @@ -0,0 +1,7 @@ +// Assign nil result to a type protected variable + +fn foo(x) { } + +Int a = foo(1) + +// expect error 'TypeErr' From f150dccba175d31400cb9e1094521bd95054b7bc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 4 Nov 2025 06:49:07 -0500 Subject: [PATCH 057/473] Runtime type checks --- src/core/compile.c | 228 ++++++++++-------- src/core/opcodes.h | 3 + src/core/vm.c | 37 +++ src/datastructures/error.h | 3 + src/debug/debug.c | 1 + test/types/type_runtime.morpho | 11 + .../violations/type_violation_runtime.morpho | 13 + 7 files changed, 202 insertions(+), 94 deletions(-) create mode 100644 test/types/type_runtime.morpho create mode 100644 test/types/violations/type_violation_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 85c733035..4f261eea6 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -458,6 +458,76 @@ static bool compiler_inloop(compiler *c) { return (f->loopdepth>0); } +/* ------------------------------------------ + * Constants + * ------------------------------------------- */ + +/** Writes a constant to the current constant table + * @param c the compiler + * @param node current syntaxtree node + * @param constant the constant to add + * @param usestrict whether to use a strict e + * @param clone whether to clone the constant if it's not already present + * (typically this is set to copy strings from the syntax tree) */ +registerindx compiler_addconstant(compiler *c, syntaxtreenode *node, value constant, bool usestrict, bool clone) { + varray_value *konst = compiler_getcurrentconstanttable(c); + if (!konst) return REGISTER_UNALLOCATED; + + registerindx out=REGISTER_UNALLOCATED; + unsigned int prev=0; + + if (konst) { + /* Was a similar previous constant already added? */ + if (usestrict) { + if (varray_valuefindsame(konst, constant, &prev)) out=(registerindx) prev; + } else { + if (varray_valuefind(konst, constant, &prev)) out=(registerindx) prev; + } + + /* No, so create a new one */ + if (out==REGISTER_UNALLOCATED) { + if (konst->count>=MORPHO_MAXCONSTANTS) { + compiler_error(c, node, COMPILE_TOOMANYCONSTANTS); + return REGISTER_UNALLOCATED; + } else { + value add = constant; + if (clone && MORPHO_ISOBJECT(add)) { + /* If clone is set, we should try to clone the contents if the thing is an object. */ + if (MORPHO_ISSTRING(add)) { + add=object_clonestring(add); + } else if (MORPHO_ISCOMPLEX(add)) { + add=object_clonecomplexvalue(add); + } else { + UNREACHABLE("Erroneously being asked to clone a non-string non-complex constant."); + } + } + + bool success=varray_valueadd(konst, &add, 1); + out=konst->count-1; + if (!success) compiler_error(c, node, ERROR_ALLOCATIONFAILED); + + /* If the constant is an object and we cloned it, make sure it's bound to the program */ + if (clone && MORPHO_ISOBJECT(add)) { + program_bindobject(c->out, MORPHO_GETOBJECT(add)); + } + } + } + } + + return out; +} + +/** Write a symbol to the constant table, performing interning. + * @param c the compiler + * @param node current syntaxtree node + * @param symbol the constant to add */ +static registerindx compiler_addsymbol(compiler *c, syntaxtreenode *node, value symbol) { + /* Intern the symbol */ + value add=program_internsymbol(c->out, symbol); + + return compiler_addconstant(c, node, add, true, false); +} + /* ------------------------------------------ * Register allocation and deallocation * ------------------------------------------- */ @@ -678,6 +748,38 @@ bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type) { return true; } +/** Sets the current type of a register. Raises a type violation error if this is not compatible with the required type */ +bool compiler_regsetcurrenttypeX(compiler *c, registerindx reg, value type) { + functionstate *f = compiler_currentfunctionstate(c); + if (reg>=f->registers.count) return false; + f->registers.data[reg].currenttype=type; + return true; +} + +/** Performs a type check on register reg against a given type. Codeinfo is updated if a typecheck instruction needs to be generated */ +bool compiler_regtypecheck(compiler *c, syntaxtreenode *node, registerindx reg, value type, codeinfo *info) { + bool success=false; + functionstate *f = compiler_currentfunctionstate(c); + + value rtype=MORPHO_NIL; // Get the current type held in register reg + compiler_regcurrenttype(c, reg, &rtype); + + if (MORPHO_ISNIL(type)) { // Not type protected + success=true; + } else if (MORPHO_ISNIL(rtype)) { // Type unknown; generate dynamic typecheck against type + registerindx ctype = compiler_addconstant(c, node, type, false, false); + compiler_addinstruction(c, ENCODE_LONG(OP_TYPECHECK, reg, ctype), node); + info->ninstructions++; + success=true; + } else if (compiler_checktype(c, type, rtype)) { // Successful type check + success=true; + } else { // Type is incompatible + compiler_typeviolation(c, node, type, rtype, f->registers.data[reg].symbol); + } + + return success; +} + /** @brief Finds the register that contains symbol in a given functionstate * @details Searches backwards so that the innermost scope has priority */ static registerindx compiler_findsymbol(functionstate *f, value symbol) { @@ -830,101 +932,9 @@ void compiler_regshow(compiler *c) { } /* ------------------------------------------ - * Track scope + * Materialize a builtin function * ------------------------------------------- */ -/** Increments the scope counter in the current functionstate */ -void compiler_beginscope(compiler *c) { - functionstate *f=compiler_currentfunctionstate(c); - f->scopedepth++; -} - -void compiler_functionreffreeatscope(compiler *c, unsigned int scope); - -/** Decrements the scope counter in the current functionstate */ -void compiler_endscope(compiler *c) { - functionstate *f=compiler_currentfunctionstate(c); - compiler_regfreeatscope(c, f->scopedepth); - compiler_functionreffreeatscope(c, f->scopedepth); - f->scopedepth--; -} - -/** Gets the scope counter in the current functionstate */ -unsigned int compiler_currentscope(compiler *c) { - functionstate *f=compiler_currentfunctionstate(c); - return f->scopedepth; -} - -/* ------------------------------------------ - * Constants - * ------------------------------------------- */ - -/** Writes a constant to the current constant table - * @param c the compiler - * @param node current syntaxtree node - * @param constant the constant to add - * @param usestrict whether to use a strict e - * @param clone whether to clone the constant if it's not already present - * (typically this is set to copy strings from the syntax tree) */ -static registerindx compiler_addconstant(compiler *c, syntaxtreenode *node, value constant, bool usestrict, bool clone) { - varray_value *konst = compiler_getcurrentconstanttable(c); - if (!konst) return REGISTER_UNALLOCATED; - - registerindx out=REGISTER_UNALLOCATED; - unsigned int prev=0; - - if (konst) { - /* Was a similar previous constant already added? */ - if (usestrict) { - if (varray_valuefindsame(konst, constant, &prev)) out=(registerindx) prev; - } else { - if (varray_valuefind(konst, constant, &prev)) out=(registerindx) prev; - } - - /* No, so create a new one */ - if (out==REGISTER_UNALLOCATED) { - if (konst->count>=MORPHO_MAXCONSTANTS) { - compiler_error(c, node, COMPILE_TOOMANYCONSTANTS); - return REGISTER_UNALLOCATED; - } else { - value add = constant; - if (clone && MORPHO_ISOBJECT(add)) { - /* If clone is set, we should try to clone the contents if the thing is an object. */ - if (MORPHO_ISSTRING(add)) { - add=object_clonestring(add); - } else if (MORPHO_ISCOMPLEX(add)) { - add=object_clonecomplexvalue(add); - } else { - UNREACHABLE("Erroneously being asked to clone a non-string non-complex constant."); - } - } - - bool success=varray_valueadd(konst, &add, 1); - out=konst->count-1; - if (!success) compiler_error(c, node, ERROR_ALLOCATIONFAILED); - - /* If the constant is an object and we cloned it, make sure it's bound to the program */ - if (clone && MORPHO_ISOBJECT(add)) { - program_bindobject(c->out, MORPHO_GETOBJECT(add)); - } - } - } - } - - return out; -} - -/** Write a symbol to the constant table, performing interning. - * @param c the compiler - * @param node current syntaxtree node - * @param symbol the constant to add */ -static registerindx compiler_addsymbol(compiler *c, syntaxtreenode *node, value symbol) { - /* Intern the symbol */ - value add=program_internsymbol(c->out, symbol); - - return compiler_addconstant(c, node, add, true, false); -} - /** Finds a builtin function and loads it into a register at the top of the stack * @param c the compiler * @param node current syntax tree node @@ -956,6 +966,32 @@ codeinfo compiler_findbuiltin(compiler *c, syntaxtreenode *node, char *name, reg return ret; } +/* ------------------------------------------ + * Track scope + * ------------------------------------------- */ + +/** Increments the scope counter in the current functionstate */ +void compiler_beginscope(compiler *c) { + functionstate *f=compiler_currentfunctionstate(c); + f->scopedepth++; +} + +void compiler_functionreffreeatscope(compiler *c, unsigned int scope); + +/** Decrements the scope counter in the current functionstate */ +void compiler_endscope(compiler *c) { + functionstate *f=compiler_currentfunctionstate(c); + compiler_regfreeatscope(c, f->scopedepth); + compiler_functionreffreeatscope(c, f->scopedepth); + f->scopedepth--; +} + +/** Gets the scope counter in the current functionstate */ +unsigned int compiler_currentscope(compiler *c) { + functionstate *f=compiler_currentfunctionstate(c); + return f->scopedepth; +} + /* ------------------------------------------ * Local variables * ------------------------------------------- */ @@ -1059,7 +1095,11 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei } if (out.dest!=info.dest) { - if (compiler_regcurrenttype(c, info.dest, &type)) compiler_regsetcurrenttype(c, node, out.dest, type); + if (compiler_regtype(c, out.dest, &type) && + compiler_regtypecheck(c, node, info.dest, type, &out) && + compiler_regcurrenttype(c, info.dest, &type)) { + compiler_regsetcurrenttypeX(c, out.dest, type); // TODO: Should we instead set the type to the known result of the typecheck? + } compiler_addinstruction(c, ENCODE_DOUBLE(OP_MOV, out.dest, info.dest), node); out.ninstructions++; diff --git a/src/core/opcodes.h b/src/core/opcodes.h index 2fb5f6d19..e02dca6bb 100644 --- a/src/core/opcodes.h +++ b/src/core/opcodes.h @@ -114,6 +114,9 @@ OPCODE(CAT) /** Print the cotents of a register */ OPCODE(PRINT) +/** Type check the contents of a register */ +OPCODE(TYPECHECK) + /** Raise error */ //OPCODE(RAISE) diff --git a/src/core/vm.c b/src/core/vm.c index 6e3d4f2aa..cf3ffc8a6 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -584,6 +584,28 @@ static inline bool vm_invoke(vm *v, value obj, value method, int nargs, value *a return false; } +/** Recursively searches the parents list of classes to see if the type 'match' is present */ +bool _findtypeinparent(objectclass *type, value match) { + for (int i=0; iparents.count; i++) { + if (MORPHO_ISEQUAL(type->parents.data[i], match) || + _findtypeinparent(MORPHO_GETCLASS(type->parents.data[i]), match)) return true; + } + return false; +} + +static inline bool vm_typecheck(vm *v, value val, value match) { + value type; + if (!metafunction_typefromvalue(val, &type)) return false; + + if (MORPHO_ISNIL(type) || // If type is unset, we always match + MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same + + // Also match if 'match' inherits from 'type' + if (MORPHO_ISCLASS(match)) return _findtypeinparent( MORPHO_GETCLASS(match), type); + + return false; +} + /** Recovers the number of optional arguments */ int vm_getoptionalargs(vm *v) { return v->fp->nopt; @@ -1476,6 +1498,20 @@ bool morpho_interpret(vm *v, value *rstart, instructionindx istart) { morpho_printf(v, "\n"); DISPATCH(); + CASE_CODE(TYPECHECK): + a=DECODE_A(bc); b=DECODE_Bx(bc); + + if (!vm_typecheck(v, reg[a], v->konst[b])) { + value type; + metafunction_typefromvalue(reg[a], &type); + + VERROR(VM_TYPECHK, + MORPHO_GETCSTRING(MORPHO_GETCLASS(type)->name), + MORPHO_GETCSTRING(MORPHO_GETCLASS(v->konst[b])->name)); + } + + DISPATCH(); + CASE_CODE(BREAK): if (v->debug) { if (vm_shouldbreakatpc(v, pc) || @@ -2169,6 +2205,7 @@ void morpho_initialize(void) { morpho_defineerror(VM_DVZR, ERROR_HALT, VM_DVZR_MSG); morpho_defineerror(VM_GETINDEXARGS, ERROR_HALT, VM_GETINDEXARGS_MSG); morpho_defineerror(VM_MLTPLDSPTCHFLD, ERROR_HALT, VM_MLTPLDSPTCHFLD_MSG); + morpho_defineerror(VM_TYPECHK, ERROR_HALT, VM_TYPECHK_MSG); morpho_defineerror(VM_DBGQUIT, ERROR_HALT, VM_DBGQUIT_MSG); diff --git a/src/datastructures/error.h b/src/datastructures/error.h index 9f7aad871..97f0e655e 100644 --- a/src/datastructures/error.h +++ b/src/datastructures/error.h @@ -197,6 +197,9 @@ void morpho_unreachable(const char *explanation); #define VM_MLTPLDSPTCHFLD "MltplDsptchFld" #define VM_MLTPLDSPTCHFLD_MSG "Multiple dispatch could not find an implementation that matches these arguments." +#define VM_TYPECHK "TypeChk" +#define VM_TYPECHK_MSG "Type violation: Attempted to assign type %s to an %s variable." + /* ------------------------------------------------------- * Error interface * ------------------------------------------------------- */ diff --git a/src/debug/debug.c b/src/debug/debug.c index 712ef0653..ffec99cd5 100644 --- a/src/debug/debug.c +++ b/src/debug/debug.c @@ -345,6 +345,7 @@ assemblyrule assemblyrules[] ={ { OP_LE, "le ", "rA, rB, rC" }, { OP_PRINT, "print", "rA" }, + { OP_TYPECHECK, "typecheck", "rA, cX" }, { OP_B, "b", "+" }, { OP_BIF, "bif", "rA +" }, diff --git a/test/types/type_runtime.morpho b/test/types/type_runtime.morpho new file mode 100644 index 000000000..d42719354 --- /dev/null +++ b/test/types/type_runtime.morpho @@ -0,0 +1,11 @@ +// Runtime typecheck + +{ + fn foo(x, y) { + return x + y + } + + var a = foo(1,2) + + Int b = a +} diff --git a/test/types/violations/type_violation_runtime.morpho b/test/types/violations/type_violation_runtime.morpho new file mode 100644 index 000000000..891cb8b0a --- /dev/null +++ b/test/types/violations/type_violation_runtime.morpho @@ -0,0 +1,13 @@ +// Runtime typecheck + +{ + fn foo(x, y) { + return x + y + } + + var a = foo(1.5,2) + + Int b = a +} + +// expect error 'TypeChk' From d8cf38ef6a6c31712b4ee96efa3dac9e3bec2c00 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 4 Nov 2025 06:53:14 -0500 Subject: [PATCH 058/473] Pull utility function out of metafunction --- src/classes/metafunction.c | 16 +--------------- src/classes/metafunction.h | 1 - src/core/compile.c | 2 +- src/core/vm.c | 4 ++-- src/datastructures/value.c | 14 ++++++++++++++ src/datastructures/value.h | 7 +++++++ 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 4b2772116..5502e320f 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -117,24 +117,10 @@ bool metafunction_add(objectmetafunction *f, value fn) { return varray_valuewrite(&f->fns, fn); } -/** Extracts a type from a value */ -bool metafunction_typefromvalue(value v, value *out) { - objectclass *clss = NULL; - - if (MORPHO_ISINSTANCE(v)) { - clss=MORPHO_GETINSTANCE(v)->klass; - } else if (MORPHO_ISOBJECT(v)) { - clss = object_getveneerclass(MORPHO_GETOBJECT(v)->type); - } else clss = value_getveneerclass(v); - - if (clss) *out = MORPHO_OBJECT(clss); - return clss; -} - /** Checks if val matches a given type */ bool metafunction_matchtype(value type, value val) { value match; - if (!metafunction_typefromvalue(val, &match)) return false; + if (!value_type(val, &match)) return false; if (MORPHO_ISNIL(type) || // If type is unset, we always match MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same diff --git a/src/classes/metafunction.h b/src/classes/metafunction.h index 3b88686eb..bddf8857b 100644 --- a/src/classes/metafunction.h +++ b/src/classes/metafunction.h @@ -70,7 +70,6 @@ objectmetafunction *metafunction_clone(objectmetafunction *f); bool metafunction_wrap(value name, value fn, value *out); bool metafunction_add(objectmetafunction *f, value fn); -bool metafunction_typefromvalue(value v, value *out); void metafunction_setclass(objectmetafunction *f, objectclass *klass); objectclass *metafunction_class(objectmetafunction *f); diff --git a/src/core/compile.c b/src/core/compile.c index 4f261eea6..fac1631d1 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -364,7 +364,7 @@ bool compiler_findtypefromcstring(compiler *c, char *label, value *out) { /** Identifies a type from a value */ bool compiler_typefromvalue(compiler *c, value v, value *out) { - return metafunction_typefromvalue(v, out); + return value_type(v, out); } /** Recursively searches the parents list of classes to see if the type 'match' is present */ diff --git a/src/core/vm.c b/src/core/vm.c index cf3ffc8a6..7ab6d46a6 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -595,7 +595,7 @@ bool _findtypeinparent(objectclass *type, value match) { static inline bool vm_typecheck(vm *v, value val, value match) { value type; - if (!metafunction_typefromvalue(val, &type)) return false; + if (!value_type(val, &type)) return false; if (MORPHO_ISNIL(type) || // If type is unset, we always match MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same @@ -1503,7 +1503,7 @@ bool morpho_interpret(vm *v, value *rstart, instructionindx istart) { if (!vm_typecheck(v, reg[a], v->konst[b])) { value type; - metafunction_typefromvalue(reg[a], &type); + value_type(reg[a], &type); VERROR(VM_TYPECHK, MORPHO_GETCSTRING(MORPHO_GETCLASS(type)->name), diff --git a/src/datastructures/value.c b/src/datastructures/value.c index 9a68336f6..af88eb477 100644 --- a/src/datastructures/value.c +++ b/src/datastructures/value.c @@ -196,6 +196,20 @@ bool value_minmax(unsigned int nval, value *list, value *min, value *max) { return true; } +/** Extracts a type from a value */ +bool value_type(value v, value *type) { + objectclass *clss = NULL; + + if (MORPHO_ISINSTANCE(v)) { + clss=MORPHO_GETINSTANCE(v)->klass; + } else if (MORPHO_ISOBJECT(v)) { + clss = object_getveneerclass(MORPHO_GETOBJECT(v)->type); + } else clss = value_getveneerclass(v); + + if (clss) *type = MORPHO_OBJECT(clss); + return clss; +} + /* ********************************************************************** * Varray_values and utility functions * ********************************************************************** */ diff --git a/src/datastructures/value.h b/src/datastructures/value.h index 0d90c7cdb..29dc1abd6 100644 --- a/src/datastructures/value.h +++ b/src/datastructures/value.h @@ -240,6 +240,13 @@ bool morpho_valuetofloat(value v, double *out); #define MORPHO_ISFALSE(x) (morpho_isfalse(x)) #define MORPHO_ISTRUE(x) (!morpho_isfalse(x)) +/* ------------------------------------------------------- + * Type checking + * ------------------------------------------------------- */ + +/** Get the type associated with a value */ +bool value_type(value v, value *type); + /* ------------------------------------------------------- * Varrays of values * ------------------------------------------------------- */ From 7267902e3f7d4cad42320741ce8b4b52382db503 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 6 Nov 2025 11:22:07 -0500 Subject: [PATCH 059/473] Runtime typechecks of load from global --- src/core/compile.c | 6 +++++- test/types/type_global_runtime.morpho | 11 +++++++++++ .../violations/type_violation_global_runtime.morpho | 12 ++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test/types/type_global_runtime.morpho create mode 100644 test/types/violations/type_violation_global_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index fac1631d1..7551a5215 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -1081,11 +1081,15 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei out.returntype=REGISTER; if (compiler_getglobaltype(c, info.dest, &type)) { - compiler_regsetcurrenttype(c, node, out.dest, type); + compiler_regsetcurrenttypeX(c, out.dest, type); } compiler_addinstruction(c, ENCODE_LONG(OP_LGL, out.dest, info.dest), node); out.ninstructions++; + + if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid + compiler_regtypecheck(c, node, out.dest, type, &out); + } } else { /* Move between registers */ if (reg==REGISTER_UNALLOCATED) { diff --git a/test/types/type_global_runtime.morpho b/test/types/type_global_runtime.morpho new file mode 100644 index 000000000..8f0dc1faa --- /dev/null +++ b/test/types/type_global_runtime.morpho @@ -0,0 +1,11 @@ +// Runtime typecheck + +fn foo(x, y) { + return x + y +} + +var a = foo(1,2) +{ + Int b = a +} + diff --git a/test/types/violations/type_violation_global_runtime.morpho b/test/types/violations/type_violation_global_runtime.morpho new file mode 100644 index 000000000..72d6142d5 --- /dev/null +++ b/test/types/violations/type_violation_global_runtime.morpho @@ -0,0 +1,12 @@ +// Runtime typecheck + +fn foo(x, y) { + return x + y +} + +var a = foo(1.5,2) +{ + Int b = a +} + +// expect error 'TypeChk' \ No newline at end of file From c4badd2750031816a5896c9cfc8e1d34874e9b6c Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 6 Nov 2025 12:13:29 -0500 Subject: [PATCH 060/473] Typechecks when a known type is being inserted into a register --- src/core/compile.c | 49 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index 7551a5215..edffe41fa 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -260,6 +260,9 @@ void compiler_getmethodreturntype(compiler *c, value klass, value target, value value _closuretype; value _stringtype; +value _dicttype; +value _listtype; +value _rangetype; value _inttype; value _floattype; @@ -756,6 +759,10 @@ bool compiler_regsetcurrenttypeX(compiler *c, registerindx reg, value type) { return true; } +bool compiler_regcheckandsetcurrenttype(compiler *c, syntaxtreenode *node, registerindx reg, value type) { + return compiler_regsetcurrenttype(c, node, reg, type); +} + /** Performs a type check on register reg against a given type. Codeinfo is updated if a typecheck instruction needs to be generated */ bool compiler_regtypecheck(compiler *c, syntaxtreenode *node, registerindx reg, value type, codeinfo *info) { bool success=false; @@ -1060,7 +1067,7 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei out.dest=compiler_regtemp(c, reg); if (compiler_getconstanttype(c, info.dest, &type)) { - compiler_regsetcurrenttype(c, node, out.dest, type); + if (!compiler_regcheckandsetcurrenttype(c, node, out.dest, type)) return CODEINFO_EMPTY; } compiler_addinstruction(c, ENCODE_LONG(OP_LCT, out.dest, info.dest), node); @@ -1972,10 +1979,7 @@ static codeinfo compiler_list(compiler *c, syntaxtreenode *node, registerindx re if (node->type==NODE_TUPLE) classname = TUPLE_CLASSNAME; codeinfo out = compiler_findbuiltin(c, node, classname, reqout); - value listtype=MORPHO_NIL; /* Set the type associated with the register */ - if (compiler_findtypefromcstring(c, classname, &listtype)) { - if (!compiler_regsetcurrenttype(c, node, out.dest, listtype)) return CODEINFO_EMPTY; - } + if (!compiler_regcheckandsetcurrenttype(c, node, out.dest, _listtype)) return CODEINFO_EMPTY; varray_syntaxtreeindxinit(&entries); if (node->right!=SYNTAXTREE_UNCONNECTED) syntaxtree_flatten(compiler_getsyntaxtree(c), node->right, 1, dictentrytype, &entries); @@ -2015,10 +2019,7 @@ static codeinfo compiler_dictionary(compiler *c, syntaxtreenode *node, registeri /* Set up a call to the Dictionary() function */ codeinfo out = compiler_findbuiltin(c, node, DICTIONARY_CLASSNAME, reqout); - value dicttype=MORPHO_NIL; /* Set the type associated with the register */ - if (compiler_findtypefromcstring(c, DICTIONARY_CLASSNAME, &dicttype)) { - if (!compiler_regsetcurrenttype(c, node, out.dest, dicttype)) return CODEINFO_EMPTY; - } + if (!compiler_regcheckandsetcurrenttype(c, node, out.dest, _dicttype)) return CODEINFO_EMPTY; varray_syntaxtreeindxinit(&entries); /* Flatten all the child nodes; these end up as a sequence: key, val, key, val, ... */ @@ -2070,10 +2071,7 @@ static codeinfo compiler_range(compiler *c, syntaxtreenode *node, registerindx r /* Set up a call to the Range() function */ codeinfo rng = compiler_findbuiltin(c, node, (inclusive ? RANGE_INCLUSIVE_CONSTRUCTOR: RANGE_CLASSNAME), reqout); - value rngtype=MORPHO_NIL; /* Set the type associated with the register */ - if (compiler_findtypefromcstring(c, RANGE_CLASSNAME, &rngtype)) { - if (!compiler_regsetcurrenttype(c, node, rng.dest, rngtype)) return CODEINFO_EMPTY; - } + if (!compiler_regcheckandsetcurrenttype(c, node, rng.dest, _rangetype)) return CODEINFO_EMPTY; /* Construct the arguments */ unsigned int n; @@ -2215,7 +2213,7 @@ static codeinfo compiler_not(compiler *c, syntaxtreenode *node, registerindx req ninstructions+=left.ninstructions; } - compiler_regsetcurrenttype(c, node, out, _booltype); + if (!compiler_regcheckandsetcurrenttype(c, node, out, _booltype)) return CODEINFO_EMPTY; compiler_addinstruction(c, ENCODE_DOUBLE(OP_NOT, out, left.dest), node); ninstructions++; @@ -2337,10 +2335,10 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx value type = MORPHO_NIL; if (op<=OP_DIV) { // Arithmetic type compiler_arithmetictype(c, op, left.dest, right.dest, &type); - } else if (op==OP_POW) { // Powers always generate floats - compiler_findtypefromcstring(c, FLOAT_CLASSNAME, &type); + } else if (op==OP_POW) { // Powers always generate floats TODO: THIS IS NOT TRUE + type=_floattype; } else { // Comparison operations - compiler_findtypefromcstring(c, BOOL_CLASSNAME, &type); + type=_booltype; } compiler_releaseoperand(c, left); // Release operands after type information determined @@ -2491,7 +2489,7 @@ static codeinfo compiler_interpolation(compiler *c, syntaxtreenode *node, regist compiler_addinstruction(c, ENCODE(OP_CAT, rout, start, r), node); ninstructions++; - compiler_regsetcurrenttype(c, node, rout, _stringtype); + if (!compiler_regcheckandsetcurrenttype(c, node, rout, _stringtype)) return CODEINFO_EMPTY; /* Free all the registers used, including start if it wasn't the destination for the output */ if (start!=REGISTER_UNALLOCATED) compiler_regfreetoend(c, start + (reqout!=REGISTER_UNALLOCATED ? 0: 1)); @@ -4782,12 +4780,15 @@ void compile_initialize(void) { _selfsymbol=builtin_internsymbolascstring("self"); /** Types we need to refer to */ - _closuretype = MORPHO_OBJECT(object_getveneerclass(OBJECT_CLOSURE)); - _stringtype = MORPHO_OBJECT(object_getveneerclass(OBJECT_STRING)); - - _inttype = MORPHO_OBJECT(value_getveneerclass(MORPHO_INTEGER(0))); - _floattype = MORPHO_OBJECT(value_getveneerclass(MORPHO_FLOAT(0.0))); - _booltype = MORPHO_OBJECT(value_getveneerclass(MORPHO_TRUE)); + _closuretype = builtin_findclassfromcstring(CLOSURE_CLASSNAME); + _stringtype = builtin_findclassfromcstring(STRING_CLASSNAME); + _dicttype = builtin_findclassfromcstring(DICTIONARY_CLASSNAME); + _listtype = builtin_findclassfromcstring(LIST_CLASSNAME); + _rangetype = builtin_findclassfromcstring(RANGE_CLASSNAME); + + _inttype = builtin_findclassfromcstring(INT_CLASSNAME); + _floattype = builtin_findclassfromcstring(FLOAT_CLASSNAME); + _booltype = builtin_findclassfromcstring(BOOL_CLASSNAME); optimizer = NULL; From cc7bff047ab70af4d2b4e7405b5d502ed22543ec Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 6 Nov 2025 12:44:47 -0500 Subject: [PATCH 061/473] Typecheck on load from upvalue --- src/core/compile.c | 15 +++++++++------ test/types/type_from_upvalue_runtime.morpho | 15 +++++++++++++++ .../type_violation_upvalue_runtime.morpho | 14 ++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 test/types/type_from_upvalue_runtime.morpho create mode 100644 test/types/violations/type_violation_upvalue_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index edffe41fa..1669dde28 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -751,7 +751,7 @@ bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type) { return true; } -/** Sets the current type of a register. Raises a type violation error if this is not compatible with the required type */ +/** Sets the current type of a register. */ bool compiler_regsetcurrenttypeX(compiler *c, registerindx reg, value type) { functionstate *f = compiler_currentfunctionstate(c); if (reg>=f->registers.count) return false; @@ -1080,20 +1080,23 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei out.ninstructions++; if (compiler_getupvaluetype(c, info.dest, &type)) { - compiler_regsetcurrenttype(c, node, out.dest, type); + compiler_regsetcurrenttypeX(c, out.dest, type); + } + + if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid + compiler_regtypecheck(c, node, out.dest, type, &out); } } else if (CODEINFO_ISGLOBAL(info)) { /* Move globals */ out.dest=compiler_regtemp(c, reg); out.returntype=REGISTER; + compiler_addinstruction(c, ENCODE_LONG(OP_LGL, out.dest, info.dest), node); + out.ninstructions++; if (compiler_getglobaltype(c, info.dest, &type)) { compiler_regsetcurrenttypeX(c, out.dest, type); } - compiler_addinstruction(c, ENCODE_LONG(OP_LGL, out.dest, info.dest), node); - out.ninstructions++; - if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid compiler_regtypecheck(c, node, out.dest, type, &out); } @@ -2822,7 +2825,7 @@ static codeinfo compiler_for(compiler *c, syntaxtreenode *node, registerindx req compiler_addinstruction(c, ENCODE_LONG(OP_LCT, rIndx, cNil), node); ninstructions++; - compiler_regsetcurrenttype(c, node, rIndx, _inttype); + if (!compiler_regcheckandsetcurrenttype(c, node, rIndx, _inttype)) return CODEINFO_EMPTY; /* Obtain the maximum value of rIndx by invoking enumerate */ diff --git a/test/types/type_from_upvalue_runtime.morpho b/test/types/type_from_upvalue_runtime.morpho new file mode 100644 index 000000000..4e9384e21 --- /dev/null +++ b/test/types/type_from_upvalue_runtime.morpho @@ -0,0 +1,15 @@ +// Retrieve type from upvalue with typecheck + +fn f(x) { + var y = x + + fn g() { + Int z = y + return z + } + + return g +} + +print f(1)() // expect: 1 +print f(2)() // expect: 2 diff --git a/test/types/violations/type_violation_upvalue_runtime.morpho b/test/types/violations/type_violation_upvalue_runtime.morpho new file mode 100644 index 000000000..da7109ae9 --- /dev/null +++ b/test/types/violations/type_violation_upvalue_runtime.morpho @@ -0,0 +1,14 @@ +// Retrieve type from upvalue with typecheck + +fn f(x) { + var y = x + + fn g() { + Int z = y + return z + } + + return g +} + +print f(1.5)() // expect error 'TypeChk' From 1fbc4aa6569c1115a4940208d3a0ae7d00a07276 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 10 Nov 2025 11:39:43 -0500 Subject: [PATCH 062/473] Dynamic typechecking of assignment to globals --- src/core/compile.c | 63 ++++++++++++++---------- src/core/vm.c | 5 +- test/types/type_from_indexed.morpho | 7 +++ test/types/type_to_global_runtime.morpho | 9 ++++ 4 files changed, 57 insertions(+), 27 deletions(-) create mode 100644 test/types/type_from_indexed.morpho create mode 100644 test/types/type_to_global_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 1669dde28..0637b1e23 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -716,6 +716,12 @@ bool compiler_regtype(compiler *c, registerindx reg, value *type) { return compiler_regtypefromfunctionstate(f, reg, type); } +/** Gets the current type of a register */ +bool compiler_regsymbol(compiler *c, registerindx reg, value *symbol) { + functionstate *f = compiler_currentfunctionstate(c); + return compiler_regsymbolfromfunctionstate(f, reg, symbol); +} + /** Raises a type violation error */ void compiler_typeviolation(compiler *c, syntaxtreenode *node, value type, value badtype, value symbol) { char *tname="(unknown)", *bname="(unknown)"; @@ -764,7 +770,7 @@ bool compiler_regcheckandsetcurrenttype(compiler *c, syntaxtreenode *node, regis } /** Performs a type check on register reg against a given type. Codeinfo is updated if a typecheck instruction needs to be generated */ -bool compiler_regtypecheck(compiler *c, syntaxtreenode *node, registerindx reg, value type, codeinfo *info) { +bool compiler_regtypecheck(compiler *c, syntaxtreenode *node, registerindx reg, value type, value symbol, codeinfo *info) { bool success=false; functionstate *f = compiler_currentfunctionstate(c); @@ -781,7 +787,7 @@ bool compiler_regtypecheck(compiler *c, syntaxtreenode *node, registerindx reg, } else if (compiler_checktype(c, type, rtype)) { // Successful type check success=true; } else { // Type is incompatible - compiler_typeviolation(c, node, type, rtype, f->registers.data[reg].symbol); + compiler_typeviolation(c, node, type, rtype, symbol); } return success; @@ -1048,7 +1054,9 @@ static registerindx compiler_getlocal(compiler *c, value symbol) { }*/ bool compiler_getglobaltype(compiler *c, globalindx indx, value *type); +bool compiler_getglobalsymbol(compiler *c, globalindx indx, value *symbol); bool compiler_getupvaluetype(compiler *c, registerindx ix, value *type); +bool compiler_getupvaluesymbol(compiler *c, registerindx ix, value *symbol); /** @brief Moves the results of a codeinfo block into a register * @details includes constants, upvalues etc. @@ -1058,7 +1066,7 @@ bool compiler_getupvaluetype(compiler *c, registerindx ix, value *type); * @param reg destination register, or REGISTER_UNALLOCATED to allocate a new one * @returns Number of instructions generated */ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codeinfo info, registerindx reg) { - value type = MORPHO_NIL; + value type = MORPHO_NIL, symbol = MORPHO_NIL; codeinfo out = info; out.ninstructions=0; @@ -1084,7 +1092,8 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei } if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid - compiler_regtypecheck(c, node, out.dest, type, &out); + compiler_getupvaluesymbol(c, info.dest, &symbol); + compiler_regtypecheck(c, node, out.dest, type, symbol, &out); } } else if (CODEINFO_ISGLOBAL(info)) { /* Move globals */ @@ -1098,7 +1107,8 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei } if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid - compiler_regtypecheck(c, node, out.dest, type, &out); + compiler_getglobalsymbol(c, info.dest, &symbol); + compiler_regtypecheck(c, node, out.dest, type, symbol, &out); } } else { /* Move between registers */ @@ -1110,7 +1120,8 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei if (out.dest!=info.dest) { if (compiler_regtype(c, out.dest, &type) && - compiler_regtypecheck(c, node, info.dest, type, &out) && + compiler_regsymbol(c, out.dest, &symbol) && + compiler_regtypecheck(c, node, info.dest, type, symbol, &out) && compiler_regcurrenttype(c, info.dest, &type)) { compiler_regsetcurrenttypeX(c, out.dest, type); // TODO: Should we instead set the type to the known result of the typecheck? } @@ -1238,20 +1249,9 @@ bool compiler_getglobaltype(compiler *c, globalindx indx, value *type) { return program_globaltype(c->out, indx, type); } -/** Checks if the type match satisfies the type of the global variable indx */ -bool compiler_checkglobaltype(compiler *c, syntaxtreenode *node, globalindx indx, value match) { - value type=MORPHO_NIL; - if (!program_globaltype(c->out, indx, &type)) return false; - - bool success=compiler_checktype(c, type, match); - - if (!success) { - value symbol=MORPHO_NIL; - program_globalsymbol(c->out, indx, &symbol); - compiler_typeviolation(c, node, type, match, symbol); - } - - return success; +/** Gets the type of a global variable */ +bool compiler_getglobalsymbol(compiler *c, globalindx indx, value *symbol) { + return program_globalsymbol(c->out, indx, symbol); } /** Shows all currently allocated globals */ @@ -1284,9 +1284,10 @@ codeinfo compiler_movetoglobal(compiler *c, syntaxtreenode *node, codeinfo in, g tmp=true; } - value type=MORPHO_NIL; - if (compiler_regcurrenttype(c, use.dest, &type)) { - if (!compiler_checkglobaltype(c, node, slot, type)) goto compiler_movetoglobal_cleanup; + value type=MORPHO_NIL, symbol=MORPHO_NIL; + if (compiler_getglobaltype(c, slot, &type)) { + compiler_getglobalsymbol(c, slot, &symbol); + if (!compiler_regtypecheck(c, node, use.dest, type, symbol, &out)) goto compiler_movetoglobal_cleanup; } compiler_addinstruction(c, ENCODE_LONG(OP_SGL, use.dest, slot) , node); @@ -2147,21 +2148,31 @@ static codeinfo compiler_index(compiler *c, syntaxtreenode *node, registerindx r if (compiler_haserror(c)) return CODEINFO_EMPTY; ninstructions+=out.ninstructions; + /* Destination register */ + codeinfo iout = CODEINFO(REGISTER, start, ninstructions); + /* Compile instruction */ compiler_addinstruction(c, ENCODE(OP_LIX, left.dest, start, end), node); ninstructions++; + // Update type information + compiler_regsetcurrenttypeX(c, start, MORPHO_NIL); // Result of LIX is always unknown type + value type; + if (compiler_regtype(c, start, &type)) { + value symbol=MORPHO_NIL; + compiler_regsymbol(c, start, &symbol); + compiler_regtypecheck(c, node, start, type, symbol, &iout); + } + /* Free anything we're done with */ compiler_releaseoperand(c, left); compiler_regfreetoend(c, start+1); - codeinfo iout = CODEINFO(REGISTER, start, ninstructions); - if (reqout>=0 && start!=reqout) { - compiler_regfreetemp(c, start); iout = compiler_movetoregister(c, node, iout, reqout); ninstructions+=iout.ninstructions; + compiler_regfreetemp(c, start); } iout.ninstructions=ninstructions; diff --git a/src/core/vm.c b/src/core/vm.c index 7ab6d46a6..14abc25a8 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -1504,9 +1504,12 @@ bool morpho_interpret(vm *v, value *rstart, instructionindx istart) { if (!vm_typecheck(v, reg[a], v->konst[b])) { value type; value_type(reg[a], &type); + char *typename = MORPHO_NILSTRING; + if (MORPHO_ISCLASS(type)) typename = MORPHO_GETCSTRING(MORPHO_GETCLASS(type)->name); + VERROR(VM_TYPECHK, - MORPHO_GETCSTRING(MORPHO_GETCLASS(type)->name), + typename, MORPHO_GETCSTRING(MORPHO_GETCLASS(v->konst[b])->name)); } diff --git a/test/types/type_from_indexed.morpho b/test/types/type_from_indexed.morpho new file mode 100644 index 000000000..c6d1b7ecd --- /dev/null +++ b/test/types/type_from_indexed.morpho @@ -0,0 +1,7 @@ +// Retrieve from index with typecheck + +var a = [1,2,3] + +Int b = a[0] + +print b // expect: 1 diff --git a/test/types/type_to_global_runtime.morpho b/test/types/type_to_global_runtime.morpho new file mode 100644 index 000000000..e17d11a6c --- /dev/null +++ b/test/types/type_to_global_runtime.morpho @@ -0,0 +1,9 @@ +// Store to upvalue + +fn f(x,y) { + return x + y +} + +Int a = f(1,2) + +print a // expect: 3 From 7d731775e40bff00bbc924235174cd8f4c647c78 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 10 Nov 2025 11:55:48 -0500 Subject: [PATCH 063/473] Test violation in assigning to global --- .../type_violation_to_global_runtime.morpho | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/types/violations/type_violation_to_global_runtime.morpho diff --git a/test/types/violations/type_violation_to_global_runtime.morpho b/test/types/violations/type_violation_to_global_runtime.morpho new file mode 100644 index 000000000..16315a982 --- /dev/null +++ b/test/types/violations/type_violation_to_global_runtime.morpho @@ -0,0 +1,11 @@ +// Runtime typecheck + +fn foo(x, y) { + return x + y +} + +var a = foo(1.5,2) + +Int b = a + +// expect error 'TypeChk' \ No newline at end of file From 1185953cdb1ac959983bc6dc841f26897dc36722 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 10 Nov 2025 12:53:13 -0500 Subject: [PATCH 064/473] Dynamic typecheck for arithmetic --- src/core/compile.c | 15 +++++++++++---- test/types/type_arithmetic_runtime.morpho | 13 +++++++++++++ .../type_violation_arithmetic_runtime.morpho | 11 +++++++++++ 3 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 test/types/type_arithmetic_runtime.morpho create mode 100644 test/types/violations/type_violation_arithmetic_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 0637b1e23..76a5c7303 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -2309,7 +2309,7 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx ninstructions+=right.ninstructions; } - registerindx out = compiler_regtemp(c, reqout); + registerindx rout = compiler_regtemp(c, reqout); opcode op=OP_NOP; @@ -2341,7 +2341,7 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx if (compiler_haserror(c)) return CODEINFO_EMPTY; - compiler_addinstruction(c, ENCODE(op, out, left.dest, right.dest), node); + compiler_addinstruction(c, ENCODE(op, rout, left.dest, right.dest), node); ninstructions++; /* Set the output type of the operation */ @@ -2358,9 +2358,16 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx compiler_releaseoperand(c, left); // Release operands after type information determined compiler_releaseoperand(c, right); - if (!compiler_regsetcurrenttype(c, node, out, type)) return CODEINFO_EMPTY; + codeinfo out = CODEINFO(REGISTER, rout, ninstructions); + + value rtype=MORPHO_NIL, symbol = MORPHO_NIL; + if (compiler_regtype(c, rout, &rtype) && + compiler_regsymbol(c, rout, &symbol)) { + compiler_regsetcurrenttypeX(c, rout, type); + compiler_regtypecheck(c, node, rout, rtype, symbol, &out); + } - return CODEINFO(REGISTER, out, ninstructions); + return out; } /** @brief Compiles the ternary operator diff --git a/test/types/type_arithmetic_runtime.morpho b/test/types/type_arithmetic_runtime.morpho new file mode 100644 index 000000000..7df78bded --- /dev/null +++ b/test/types/type_arithmetic_runtime.morpho @@ -0,0 +1,13 @@ +// Runtime typecheck + +fn f(x) { + return x +} + +{ + Int b = 1 + f(1) + + print b +} + +// expect: 2 diff --git a/test/types/violations/type_violation_arithmetic_runtime.morpho b/test/types/violations/type_violation_arithmetic_runtime.morpho new file mode 100644 index 000000000..95f41382d --- /dev/null +++ b/test/types/violations/type_violation_arithmetic_runtime.morpho @@ -0,0 +1,11 @@ +// Runtime typecheck + +fn f(x) { + return x +} + +{ + Int b = 1 + f(1.5) +} + +// expect error 'TypeChk' From b16d2bd1886d732c8316277bcf5eba660ece2e0e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 10 Nov 2025 16:35:30 -0500 Subject: [PATCH 065/473] Call and invoke set return type --- src/core/compile.c | 11 ++++++----- .../violations/type_violation_call_runtime.morpho | 8 ++++++++ .../violations/type_violation_invoke_runtime.morpho | 11 +++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 test/types/violations/type_violation_call_runtime.morpho create mode 100644 test/types/violations/type_violation_invoke_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 76a5c7303..28608459a 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3303,7 +3303,7 @@ static registerindx compiler_functionparameters(compiler *c, syntaxtreeindx indx registerindx reg = compiler_functionparameters(c, node->right); compiler_regsettype(c, reg, type); - compiler_regsetcurrenttype(c, node, reg, type); + compiler_regsetcurrenttypeX(c, reg, type); } break; case NODE_ASSIGN: @@ -3455,7 +3455,7 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind // Save the register where the closure is to be found compiler_regsetsymbol(c, reg, func->name); compiler_regsettype(c, reg, _closuretype); - compiler_regsetcurrenttype(c, node, reg, _closuretype); + compiler_regsetcurrenttypeX(c, reg, _closuretype); function_setclosure(func, reg); compiler_addinstruction(c, ENCODE_DOUBLE(OP_CLOSURE, reg, (registerindx) closure), node); ninstructions++; @@ -3656,8 +3656,9 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re /* Free all the registers used for the call */ compiler_regfreetoend(c, func.dest+1); - /* Set the current type of the register */ - compiler_regsetcurrenttype(c, selnode, func.dest, rtype); + /* Set the current type of the destination register */ + compiler_regsetcurrenttypeX(c, func.dest, rtype); + // TODO: Should we do a typecheck here or leave it to the movetoregister below? /* Move the result to the requested register */ if (reqout!=REGISTER_UNALLOCATED && func.dest!=reqout) { @@ -3772,7 +3773,7 @@ static codeinfo compiler_invoke(compiler *c, syntaxtreenode *node, registerindx compiler_regfreetoend(c, rObj+1); /* Set the current type of the register */ - compiler_regsetcurrenttype(c, node, rObj, rtype); + compiler_regsetcurrenttypeX(c, rObj, rtype); // Move the result to the requested register if (reqout!=REGISTER_UNALLOCATED && object.dest!=reqout) { diff --git a/test/types/violations/type_violation_call_runtime.morpho b/test/types/violations/type_violation_call_runtime.morpho new file mode 100644 index 000000000..fed0e1fe6 --- /dev/null +++ b/test/types/violations/type_violation_call_runtime.morpho @@ -0,0 +1,8 @@ +// Assign result of a function to a type protected variable + +fn idem(x) { return x } + +{ + Int a = idem(1.2) +} +// expect error 'TypeChk' diff --git a/test/types/violations/type_violation_invoke_runtime.morpho b/test/types/violations/type_violation_invoke_runtime.morpho new file mode 100644 index 000000000..110216ae1 --- /dev/null +++ b/test/types/violations/type_violation_invoke_runtime.morpho @@ -0,0 +1,11 @@ +// Assign result of a function to a type protected variable + +class A { + foo(x) { return x } +} + +{ + var a = A() + Int b = a.foo(1.2) +} +// expect error 'TypeChk' From 2117a787812beafe48feb49b9c0c726e8934dc7a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 10 Nov 2025 16:39:20 -0500 Subject: [PATCH 066/473] Runtime type checking completed --- src/core/compile.c | 48 +++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index 28608459a..b9a549d60 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -734,21 +734,6 @@ void compiler_typeviolation(compiler *c, syntaxtreenode *node, value type, value compiler_error(c, node, COMPILE_TYPEVIOLATION, bname, tname, sym); } -/** Sets the current type of a register. Raises a type violation error if this is not compatible with the required type */ -bool compiler_regsetcurrenttype(compiler *c, syntaxtreenode *node, registerindx reg, value type) { - functionstate *f = compiler_currentfunctionstate(c); - if (reg>=f->registers.count) return false; - - if (compiler_checktype(c, f->registers.data[reg].type, type)) { - f->registers.data[reg].currenttype=type; - return true; - } - - compiler_typeviolation(c, node, f->registers.data[reg].type, type, f->registers.data[reg].symbol); - - return false; -} - /** Gets the current type of a register */ bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type) { functionstate *f = compiler_currentfunctionstate(c); @@ -758,15 +743,26 @@ bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type) { } /** Sets the current type of a register. */ -bool compiler_regsetcurrenttypeX(compiler *c, registerindx reg, value type) { +bool compiler_regsetcurrenttype(compiler *c, registerindx reg, value type) { functionstate *f = compiler_currentfunctionstate(c); if (reg>=f->registers.count) return false; f->registers.data[reg].currenttype=type; return true; } +/** Tests if assigning a value of given type to a register is acceptable. If so, the type of the register is set; if not a type violation is raised */ bool compiler_regcheckandsetcurrenttype(compiler *c, syntaxtreenode *node, registerindx reg, value type) { - return compiler_regsetcurrenttype(c, node, reg, type); + functionstate *f = compiler_currentfunctionstate(c); + if (reg>=f->registers.count) return false; + + if (compiler_checktype(c, f->registers.data[reg].type, type)) { + f->registers.data[reg].currenttype=type; + return true; + } + + compiler_typeviolation(c, node, f->registers.data[reg].type, type, f->registers.data[reg].symbol); + + return false; } /** Performs a type check on register reg against a given type. Codeinfo is updated if a typecheck instruction needs to be generated */ @@ -1088,7 +1084,7 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei out.ninstructions++; if (compiler_getupvaluetype(c, info.dest, &type)) { - compiler_regsetcurrenttypeX(c, out.dest, type); + compiler_regsetcurrenttype(c, out.dest, type); } if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid @@ -1103,7 +1099,7 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei out.ninstructions++; if (compiler_getglobaltype(c, info.dest, &type)) { - compiler_regsetcurrenttypeX(c, out.dest, type); + compiler_regsetcurrenttype(c, out.dest, type); } if (compiler_regtype(c, out.dest, &type)) { // Check that the value loaded is valid @@ -1123,7 +1119,7 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei compiler_regsymbol(c, out.dest, &symbol) && compiler_regtypecheck(c, node, info.dest, type, symbol, &out) && compiler_regcurrenttype(c, info.dest, &type)) { - compiler_regsetcurrenttypeX(c, out.dest, type); // TODO: Should we instead set the type to the known result of the typecheck? + compiler_regsetcurrenttype(c, out.dest, type); // TODO: Should we instead set the type to the known result of the typecheck? } compiler_addinstruction(c, ENCODE_DOUBLE(OP_MOV, out.dest, info.dest), node); @@ -2156,7 +2152,7 @@ static codeinfo compiler_index(compiler *c, syntaxtreenode *node, registerindx r ninstructions++; // Update type information - compiler_regsetcurrenttypeX(c, start, MORPHO_NIL); // Result of LIX is always unknown type + compiler_regsetcurrenttype(c, start, MORPHO_NIL); // Result of LIX is always unknown type value type; if (compiler_regtype(c, start, &type)) { value symbol=MORPHO_NIL; @@ -2363,7 +2359,7 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx value rtype=MORPHO_NIL, symbol = MORPHO_NIL; if (compiler_regtype(c, rout, &rtype) && compiler_regsymbol(c, rout, &symbol)) { - compiler_regsetcurrenttypeX(c, rout, type); + compiler_regsetcurrenttype(c, rout, type); compiler_regtypecheck(c, node, rout, rtype, symbol, &out); } @@ -3303,7 +3299,7 @@ static registerindx compiler_functionparameters(compiler *c, syntaxtreeindx indx registerindx reg = compiler_functionparameters(c, node->right); compiler_regsettype(c, reg, type); - compiler_regsetcurrenttypeX(c, reg, type); + compiler_regsetcurrenttype(c, reg, type); } break; case NODE_ASSIGN: @@ -3455,7 +3451,7 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind // Save the register where the closure is to be found compiler_regsetsymbol(c, reg, func->name); compiler_regsettype(c, reg, _closuretype); - compiler_regsetcurrenttypeX(c, reg, _closuretype); + compiler_regsetcurrenttype(c, reg, _closuretype); function_setclosure(func, reg); compiler_addinstruction(c, ENCODE_DOUBLE(OP_CLOSURE, reg, (registerindx) closure), node); ninstructions++; @@ -3657,7 +3653,7 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re compiler_regfreetoend(c, func.dest+1); /* Set the current type of the destination register */ - compiler_regsetcurrenttypeX(c, func.dest, rtype); + compiler_regsetcurrenttype(c, func.dest, rtype); // TODO: Should we do a typecheck here or leave it to the movetoregister below? /* Move the result to the requested register */ @@ -3773,7 +3769,7 @@ static codeinfo compiler_invoke(compiler *c, syntaxtreenode *node, registerindx compiler_regfreetoend(c, rObj+1); /* Set the current type of the register */ - compiler_regsetcurrenttypeX(c, rObj, rtype); + compiler_regsetcurrenttype(c, rObj, rtype); // Move the result to the requested register if (reqout!=REGISTER_UNALLOCATED && object.dest!=reqout) { From 9eb56ad609d90ae6740165745d68b9a10ba3b25e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 10 Nov 2025 18:37:56 -0500 Subject: [PATCH 067/473] Typecheck for LPR --- src/core/compile.c | 19 ++++++++++++++----- .../violations/type_violation_property.morpho | 8 ++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 test/types/violations/type_violation_property.morpho diff --git a/src/core/compile.c b/src/core/compile.c index b9a549d60..407e53ddd 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -4280,7 +4280,7 @@ static codeinfo compiler_assign(compiler *c, syntaxtreenode *node, registerindx /* Compiles property lookup */ static codeinfo compiler_property(compiler *c, syntaxtreenode *node, registerindx reqout) { codeinfo left = CODEINFO_EMPTY, prop = CODEINFO_EMPTY; - registerindx out = compiler_regtemp(c, reqout); + registerindx rout = compiler_regtemp(c, reqout); /* The left hand side should evaluate to the object in question */ left = compiler_nodetobytecode(c, node->left, REGISTER_UNALLOCATED); @@ -4301,14 +4301,23 @@ static codeinfo compiler_property(compiler *c, syntaxtreenode *node, registerind compiler_error(c, selector, COMPILE_PROPERTYNAMERQD); } - if (out !=REGISTER_UNALLOCATED) { - compiler_addinstruction(c, ENCODE(OP_LPR, out, left.dest, prop.dest), node); - ninstructions++; + codeinfo out=CODEINFO(REGISTER, rout, ninstructions); + + if (rout!=REGISTER_UNALLOCATED) { + compiler_addinstruction(c, ENCODE(OP_LPR, rout, left.dest, prop.dest), node); + out.ninstructions++; + + value type=MORPHO_NIL, symbol=MORPHO_NIL; + if (compiler_regtype(c, rout, &type) && + compiler_regsymbol(c, rout, &symbol)) { + compiler_regtypecheck(c, node, rout, type, symbol, &out); + } + compiler_releaseoperand(c, left); if (CODEINFO_ISREGISTER(prop)) compiler_releaseoperand(c, prop); } - return CODEINFO(REGISTER, out, ninstructions); + return out; } /** Compiles the dot operator, which may be property lookup or a method call */ diff --git a/test/types/violations/type_violation_property.morpho b/test/types/violations/type_violation_property.morpho new file mode 100644 index 000000000..df23e6c6c --- /dev/null +++ b/test/types/violations/type_violation_property.morpho @@ -0,0 +1,8 @@ + +var a = Object() +a.a = 1.5 + +{ + Int b = a.a +} +// expect error 'TypeChk' From 25f8c49dea6af60a93e5b05a164480363478cb59 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 11:30:01 -0500 Subject: [PATCH 068/473] Nil class to provide a veneer type --- src/builtin/builtin.c | 1 + src/classes/CMakeLists.txt | 2 ++ src/classes/classes.h | 1 + src/classes/nil.c | 26 ++++++++++++++++++++++++++ src/classes/nil.h | 26 ++++++++++++++++++++++++++ src/core/compile.c | 2 ++ src/core/vm.c | 8 ++++---- 7 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 src/classes/nil.c create mode 100644 src/classes/nil.h diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 822e45fd8..e965637d1 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -433,6 +433,7 @@ void builtin_initialize(void) { float_initialize(); // Veneer classes int_initialize(); bool_initialize(); + nil_initialize(); string_initialize(); // Classes function_initialize(); diff --git a/src/classes/CMakeLists.txt b/src/classes/CMakeLists.txt index af5764d31..376453ea4 100644 --- a/src/classes/CMakeLists.txt +++ b/src/classes/CMakeLists.txt @@ -18,6 +18,7 @@ target_sources(morpho json.c json.h list.c list.h metafunction.c metafunction.h + nil.c nil.h range.c range.h strng.c strng.h system.c system.h @@ -47,6 +48,7 @@ target_sources(morpho json.h list.h metafunction.h + nil.h range.h strng.h system.h diff --git a/src/classes/classes.h b/src/classes/classes.h index 2a19438a2..91b2994af 100644 --- a/src/classes/classes.h +++ b/src/classes/classes.h @@ -29,6 +29,7 @@ #include "bool.h" #include "flt.h" #include "int.h" +#include "nil.h" //#include "file.h" //#include "system.h" diff --git a/src/classes/nil.c b/src/classes/nil.c new file mode 100644 index 000000000..07c35d440 --- /dev/null +++ b/src/classes/nil.c @@ -0,0 +1,26 @@ +/** @file nil.c + * @author T J Atherton + * + * @brief Veneer class for float values + */ + +#include "morpho.h" +#include "classes.h" + +/* ********************************************************************** + * Float veneer class + * ********************************************************************** */ + +MORPHO_BEGINCLASS(Nil) +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS + +/* ********************************************************************** + * Initialization and finalization + * ********************************************************************** */ + +void nil_initialize(void) { + // Create Nil veneer class + value nilclass=builtin_addclass(NIL_CLASSNAME, MORPHO_GETCLASSDEFINITION(Nil), MORPHO_NIL); + value_setveneerclass(MORPHO_NIL, nilclass); +} diff --git a/src/classes/nil.h b/src/classes/nil.h new file mode 100644 index 000000000..f59ad442b --- /dev/null +++ b/src/classes/nil.h @@ -0,0 +1,26 @@ +/** @file nil.h + * @author T J Atherton + * + * @brief Veneer class for nil values + */ + +#ifndef nil_h +#define nil_h + +/* ------------------------------------------------------- + * Nil veneer class + * ------------------------------------------------------- */ + +#define NIL_CLASSNAME "Nil" + +/* ------------------------------------------------------- + * Nil error messages + * ------------------------------------------------------- */ + +/* ------------------------------------------------------- + * Nil interface + * ------------------------------------------------------- */ + +void nil_initialize(void); + +#endif diff --git a/src/core/compile.c b/src/core/compile.c index 407e53ddd..d4aa035ee 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -267,6 +267,7 @@ value _rangetype; value _inttype; value _floattype; value _booltype; +value _niltype; /* ------------------------------------------ * Argument declarations @@ -4816,6 +4817,7 @@ void compile_initialize(void) { _inttype = builtin_findclassfromcstring(INT_CLASSNAME); _floattype = builtin_findclassfromcstring(FLOAT_CLASSNAME); _booltype = builtin_findclassfromcstring(BOOL_CLASSNAME); + _niltype = builtin_findclassfromcstring(NIL_CLASSNAME); optimizer = NULL; diff --git a/src/core/vm.c b/src/core/vm.c index 14abc25a8..915fcf473 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -1181,9 +1181,9 @@ bool morpho_interpret(vm *v, value *rstart, instructionindx istart) { } } else { /* Check if the operand has a veneer class */ - objectclass *klass; + objectclass *klass=NULL; if (MORPHO_ISOBJECT(left)) klass = object_getveneerclass(MORPHO_GETOBJECTTYPE(left)); - else klass = value_getveneerclass(left); + else if (!MORPHO_ISNIL(left)) klass = value_getveneerclass(left); if (klass) { value ifunc; @@ -1361,9 +1361,9 @@ bool morpho_interpret(vm *v, value *rstart, instructionindx istart) { } } else { /* Check for veneer class */ - objectclass *klass; + objectclass *klass=NULL; if (MORPHO_ISOBJECT(left)) klass = object_getveneerclass(MORPHO_GETOBJECTTYPE(left)); - else klass = value_getveneerclass(left); + else if (!MORPHO_ISNIL(left)) klass = value_getveneerclass(left); if (klass) { value ifunc; From a0a990fe69c645c1f43754e564a5fbfed8b93040 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 17:16:57 -0500 Subject: [PATCH 069/473] Set return types correctly by checking for control flow --- src/core/compile.c | 86 ++++++++++++++++++++++++++++++++++++++++------ src/core/compile.h | 2 ++ 2 files changed, 77 insertions(+), 11 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index d4aa035ee..209c1bceb 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -109,7 +109,9 @@ static void compiler_functionstateinit(functionstate *state) { state->func=NULL; state->scopedepth=0; state->loopdepth=0; + state->cfdepth=0; state->inargs=false; + state->hasreturn=false; state->nreg=0; state->type=FUNCTION; state->varg=REGISTER_UNALLOCATED; @@ -222,16 +224,32 @@ objectfunction *compiler_getpreviousfunction(compiler *c) { return c->prevfunction; } +/** Sets the 'hasreturn' flag for the current function state */ +void compiler_sethasreturn(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + f->hasreturn=true; +} + +/** Retrieves the 'hasreturn' flag for the current function state */ +bool compiler_hasreturn(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + return f->hasreturn; +} + bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type); /** Sets the return type of a function */ -void compiler_setreturntypefromregister(compiler *c, registerindx ix) { +void compiler_setreturntype(compiler *c, value type) { objectfunction *func = compiler_getcurrentfunction(c); + if (MORPHO_ISOBJECT(type)) signature_setreturntype(&func->sig, type); // TODO: Should check for current type +} + +/** Sets the return type of a function from the contents of a given register */ +void compiler_setreturntypefromregister(compiler *c, registerindx ix) { value type=MORPHO_NIL; compiler_regcurrenttype(c, ix, &type); - - if (MORPHO_ISOBJECT(type)) signature_setreturntype(&func->sig, type); // TODO: Should check for current type + compiler_setreturntype(c, type); } /** Infer the return type of a call target */ @@ -411,6 +429,28 @@ static value compiler_getmodule(compiler *c) { return c->currentmodule; } +/* ------------------------------------------ + * Control flow statements + * ------------------------------------------- */ + + /** Begin a control flow statement */ + static void compiler_begincontrolflow(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + f->cfdepth++; + } + + /** End a control flow statement */ + static void compiler_endcontrolflow(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + f->cfdepth--; + } + + /** Check if we are in a control flow statement */ + static bool compiler_incontrolflow(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + return (f->cfdepth>0); + } + /* ------------------------------------------ * Loops * ------------------------------------------- */ @@ -446,12 +486,14 @@ static void compiler_fixloop(compiler *c, instructionindx start, instructionindx /** Begin a loop */ static void compiler_beginloop(compiler *c) { + compiler_begincontrolflow(c); functionstate *f = compiler_currentfunctionstate(c); f->loopdepth++; } /** End a loop */ static void compiler_endloop(compiler *c) { + compiler_endcontrolflow(c); functionstate *f = compiler_currentfunctionstate(c); f->loopdepth--; } @@ -461,7 +503,7 @@ static bool compiler_inloop(compiler *c) { functionstate *f = compiler_currentfunctionstate(c); return (f->loopdepth>0); } - + /* ------------------------------------------ * Constants * ------------------------------------------- */ @@ -2633,6 +2675,8 @@ static codeinfo compiler_if(compiler *c, syntaxtreenode *node, registerindx reqo ifindx=compiler_addinstruction(c, ENCODE_BYTE(OP_NOP), node); ninstructions++; + compiler_begincontrolflow(c); + if (right->type==NODE_THEN) { /* If the right node is a THEN node, the then/else statements are located off it. */ if (!unreachable) { @@ -2656,6 +2700,8 @@ static codeinfo compiler_if(compiler *c, syntaxtreenode *node, registerindx reqo ninstructions+=then.ninstructions; } + compiler_endcontrolflow(c); + /* Now generate the conditional branch over the then clause */ compiler_setinstruction(c, ifindx, ENCODE_LONG(OP_BIFF, cond.dest, then.ninstructions+nextra)); @@ -3030,8 +3076,10 @@ static codeinfo compiler_try(compiler *c, syntaxtreenode *node, registerindx req compiler_addinstruction(c, ENCODE_LONG(OP_PUSHERR, 0, cdictindx), node); out.ninstructions++; + compiler_begincontrolflow(c); + debugannotation_pusherr(&c->out->annotations, cdict); - + /* Compile the body */ if (node->left!=SYNTAXTREE_UNCONNECTED) { codeinfo body = compiler_nodetobytecode(c, node->left, REGISTER_UNALLOCATED); @@ -3100,6 +3148,8 @@ static codeinfo compiler_try(compiler *c, syntaxtreenode *node, registerindx req varray_syntaxtreeindxclear(&labelnodes); debugannotation_poperr(&c->out->annotations); + + compiler_endcontrolflow(c); return out; } @@ -3403,12 +3453,16 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind ninstructions+=bodyinfo.ninstructions; /* Add a return instruction if necessary */ - if (ismethod) { // Methods automatically return self unless another argument is specified - compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, 0), node); /* Add a return */ - } else { - compiler_addinstruction(c, ENCODE_BYTE(OP_RETURN), node); /* Add a return */ + if (!compiler_hasreturn(c)) { + if (ismethod) { // Methods automatically return self unless another argument is specified + if (func->klass) compiler_setreturntype(c, MORPHO_OBJECT(func->klass)); + compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, 0), node); /* Add a return */ + } else { + compiler_setreturntype(c, _niltype); + compiler_addinstruction(c, ENCODE_BYTE(OP_RETURN), node); /* Add a return */ + } + ninstructions++; } - ninstructions++; /* Verify if we have any outstanding forward references */ compiler_checkoutstandingforwardreference(c); @@ -3809,15 +3863,25 @@ static codeinfo compiler_return(compiler *c, syntaxtreenode *node, registerindx } compiler_releaseoperand(c, left); } else { + objectclass *klass = compiler_getcurrentclass(c); /* Methods return self unless a return value is specified */ - if (compiler_getcurrentclass(c)) { + if (klass) { + compiler_setreturntype(c, MORPHO_OBJECT(klass)); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, 0), node); /* Add a return */ } else { + compiler_setreturntype(c, _niltype); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 0, 0), node); } ninstructions++; } + /* If we generated a return instruction and we are not in a control flow statement, + set the unconditional return flag */ + if (ninstructions>0 && + !compiler_incontrolflow(c)) { + compiler_sethasreturn(c); + } + return CODEINFO(REGISTER, REGISTER_UNALLOCATED, ninstructions); } diff --git a/src/core/compile.h b/src/core/compile.h index 59eeead41..2cecd4d18 100644 --- a/src/core/compile.h +++ b/src/core/compile.h @@ -245,7 +245,9 @@ typedef struct { unsigned int nreg; /* Largest number of registers used */ unsigned int scopedepth; unsigned int loopdepth; /* Count number of nesting depths of a loop */ + unsigned int cfdepth; /* Count depth inside control flow; allows us to identify where returns are */ bool inargs; /* Set while compiling function calls to ensure allocations are at the top of the stack */ + bool hasreturn; /* Set if the compiling function has an unconditional return */ //unsigned int nposn; /* Number of positional args recorded in latest call */ //unsigned int nopt; /* Number of optional args recorded in latest call */ } functionstate; From 00c46129bb1ba2f5dc4c9e0dacff265aa91b5ac6 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 17:18:31 -0500 Subject: [PATCH 070/473] Lower case veneer class name for nil --- src/classes/nil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/nil.h b/src/classes/nil.h index f59ad442b..d75328473 100644 --- a/src/classes/nil.h +++ b/src/classes/nil.h @@ -11,7 +11,7 @@ * Nil veneer class * ------------------------------------------------------- */ -#define NIL_CLASSNAME "Nil" +#define NIL_CLASSNAME "nil" /* ------------------------------------------------------- * Nil error messages From de2b2c97048b8f129b975a95f6ca166743c3fa57 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 17:56:37 -0500 Subject: [PATCH 071/473] Multiple return types yields dynamic typecheck --- src/core/compile.c | 50 +++++++++++++++---- src/core/compile.h | 1 + .../type_multiple_return_types_runtime.morpho | 13 +++++ 3 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 test/types/type_multiple_return_types_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 209c1bceb..ece039822 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -119,6 +119,7 @@ static void compiler_functionstateinit(functionstate *state) { varray_forwardreferenceinit(&state->forwardref); varray_upvalueinit(&state->upvalues); varray_functionrefinit(&state->functionref); + dictionary_init(&state->returntypes); } /** Clears a functionstate structure */ @@ -131,6 +132,7 @@ static void compiler_functionstateclear(functionstate *state) { varray_forwardreferenceclear(&state->forwardref); varray_upvalueclear(&state->upvalues); varray_functionrefclear(&state->functionref); + dictionary_clear(&state->returntypes); } /** Initializes the function stack */ @@ -239,17 +241,42 @@ bool compiler_hasreturn(compiler *c) { bool compiler_regcurrenttype(compiler *c, registerindx reg, value *type); /** Sets the return type of a function */ -void compiler_setreturntype(compiler *c, value type) { - objectfunction *func = compiler_getcurrentfunction(c); +void compiler_addreturntype(compiler *c, value type) { + functionstate *f = compiler_currentfunctionstate(c); - if (MORPHO_ISOBJECT(type)) signature_setreturntype(&func->sig, type); // TODO: Should check for current type + if (MORPHO_ISOBJECT(type)) dictionary_insert(&f->returntypes, type, MORPHO_NIL); + else dictionary_insert(&f->returntypes, MORPHO_FALSE, MORPHO_NIL); } /** Sets the return type of a function from the contents of a given register */ -void compiler_setreturntypefromregister(compiler *c, registerindx ix) { +void compiler_addreturntypefromregister(compiler *c, registerindx ix) { value type=MORPHO_NIL; compiler_regcurrenttype(c, ix, &type); - compiler_setreturntype(c, type); + compiler_addreturntype(c, type); +} + +static bool _retrieve(dictionary *dict, value *out) { + for (unsigned int i=0; icapacity; i++) { + if (!MORPHO_ISNIL(dict->contents[i].key)) { + *out = dict->contents[i].key; + return true; + } + } + return false; +} + +/** Resolve return type */ +void compiler_resolvereturntype(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + objectfunction *func = compiler_getcurrentfunction(c); + value type=MORPHO_NIL; + + if (f->returntypes.count==1 && + _retrieve(&f->returntypes, &type)) { + if (MORPHO_ISEQUAL(type, MORPHO_FALSE)) type=MORPHO_NIL; // Check for ambiguous type + } + + signature_setreturntype(&func->sig, type); } /** Infer the return type of a call target */ @@ -3455,10 +3482,10 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind /* Add a return instruction if necessary */ if (!compiler_hasreturn(c)) { if (ismethod) { // Methods automatically return self unless another argument is specified - if (func->klass) compiler_setreturntype(c, MORPHO_OBJECT(func->klass)); + if (func->klass) compiler_addreturntype(c, MORPHO_OBJECT(func->klass)); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, 0), node); /* Add a return */ } else { - compiler_setreturntype(c, _niltype); + compiler_addreturntype(c, _niltype); compiler_addinstruction(c, ENCODE_BYTE(OP_RETURN), node); /* Add a return */ } ninstructions++; @@ -3471,6 +3498,9 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind compiler_setinstruction(c, bindx, ENCODE_LONG(OP_B, REGISTER_UNALLOCATED, ninstructions)); ninstructions++; + /* Resolve the return type*/ + compiler_resolvereturntype(c); + /* Restore the old function */ compiler_endfunction(c); @@ -3857,7 +3887,7 @@ static codeinfo compiler_return(compiler *c, syntaxtreenode *node, registerindx ninstructions+=left.ninstructions; } - compiler_setreturntypefromregister(c, left.dest); + compiler_addreturntypefromregister(c, left.dest); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, left.dest), node); ninstructions++; } @@ -3866,10 +3896,10 @@ static codeinfo compiler_return(compiler *c, syntaxtreenode *node, registerindx objectclass *klass = compiler_getcurrentclass(c); /* Methods return self unless a return value is specified */ if (klass) { - compiler_setreturntype(c, MORPHO_OBJECT(klass)); + compiler_addreturntype(c, MORPHO_OBJECT(klass)); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 1, 0), node); /* Add a return */ } else { - compiler_setreturntype(c, _niltype); + compiler_addreturntype(c, _niltype); compiler_addinstruction(c, ENCODE_DOUBLE(OP_RETURN, 0, 0), node); } ninstructions++; diff --git a/src/core/compile.h b/src/core/compile.h index 2cecd4d18..107a99c31 100644 --- a/src/core/compile.h +++ b/src/core/compile.h @@ -241,6 +241,7 @@ typedef struct { varray_upvalue upvalues; varray_forwardreference forwardref; varray_functionref functionref; /* Functions visible within this state */ + dictionary returntypes; /** Possible return types */ registerindx varg; unsigned int nreg; /* Largest number of registers used */ unsigned int scopedepth; diff --git a/test/types/type_multiple_return_types_runtime.morpho b/test/types/type_multiple_return_types_runtime.morpho new file mode 100644 index 000000000..a1c49006b --- /dev/null +++ b/test/types/type_multiple_return_types_runtime.morpho @@ -0,0 +1,13 @@ +// Function with multiple return types yields dynamic typecheck + +fn multi(x) { + if (x>0) return 1 + return "foo" +} + +Int a = multi(2) +print a +// expect: 1 + +a = multi(-1) +// expect error 'TypeChk' From a93197fb61b8694b775912c1d47ada2c6d0d4c1a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 18:01:24 -0500 Subject: [PATCH 072/473] Type checking of function with multiple return types --- src/core/compile.c | 2 +- test/types/violations/type_violation_multi.morpho | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/types/violations/type_violation_multi.morpho diff --git a/src/core/compile.c b/src/core/compile.c index ece039822..394052dac 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -265,7 +265,7 @@ static bool _retrieve(dictionary *dict, value *out) { return false; } -/** Resolve return type */ +/** Resolve return type from the collection of possible types presented */ void compiler_resolvereturntype(compiler *c) { functionstate *f = compiler_currentfunctionstate(c); objectfunction *func = compiler_getcurrentfunction(c); diff --git a/test/types/violations/type_violation_multi.morpho b/test/types/violations/type_violation_multi.morpho new file mode 100644 index 000000000..0d6f7f01c --- /dev/null +++ b/test/types/violations/type_violation_multi.morpho @@ -0,0 +1,12 @@ +// Function with multiple return types + +fn f(Int x) { + if (x<0) { + return x + 1 + } + return x - 1 +} + +Float a = f(2) + +// expect error 'TypeErr' From 4774979c09b3518ff6457adf00c07b4e97f15343 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 18:48:11 -0500 Subject: [PATCH 073/473] Type propagation through type protected variables --- src/core/compile.c | 21 +++++++++++++++++-- .../type_violation_continuation.morpho | 12 +++++++++++ ...ype_violation_continuation_subtypes.morpho | 19 +++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 test/types/violations/type_violation_continuation.morpho create mode 100644 test/types/violations/type_violation_continuation_subtypes.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 394052dac..51bb1b7fc 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -436,6 +436,20 @@ bool compiler_checktype(compiler *c, value type, value match) { return false; } +/** Select the more specific type of two types; returns false if the types are contradictory*/ +bool compiler_mostspecifictype(compiler *c, value a, value b, value *out) { + if (MORPHO_ISNIL(a)) { + *out=b; return true; + } else if (MORPHO_ISNIL(b)) { + *out=a; return true; + } else if (compiler_checktype(c, a, b)) { + *out=b; return true; + } else if (compiler_checktype(c, b, a)) { + *out=a; return true; + } + return false; +} + /** Determines the type associated with a constant */ bool compiler_getconstanttype(compiler *c, unsigned int i, value *type) { value val = compiler_getconstant(c, i); @@ -1185,11 +1199,14 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei } if (out.dest!=info.dest) { + value ctype=MORPHO_NIL; if (compiler_regtype(c, out.dest, &type) && compiler_regsymbol(c, out.dest, &symbol) && compiler_regtypecheck(c, node, info.dest, type, symbol, &out) && - compiler_regcurrenttype(c, info.dest, &type)) { - compiler_regsetcurrenttype(c, out.dest, type); // TODO: Should we instead set the type to the known result of the typecheck? + compiler_regcurrenttype(c, info.dest, &ctype) && + compiler_mostspecifictype(c, type, ctype, &type)) { + + compiler_regsetcurrenttype(c, out.dest, type); } compiler_addinstruction(c, ENCODE_DOUBLE(OP_MOV, out.dest, info.dest), node); diff --git a/test/types/violations/type_violation_continuation.morpho b/test/types/violations/type_violation_continuation.morpho new file mode 100644 index 000000000..5bd3d694a --- /dev/null +++ b/test/types/violations/type_violation_continuation.morpho @@ -0,0 +1,12 @@ +// Check types from continuation + +fn f(x) { + return x +} + +{ + Int b = f(1) + Float a = b +} + +// expect error 'TypeErr' diff --git a/test/types/violations/type_violation_continuation_subtypes.morpho b/test/types/violations/type_violation_continuation_subtypes.morpho new file mode 100644 index 000000000..86cf2b1e6 --- /dev/null +++ b/test/types/violations/type_violation_continuation_subtypes.morpho @@ -0,0 +1,19 @@ +// Check types from continuation + +class A { } + +class B is A { } + +class C is A { } + +fn f(x) { + return x +} + +{ + A a = B() + B b = a + C c = a +} + +// expect error 'TypeErr' From 7c2b9e519f4186e066865f8e9babfe8d7511412d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 19:01:04 -0500 Subject: [PATCH 074/473] Fix incorrect assumptions about typechecks with inheritance --- src/core/compile.c | 8 +++----- test/types/type_casting.morpho | 8 ++++++++ .../type_violation_continuation.morpho | 2 +- .../type_violation_continuation_subtypes.morpho | 4 ---- ...olation_continuation_subtypes_runtime.morpho | 17 +++++++++++++++++ 5 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 test/types/type_casting.morpho create mode 100644 test/types/violations/type_violation_continuation_subtypes_runtime.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 51bb1b7fc..251d0ad17 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -438,10 +438,8 @@ bool compiler_checktype(compiler *c, value type, value match) { /** Select the more specific type of two types; returns false if the types are contradictory*/ bool compiler_mostspecifictype(compiler *c, value a, value b, value *out) { - if (MORPHO_ISNIL(a)) { - *out=b; return true; - } else if (MORPHO_ISNIL(b)) { - *out=a; return true; + if (MORPHO_ISNIL(a) || MORPHO_ISNIL(b)) { + *out=MORPHO_NIL; return true; } else if (compiler_checktype(c, a, b)) { *out=b; return true; } else if (compiler_checktype(c, b, a)) { @@ -1206,7 +1204,7 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei compiler_regcurrenttype(c, info.dest, &ctype) && compiler_mostspecifictype(c, type, ctype, &type)) { - compiler_regsetcurrenttype(c, out.dest, type); + compiler_regsetcurrenttype(c, out.dest, type); } compiler_addinstruction(c, ENCODE_DOUBLE(OP_MOV, out.dest, info.dest), node); diff --git a/test/types/type_casting.morpho b/test/types/type_casting.morpho new file mode 100644 index 000000000..af9c62247 --- /dev/null +++ b/test/types/type_casting.morpho @@ -0,0 +1,8 @@ +// Type checking with explicit type casting + +Float f = 3.14 +Int i = Int(f) // Explicit cast +Float g = Float(i) // Back to float + +print i // expect: 3 +print g // expect: 3 diff --git a/test/types/violations/type_violation_continuation.morpho b/test/types/violations/type_violation_continuation.morpho index 5bd3d694a..1151ecda6 100644 --- a/test/types/violations/type_violation_continuation.morpho +++ b/test/types/violations/type_violation_continuation.morpho @@ -9,4 +9,4 @@ fn f(x) { Float a = b } -// expect error 'TypeErr' +// expect error 'TypeChk' diff --git a/test/types/violations/type_violation_continuation_subtypes.morpho b/test/types/violations/type_violation_continuation_subtypes.morpho index 86cf2b1e6..d3e6ad7b8 100644 --- a/test/types/violations/type_violation_continuation_subtypes.morpho +++ b/test/types/violations/type_violation_continuation_subtypes.morpho @@ -6,10 +6,6 @@ class B is A { } class C is A { } -fn f(x) { - return x -} - { A a = B() B b = a diff --git a/test/types/violations/type_violation_continuation_subtypes_runtime.morpho b/test/types/violations/type_violation_continuation_subtypes_runtime.morpho new file mode 100644 index 000000000..26b577cf8 --- /dev/null +++ b/test/types/violations/type_violation_continuation_subtypes_runtime.morpho @@ -0,0 +1,17 @@ +// Check types from continuation + +class A { } + +class B is A { } + +class C is A { } + +fn f(x) { return x } + +{ + A a = f(B()) + B b = a + C c = a +} + +// expect error 'TypeChk' From df0828baecd1c663d37e90a9c92a6a934c53129d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 19:57:33 -0500 Subject: [PATCH 075/473] Various type tests --- src/core/compile.c | 15 ++++++-- test/types/type_array_operations.morpho | 15 ++++++++ .../type_closure_propagation_stepwise.morpho | 13 +++++++ test/types/type_complex_inheritance.morpho | 37 +++++++++++++++++++ test/types/type_dictionary_operations.morpho | 12 ++++++ test/types/type_do_while.morpho | 13 +++++++ test/types/type_early_return.morpho | 16 ++++++++ test/types/type_loop_break_continue.morpho | 13 +++++++ test/types/type_matrix_operations.morpho | 12 ++++++ test/types/type_method_chaining.morpho | 12 ++++++ .../type_multiple_dispatch_edge_cases.morpho | 23 ++++++++++++ test/types/type_narrowing_conditional.morpho | 17 +++++++++ test/types/type_range_operations.morpho | 10 +++++ test/types/type_recursive.morpho | 14 +++++++ test/types/type_sparse_operations.morpho | 8 ++++ test/types/type_string_operations.morpho | 10 +++++ test/types/type_try_catch.morpho | 13 +++++++ test/types/type_tuple_operations.morpho | 10 +++++ test/types/type_while_loop.morpho | 13 +++++++ 19 files changed, 272 insertions(+), 4 deletions(-) create mode 100644 test/types/type_array_operations.morpho create mode 100644 test/types/type_closure_propagation_stepwise.morpho create mode 100644 test/types/type_complex_inheritance.morpho create mode 100644 test/types/type_dictionary_operations.morpho create mode 100644 test/types/type_do_while.morpho create mode 100644 test/types/type_early_return.morpho create mode 100644 test/types/type_loop_break_continue.morpho create mode 100644 test/types/type_matrix_operations.morpho create mode 100644 test/types/type_method_chaining.morpho create mode 100644 test/types/type_multiple_dispatch_edge_cases.morpho create mode 100644 test/types/type_narrowing_conditional.morpho create mode 100644 test/types/type_range_operations.morpho create mode 100644 test/types/type_recursive.morpho create mode 100644 test/types/type_sparse_operations.morpho create mode 100644 test/types/type_string_operations.morpho create mode 100644 test/types/type_try_catch.morpho create mode 100644 test/types/type_tuple_operations.morpho create mode 100644 test/types/type_while_loop.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 251d0ad17..47e668709 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -308,6 +308,7 @@ value _stringtype; value _dicttype; value _listtype; value _rangetype; +value _tupletype; value _inttype; value _floattype; @@ -1204,7 +1205,7 @@ static codeinfo compiler_movetoregister(compiler *c, syntaxtreenode *node, codei compiler_regcurrenttype(c, info.dest, &ctype) && compiler_mostspecifictype(c, type, ctype, &type)) { - compiler_regsetcurrenttype(c, out.dest, type); + compiler_regsetcurrenttype(c, out.dest, type); } compiler_addinstruction(c, ENCODE_DOUBLE(OP_MOV, out.dest, info.dest), node); @@ -2059,12 +2060,17 @@ static codeinfo compiler_list(compiler *c, syntaxtreenode *node, registerindx re syntaxtreenodetype dictentrytype[] = { NODE_ARGLIST }; varray_syntaxtreeindx entries; - /* Set up a call to the List() function */ + /* Set up a call to the List() or Tuple() function as appropriate */ char *classname = LIST_CLASSNAME; - if (node->type==NODE_TUPLE) classname = TUPLE_CLASSNAME; + value type = _listtype; + if (node->type==NODE_TUPLE) { + classname = TUPLE_CLASSNAME; + type = _tupletype; + } + codeinfo out = compiler_findbuiltin(c, node, classname, reqout); - if (!compiler_regcheckandsetcurrenttype(c, node, out.dest, _listtype)) return CODEINFO_EMPTY; + if (!compiler_regcheckandsetcurrenttype(c, node, out.dest, type)) return CODEINFO_EMPTY; varray_syntaxtreeindxinit(&entries); if (node->right!=SYNTAXTREE_UNCONNECTED) syntaxtree_flatten(compiler_getsyntaxtree(c), node->right, 1, dictentrytype, &entries); @@ -4922,6 +4928,7 @@ void compile_initialize(void) { _dicttype = builtin_findclassfromcstring(DICTIONARY_CLASSNAME); _listtype = builtin_findclassfromcstring(LIST_CLASSNAME); _rangetype = builtin_findclassfromcstring(RANGE_CLASSNAME); + _tupletype = builtin_findclassfromcstring(TUPLE_CLASSNAME); _inttype = builtin_findclassfromcstring(INT_CLASSNAME); _floattype = builtin_findclassfromcstring(FLOAT_CLASSNAME); diff --git a/test/types/type_array_operations.morpho b/test/types/type_array_operations.morpho new file mode 100644 index 000000000..eaefa0e22 --- /dev/null +++ b/test/types/type_array_operations.morpho @@ -0,0 +1,15 @@ +// Type checking with array operations + +Array arr = Array(3) +arr[0] = 1 +arr[1] = 2 +arr[2] = 3 + +Int sum = 0 +for (i in 0...arr.count()) { + Int val = arr[i] // Type should be preserved + sum = sum + val +} +print sum // expect: 6 + + diff --git a/test/types/type_closure_propagation_stepwise.morpho b/test/types/type_closure_propagation_stepwise.morpho new file mode 100644 index 000000000..93f34af8f --- /dev/null +++ b/test/types/type_closure_propagation_stepwise.morpho @@ -0,0 +1,13 @@ +// Type propagation through deeply nested closures + +fn outer(Int x) { + fn inner(Int y) { + Int result = x + y + return result + } + return inner +} + +var inner_fn = outer(1) +Int result = inner_fn(2) +print result // expect: 3 diff --git a/test/types/type_complex_inheritance.morpho b/test/types/type_complex_inheritance.morpho new file mode 100644 index 000000000..7eefb2014 --- /dev/null +++ b/test/types/type_complex_inheritance.morpho @@ -0,0 +1,37 @@ +// Type checking with diamond inheritance: +// A +// / \ +// B C +// | | +// D E +// | | +// F G +// \ / +// H + +class A { } +class B is A { } +class C is A { } +class D is B { } +class E is C { } +class F is D { } +class G is E { } +class H is F with G {} + +fn process(A a) { + return a +} + +A a1 = B() +A a2 = C() +A a3 = D() +A a4 = F() +A a5 = G() +A a6 = H() + +print process(a1) // expect: +print process(a2) // expect: +print process(a3) // expect: +print process(a4) // expect: +print process(a5) // expect: +print process(a6) // expect: diff --git a/test/types/type_dictionary_operations.morpho b/test/types/type_dictionary_operations.morpho new file mode 100644 index 000000000..7385d87d0 --- /dev/null +++ b/test/types/type_dictionary_operations.morpho @@ -0,0 +1,12 @@ +// Type checking with dictionary operations + +Dictionary dict = { "a": 1, "b": 2, "c": 3 } + +Int total = 0 +for (key in dict.keys()) { + Int val = dict[key] // Type should be inferred + total = total + val +} +print total // expect: 6 + + diff --git a/test/types/type_do_while.morpho b/test/types/type_do_while.morpho new file mode 100644 index 000000000..af12737b2 --- /dev/null +++ b/test/types/type_do_while.morpho @@ -0,0 +1,13 @@ +// Type checking with do-while loops + +Int i = 0 +Int count = 0 + +do { + count = count + 1 + i = i + 1 +} while (i < 3) + +print count // expect: 3 + + diff --git a/test/types/type_early_return.morpho b/test/types/type_early_return.morpho new file mode 100644 index 000000000..9d63cfd65 --- /dev/null +++ b/test/types/type_early_return.morpho @@ -0,0 +1,16 @@ +// Type checking with multiple return paths + +fn check(Int x) { + if (x < 0) { + return 0 // Early return + } + Int result = x * 2 + return result +} + +Int a = check(5) +Int b = check(-1) +print a // expect: 10 +print b // expect: 0 + + diff --git a/test/types/type_loop_break_continue.morpho b/test/types/type_loop_break_continue.morpho new file mode 100644 index 000000000..30ef73844 --- /dev/null +++ b/test/types/type_loop_break_continue.morpho @@ -0,0 +1,13 @@ +// Type checking with break and continue + +Int sum = 0 +for (Int i = 0; i < 10; i = i + 1) { + if (i == 5) { + continue // Type should be preserved + } + if (i == 8) { + break // Type should be preserved + } + sum = sum + i +} +print sum // expect: 23 diff --git a/test/types/type_matrix_operations.morpho b/test/types/type_matrix_operations.morpho new file mode 100644 index 000000000..2caff884c --- /dev/null +++ b/test/types/type_matrix_operations.morpho @@ -0,0 +1,12 @@ +// Type checking with matrix operations + +Matrix m1 = Matrix(2, 2) +m1[0,0] = 1 +m1[0,1] = 2 +m1[1,0] = 3 +m1[1,1] = 4 + +Matrix m2 = m1 + m1 +Float val = m2[0,0] + +print val // expect: 2 diff --git a/test/types/type_method_chaining.morpho b/test/types/type_method_chaining.morpho new file mode 100644 index 000000000..4af0e8ca5 --- /dev/null +++ b/test/types/type_method_chaining.morpho @@ -0,0 +1,12 @@ +// Type propagation through method chains + +class Counter { + init() { self.value = 0 } + add(Int x) { self.value = self.value + x; return self } + get() { return self.value } +} + +Int result = Counter().add(5).add(3).get() +print result // expect: 8 + + diff --git a/test/types/type_multiple_dispatch_edge_cases.morpho b/test/types/type_multiple_dispatch_edge_cases.morpho new file mode 100644 index 000000000..c3a1a7507 --- /dev/null +++ b/test/types/type_multiple_dispatch_edge_cases.morpho @@ -0,0 +1,23 @@ +// Multiple dispatch with inheritance + +class Animal { } +class Dog is Animal { } +class Cat is Animal { } + +fn speak(Animal a) { + return "animal sound" +} + +fn speak(Dog d) { + return "woof" +} + +fn speak(Cat c) { + return "meow" +} + +print speak(Animal()) // expect: animal sound +print speak(Dog()) // expect: woof +print speak(Cat()) // expect: meow + + diff --git a/test/types/type_narrowing_conditional.morpho b/test/types/type_narrowing_conditional.morpho new file mode 100644 index 000000000..9194cc1d4 --- /dev/null +++ b/test/types/type_narrowing_conditional.morpho @@ -0,0 +1,17 @@ +// Type narrowing through conditional checks + +fn process(x) { + if (isint(x)) { + Int i = x // Should work - type narrowed + return i * 2 + } else if (isstring(x)) { + String s = x // Should work - type narrowed + return s + } + return nil +} + +print process(5) // expect: 10 +print process("hi") // expect: hi + + diff --git a/test/types/type_range_operations.morpho b/test/types/type_range_operations.morpho new file mode 100644 index 000000000..fa1b4b648 --- /dev/null +++ b/test/types/type_range_operations.morpho @@ -0,0 +1,10 @@ +// Type checking with range operations + +Range r = 1...10 +Int sum = 0 + +for (i in r) { + sum = sum + i +} + +print sum // expect: 45 diff --git a/test/types/type_recursive.morpho b/test/types/type_recursive.morpho new file mode 100644 index 000000000..0df9c2f3c --- /dev/null +++ b/test/types/type_recursive.morpho @@ -0,0 +1,14 @@ +// Type checking with recursive functions + +fn factorial(Int n) { + if (n <= 1) { + return 1 + } + Int result = n * factorial(n - 1) + return result +} + +Int fact5 = factorial(5) +print fact5 // expect: 120 + + diff --git a/test/types/type_sparse_operations.morpho b/test/types/type_sparse_operations.morpho new file mode 100644 index 000000000..6a3e08244 --- /dev/null +++ b/test/types/type_sparse_operations.morpho @@ -0,0 +1,8 @@ +// Type checking with sparse matrix operations + +Sparse m = Sparse([[1, 1, 5], [2, 2, 10]]) +Int val = m[1, 1] + +print val // expect: 5 + + diff --git a/test/types/type_string_operations.morpho b/test/types/type_string_operations.morpho new file mode 100644 index 000000000..56c95e9a7 --- /dev/null +++ b/test/types/type_string_operations.morpho @@ -0,0 +1,10 @@ +// Type checking with string operations + +String s = "hello" +String t = "world" + +String combined = s + " " + t +Int len = combined.count() + +print combined // expect: hello world +print len // expect: 11 diff --git a/test/types/type_try_catch.morpho b/test/types/type_try_catch.morpho new file mode 100644 index 000000000..ac93506ec --- /dev/null +++ b/test/types/type_try_catch.morpho @@ -0,0 +1,13 @@ +// Type checking in try/catch blocks + +fn risky(Int x) { + try { + Int result = x * 2 + return result + } catch { + "Err" : return 0 + } +} + +Int a = risky(5) +print a // expect: 10 diff --git a/test/types/type_tuple_operations.morpho b/test/types/type_tuple_operations.morpho new file mode 100644 index 000000000..507c215b2 --- /dev/null +++ b/test/types/type_tuple_operations.morpho @@ -0,0 +1,10 @@ +// Type checking with tuple operations + +Tuple t = (5, "hello") +Int first = t[0] +String second = t[1] + +print first // expect: 5 +print second // expect: hello + + diff --git a/test/types/type_while_loop.morpho b/test/types/type_while_loop.morpho new file mode 100644 index 000000000..5254cacd6 --- /dev/null +++ b/test/types/type_while_loop.morpho @@ -0,0 +1,13 @@ +// Type checking with while loops + +Int i = 0 +Int sum = 0 + +while (i < 5) { + sum = sum + i + i = i + 1 +} + +print sum // expect: 10 + + From 6a860af271e102dda490ca590d94722833f6fe94 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 20:13:30 -0500 Subject: [PATCH 076/473] Additional tests --- .../violations/type_violation_array_access.morpho | 11 +++++++++++ .../type_violation_complex_inheritance.morpho | 14 ++++++++++++++ .../type_violation_dictionary_access.morpho | 5 +++++ .../type_violation_method_chaining.morpho | 9 +++++++++ .../type_violation_multiple_dispatch.morpho | 15 +++++++++++++++ .../violations/type_violation_narrowing.morpho | 12 ++++++++++++ 6 files changed, 66 insertions(+) create mode 100644 test/types/violations/type_violation_array_access.morpho create mode 100644 test/types/violations/type_violation_complex_inheritance.morpho create mode 100644 test/types/violations/type_violation_dictionary_access.morpho create mode 100644 test/types/violations/type_violation_method_chaining.morpho create mode 100644 test/types/violations/type_violation_multiple_dispatch.morpho create mode 100644 test/types/violations/type_violation_narrowing.morpho diff --git a/test/types/violations/type_violation_array_access.morpho b/test/types/violations/type_violation_array_access.morpho new file mode 100644 index 000000000..14a4e36f0 --- /dev/null +++ b/test/types/violations/type_violation_array_access.morpho @@ -0,0 +1,11 @@ +// Type violation with array access + +Array arr = Array(3) +arr[0] = 1 +arr[1] = 2 +arr[2] = 3 + +String val = arr[0] // expect error 'TypeChk' - arr[0] is Int, not String + + + diff --git a/test/types/violations/type_violation_complex_inheritance.morpho b/test/types/violations/type_violation_complex_inheritance.morpho new file mode 100644 index 000000000..c5886dfea --- /dev/null +++ b/test/types/violations/type_violation_complex_inheritance.morpho @@ -0,0 +1,14 @@ +// Type violation with complex inheritance + +class A { } +class B is A { } +class C is A { } + +fn f() { + B b = C() // expect error 'TypeErr' - C is not a subclass of B +} + +f() + + + diff --git a/test/types/violations/type_violation_dictionary_access.morpho b/test/types/violations/type_violation_dictionary_access.morpho new file mode 100644 index 000000000..2fd07d157 --- /dev/null +++ b/test/types/violations/type_violation_dictionary_access.morpho @@ -0,0 +1,5 @@ +// Type violation with dictionary access + +Dictionary dict = { "a": 1, "b": 2 } + +String val = dict["a"] // expect error 'TypeChk' - dict["a"] is Int, not String diff --git a/test/types/violations/type_violation_method_chaining.morpho b/test/types/violations/type_violation_method_chaining.morpho new file mode 100644 index 000000000..78b0665d0 --- /dev/null +++ b/test/types/violations/type_violation_method_chaining.morpho @@ -0,0 +1,9 @@ +// Type violation in method chaining + +class Counter { + init() { self.value = 0 } + add(Int x) { self.value = self.value + x; return self } + get() { return self.value } +} + +String result = Counter().add(5).get() // expect error 'TypeChk' - get() returns Int, not String diff --git a/test/types/violations/type_violation_multiple_dispatch.morpho b/test/types/violations/type_violation_multiple_dispatch.morpho new file mode 100644 index 000000000..648e24b35 --- /dev/null +++ b/test/types/violations/type_violation_multiple_dispatch.morpho @@ -0,0 +1,15 @@ +// Type violation with multiple dispatch + +class Animal { } +class Dog is Animal { } +class Cat is Animal { } + +fn speak(Animal a) { + return "animal sound" +} + +fn speak(Dog d) { + return "woof" +} + +Int result = speak(Cat()) // expect error 'TypeErr' - speak returns String, not Int diff --git a/test/types/violations/type_violation_narrowing.morpho b/test/types/violations/type_violation_narrowing.morpho new file mode 100644 index 000000000..2753ad085 --- /dev/null +++ b/test/types/violations/type_violation_narrowing.morpho @@ -0,0 +1,12 @@ +// Type violation with incorrect type narrowing + +fn process(x) { + if (isint(x)) { + String s = x + return s + } + return nil +} + +print process(5) +// expect error 'TypeChk' - x is Int, not String From 9758c427e8681a2a32d3159ab041fc5c1ee90dd1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 20:18:20 -0500 Subject: [PATCH 077/473] Remove whitespace --- .../types/violations/type_violation_complex_inheritance.morpho | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/types/violations/type_violation_complex_inheritance.morpho b/test/types/violations/type_violation_complex_inheritance.morpho index c5886dfea..671b943f3 100644 --- a/test/types/violations/type_violation_complex_inheritance.morpho +++ b/test/types/violations/type_violation_complex_inheritance.morpho @@ -9,6 +9,3 @@ fn f() { } f() - - - From d2a91fa4cab318ae8c9bb521ac0a53be3c6bf1be Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 11 Nov 2025 20:59:52 -0500 Subject: [PATCH 078/473] Avoid direct value comparisons to fix nonanboxing --- src/classes/metafunction.c | 2 +- src/core/compile.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 5502e320f..9173df2f3 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -172,7 +172,7 @@ void metafunction_inferreturntype(objectmetafunction *fn, value *type) { if (i==0) { rtype=sig->ret; } else { - if (sig->ret!=rtype) rtype=MORPHO_NIL; + if (!MORPHO_ISEQUAL(sig->ret,rtype)) rtype=MORPHO_NIL; } } diff --git a/src/core/compile.c b/src/core/compile.c index 47e668709..934e62a8e 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -1673,7 +1673,7 @@ static void _findfunctionref(compiler *c, value symbol, bool *hasclosure, varray value type; if (rsym>=0 && compiler_regcurrenttype(c, rsym, &type) && - type!=_closuretype) { + !MORPHO_ISEQUAL(type, _closuretype)) { break; // If there is, then we halt the search } } @@ -2361,12 +2361,12 @@ bool compiler_arithmetictype(compiler *c, opcode op, registerindx left, register if (compiler_regcurrenttype(c, left, <ype) && compiler_regcurrenttype(c, right, &rtype)) { - if (ltype==_inttype && rtype==_inttype) { + if (MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_inttype)) { *type=_inttype; success=true; - } else if ((ltype==_inttype && rtype==_floattype) || - (ltype==_floattype && rtype==_inttype) || - (ltype==_floattype && rtype==_floattype)) { + } else if ((MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_floattype)) || + (MORPHO_ISEQUAL(ltype,_floattype) && MORPHO_ISEQUAL(rtype,_inttype)) || + (MORPHO_ISEQUAL(ltype,_floattype) && MORPHO_ISEQUAL(rtype,_floattype))) { *type=_floattype; success=true; } else { From fbf4847d1980142f820eceaa1609123a763631e3 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 12 Nov 2025 20:27:10 -0500 Subject: [PATCH 079/473] Fix profiler --- src/debug/profile.c | 2 +- src/support/platform.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug/profile.c b/src/debug/profile.c index 6a677d3ea..2488157fe 100644 --- a/src/debug/profile.c +++ b/src/debug/profile.c @@ -205,7 +205,7 @@ bool morpho_profile(vm *v, program *p) { profiler_init(&profile, p); - if (MorphoThread_create(&profile.profiler, profiler_thread, v)) { + if (!MorphoThread_create(&profile.profiler, profiler_thread, v)) { UNREACHABLE("Unable to run profiler."); } diff --git a/src/support/platform.c b/src/support/platform.c index b3d9d7e1a..78ea46530 100644 --- a/src/support/platform.c +++ b/src/support/platform.c @@ -266,7 +266,7 @@ void *platform_dlsym(MorphoDLHandle handle, const char *symbol) { DEFINE_VARRAY(MorphoThread, MorphoThread); -/** Creates a thread */ +/** Creates a thread; returns true on success */ bool MorphoThread_create(MorphoThread *thread, MorphoThreadFn threadfn, void *ref) { #ifdef _WIN32 DWORD threadId; From 6e4778b6301e704dacef874ec1f1b98b3d2c6b14 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 16 Nov 2025 13:21:36 -0500 Subject: [PATCH 080/473] Declare multiple typed variables --- src/classes/nil.h | 2 +- src/core/compile.c | 131 +++++++++++-------- src/core/compile.h | 1 + test/types/type_multiple_declarations.morpho | 7 + 4 files changed, 88 insertions(+), 53 deletions(-) create mode 100644 test/types/type_multiple_declarations.morpho diff --git a/src/classes/nil.h b/src/classes/nil.h index d75328473..f59ad442b 100644 --- a/src/classes/nil.h +++ b/src/classes/nil.h @@ -11,7 +11,7 @@ * Nil veneer class * ------------------------------------------------------- */ -#define NIL_CLASSNAME "nil" +#define NIL_CLASSNAME "Nil" /* ------------------------------------------------------- * Nil error messages diff --git a/src/core/compile.c b/src/core/compile.c index 934e62a8e..2aec9928e 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -115,6 +115,7 @@ static void compiler_functionstateinit(functionstate *state) { state->nreg=0; state->type=FUNCTION; state->varg=REGISTER_UNALLOCATED; + state->typedec=MORPHO_NIL; varray_registerallocinit(&state->registers); varray_forwardreferenceinit(&state->forwardref); varray_upvalueinit(&state->upvalues); @@ -455,6 +456,18 @@ bool compiler_getconstanttype(compiler *c, unsigned int i, value *type) { return compiler_typefromvalue(c, val, type); } +/** Sets typedec in the current functionstate; used to compile typed declarations */ +void compiler_settypedec(compiler *c, value type) { + functionstate *f = compiler_currentfunctionstate(c); + f->typedec=type; +} + +/** Returns the value of typedec in the current functionstate */ +value compiler_gettypedec(compiler *c) { + functionstate *f = compiler_currentfunctionstate(c); + return f->typedec; +} + /* ------------------------------------------ * Modules * ------------------------------------------- */ @@ -1941,6 +1954,7 @@ static codeinfo compiler_break(compiler *c, syntaxtreenode *node, registerindx r static codeinfo compiler_try(compiler *c, syntaxtreenode *node, registerindx reqout); static codeinfo compiler_logical(compiler *c, syntaxtreenode *node, registerindx reqout); static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, registerindx out); +static codeinfo compiler_typeddeclaration(compiler *c, syntaxtreenode *node, registerindx out); static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerindx out); static codeinfo compiler_arglist(compiler *c, syntaxtreenode *node, registerindx out); static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx out); @@ -2011,7 +2025,7 @@ compilenoderule noderules[] = { { compiler_print }, // NODE_PRINT { compiler_declaration }, // NODE_DECLARATION - { compiler_declaration }, // NODE_TYPE + { compiler_typeddeclaration }, // NODE_TYPE { compiler_function }, // NODE_FUNCTION { NODE_NORULE }, // NODE_METHOD { compiler_class }, // NODE_CLASS @@ -3244,28 +3258,20 @@ static codeinfo compiler_logical(compiler *c, syntaxtreenode *node, registerindx /** Compile declarations */ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, registerindx reqout) { - syntaxtreenode *decnode = node; - syntaxtreenode *typenode = NULL; - - if (node->type==NODE_TYPE) { - typenode=compiler_getnode(c, node->left); - decnode=compiler_getnode(c, node->right); - } - syntaxtreenode *varnode = NULL; syntaxtreenode *lftnode = NULL, *indxnode = NULL; codeinfo right=CODEINFO_EMPTY; - value var=MORPHO_NIL, type=MORPHO_NIL; + value var=MORPHO_NIL, type=compiler_gettypedec(c); registerindx reg; unsigned int ninstructions = 0; - varnode=compiler_getnode(c, decnode->left); + varnode=compiler_getnode(c, node->left); /* Find the symbol */ if (varnode) { - if (varnode->type==NODE_SYMBOL) { + if (varnode->type==NODE_SYMBOL) { // Just a regular symbol var = varnode->content; - } else if (varnode->type==NODE_INDEX) { + } else if (varnode->type==NODE_INDEX) { // It's part of an index assignment lftnode=compiler_getnode(c, varnode->left); if (lftnode && lftnode->type==NODE_SYMBOL) { indxnode=varnode; @@ -3289,8 +3295,7 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register reg=compiler_regtemp(c, REGISTER_UNALLOCATED); } - if (typenode && - compiler_findtype(c, typenode->content, &type)) { + if (MORPHO_ISOBJECT(type)) { compiler_regsettype(c, reg, type); if (vloc.returntype==GLOBAL) compiler_setglobaltype(c, vloc.dest, type); } @@ -3298,7 +3303,7 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register /* If this is an array, we must create it */ if (indxnode) { /* Set up a call to the Array() function */ - array=compiler_findbuiltin(c, decnode, ARRAY_CLASSNAME, reqout); + array=compiler_findbuiltin(c, node, ARRAY_CLASSNAME, reqout); ninstructions+=array.ninstructions; // Dimensions @@ -3307,13 +3312,13 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register ninstructions+=indxinfo.ninstructions; // Initializer - if (decnode->right!=SYNTAXTREE_UNCONNECTED) { + if (node->right!=SYNTAXTREE_UNCONNECTED) { iend=compiler_regalloctop(c); - right = compiler_nodetobytecode(c, decnode->right, iend); + right = compiler_nodetobytecode(c, node->right, iend); ninstructions+=right.ninstructions; - right=compiler_movetoregister(c, decnode, right, iend); // Ensure in register + right=compiler_movetoregister(c, node, right, iend); // Ensure in register ninstructions+=right.ninstructions; } @@ -3324,27 +3329,27 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register compiler_regfreetoend(c, istart); if (vloc.returntype==REGISTER && array.dest!=vloc.dest) { // Move to correct register - codeinfo move=compiler_movetoregister(c, decnode, array, vloc.dest); + codeinfo move=compiler_movetoregister(c, node, array, vloc.dest); ninstructions+=move.ninstructions; } else reg=array.dest; - } else if (decnode->right!=SYNTAXTREE_UNCONNECTED) { /* Not an array, but has an initializer */ - right = compiler_nodetobytecode(c, decnode->right, reg); + } else if (node->right!=SYNTAXTREE_UNCONNECTED) { /* Not an array, but has an initializer */ + right = compiler_nodetobytecode(c, node->right, reg); ninstructions+=right.ninstructions; /* Ensure operand is in the desired register */ - right=compiler_movetoregister(c, decnode, right, reg); + right=compiler_movetoregister(c, node, right, reg); ninstructions+=right.ninstructions; } else if (MORPHO_ISOBJECT(type)) { // A typed variable must have an initializer compiler_error(c, node, COMPILE_NOINITIALIZER, MORPHO_GETCSTRING(var)); } else { // An untyped variable is simply initialized to nil - registerindx cnil = compiler_addconstant(c, decnode, MORPHO_NIL, false, false); + registerindx cnil = compiler_addconstant(c, node, MORPHO_NIL, false, false); compiler_addinstruction(c, ENCODE_LONG(OP_LCT, reg, cnil), node); ninstructions++; } if (vloc.returntype!=REGISTER) { - codeinfo mv=compiler_movefromregister(c, decnode, vloc, reg); + codeinfo mv=compiler_movefromregister(c, node, vloc, reg); ninstructions+=mv.ninstructions; compiler_regfreetemp(c, reg); @@ -3356,6 +3361,54 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register return CODEINFO(REGISTER, REGISTER_UNALLOCATED, ninstructions); } +bool _extracttype(compiler *c, syntaxtreenode *node, value *out) { + value type=MORPHO_NIL; + syntaxtreenode *typenode = compiler_getnode(c, node->left); + if (!typenode) UNREACHABLE("Incorrectly formed type node."); + if (typenode->type==NODE_DOT) { + syntaxtreenode *nsnode = compiler_getnode(c, typenode->left); + syntaxtreenode *labelnode = compiler_getnode(c, typenode->right); + + if (!(nsnode && + labelnode && + MORPHO_ISSTRING(nsnode->content) && + MORPHO_ISSTRING(labelnode->content))) UNREACHABLE("Incorrectly formed type namespace node."); + + if (!compiler_isnamespace(c, nsnode->content)) { + compiler_error(c, nsnode, COMPILE_UNKNWNNMSPC, MORPHO_GETCSTRING(nsnode->content)); + return false; + } + + if (!compiler_findclasswithnamespace(c, typenode, nsnode->content, labelnode->content, &type)) { + compiler_error(c, typenode, COMPILE_SYMBOLNOTDEFINEDNMSPC, MORPHO_GETCSTRING(nsnode->content), MORPHO_GETCSTRING(labelnode->content)); + return false; + } + + } else if (MORPHO_ISSTRING(typenode->content)) { + if (!compiler_findtype(c, typenode->content, &type)) { + compiler_error(c, typenode, COMPILE_UNKNWNTYPE, MORPHO_GETCSTRING(typenode->content)); + return false; + } + } else UNREACHABLE("Type node should have string label."); + + *out = type; + return true; +} + +/** Compile typed declarations */ +static codeinfo compiler_typeddeclaration(compiler *c, syntaxtreenode *node, registerindx reqout) { + codeinfo out = CODEINFO_EMPTY; + value type = MORPHO_NIL; + + if (_extracttype(c, node, &type)) { + compiler_settypedec(c, type); + out = compiler_nodetobytecode(c, node->right, reqout); + compiler_settypedec(c, MORPHO_NIL); + } + + return out; +} + /** Compiles an parameter declaration */ static registerindx compiler_functionparameters(compiler *c, syntaxtreeindx indx) { syntaxtreenode *node = compiler_getnode(c, indx); @@ -3368,33 +3421,7 @@ static registerindx compiler_functionparameters(compiler *c, syntaxtreeindx indx case NODE_TYPE: { value type=MORPHO_NIL; - syntaxtreenode *typenode = compiler_getnode(c, node->left); - if (!typenode) UNREACHABLE("Incorrectly formed type node."); - if (typenode->type==NODE_DOT) { - syntaxtreenode *nsnode = compiler_getnode(c, typenode->left); - syntaxtreenode *labelnode = compiler_getnode(c, typenode->right); - - if (!(nsnode && - labelnode && - MORPHO_ISSTRING(nsnode->content) && - MORPHO_ISSTRING(labelnode->content))) UNREACHABLE("Incorrectly formed type namespace node."); - - if (!compiler_isnamespace(c, nsnode->content)) { - compiler_error(c, nsnode, COMPILE_UNKNWNNMSPC, MORPHO_GETCSTRING(nsnode->content)); - return REGISTER_UNALLOCATED; - } - - if (!compiler_findclasswithnamespace(c, typenode, nsnode->content, labelnode->content, &type)) { - compiler_error(c, typenode, COMPILE_SYMBOLNOTDEFINEDNMSPC, MORPHO_GETCSTRING(nsnode->content), MORPHO_GETCSTRING(labelnode->content)); - return REGISTER_UNALLOCATED; - } - - } else if (MORPHO_ISSTRING(typenode->content)) { - if (!compiler_findtype(c, typenode->content, &type)) { - compiler_error(c, node, COMPILE_UNKNWNTYPE, MORPHO_GETCSTRING(typenode->content)); - return REGISTER_UNALLOCATED; - } - } else UNREACHABLE("Type node should have string label."); + if (!_extracttype(c, node, &type)) return REGISTER_UNALLOCATED; registerindx reg = compiler_functionparameters(c, node->right); compiler_regsettype(c, reg, type); diff --git a/src/core/compile.h b/src/core/compile.h index 107a99c31..a42781b81 100644 --- a/src/core/compile.h +++ b/src/core/compile.h @@ -249,6 +249,7 @@ typedef struct { unsigned int cfdepth; /* Count depth inside control flow; allows us to identify where returns are */ bool inargs; /* Set while compiling function calls to ensure allocations are at the top of the stack */ bool hasreturn; /* Set if the compiling function has an unconditional return */ + value typedec; /* Set to the current type of a type declaration */ //unsigned int nposn; /* Number of positional args recorded in latest call */ //unsigned int nopt; /* Number of optional args recorded in latest call */ } functionstate; diff --git a/test/types/type_multiple_declarations.morpho b/test/types/type_multiple_declarations.morpho new file mode 100644 index 000000000..df14974a0 --- /dev/null +++ b/test/types/type_multiple_declarations.morpho @@ -0,0 +1,7 @@ +// Multiple simultaneous declarations + +List a = [], b = [], c = [] + +print a // expect: [ ] +print b // expect: [ ] +print c // expect: [ ] From 59146b0e9713d4e8d784a1055503e3d0684e0dd5 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 16 Nov 2025 13:28:25 -0500 Subject: [PATCH 081/473] Test for namespaces --- test/types/type_declaration_namespace.morpho | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/types/type_declaration_namespace.morpho diff --git a/test/types/type_declaration_namespace.morpho b/test/types/type_declaration_namespace.morpho new file mode 100644 index 000000000..0e9d303a7 --- /dev/null +++ b/test/types/type_declaration_namespace.morpho @@ -0,0 +1,13 @@ + +import "type_namespace.xmorpho" as ns + +class Cow is ns.Pet { + moo() { print "${self.name} moos" } +} + +ns.Pet a = ns.Cat("Phineas"), + b = ns.Dog("Fido"), + c = Cow("Ermintrude") + +a.hiss() // expect: Phineas hisses +c.moo() // expect: Ermintrude moos From 1192b142010afd80331e404fccd1db171e07d54c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 16 Nov 2025 17:27:47 -0500 Subject: [PATCH 082/473] Add return type to List.count() --- src/classes/list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/list.c b/src/classes/list.c index 4f79f53e5..e5558eaf3 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -685,7 +685,7 @@ MORPHO_METHOD(MORPHO_SETINDEX_METHOD, List_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, List_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, List_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", List_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_TUPLES_METHOD, List_tuples, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_SETS_METHOD, List_sets, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, BUILTIN_FLAGSEMPTY), From 32916aa47e7886c0a4c63a9407163603bd71a324 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 27 Nov 2025 13:29:30 -0500 Subject: [PATCH 083/473] Add additional multiple dispatch check --- .../multiple_dispatch/check_multiple.morpho | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/types/multiple_dispatch/check_multiple.morpho diff --git a/test/types/multiple_dispatch/check_multiple.morpho b/test/types/multiple_dispatch/check_multiple.morpho new file mode 100644 index 000000000..e7f66e592 --- /dev/null +++ b/test/types/multiple_dispatch/check_multiple.morpho @@ -0,0 +1,18 @@ + +class A {} + +class B {} + +fn f(A x, A y) { return 1 } + +fn f(A x, B y) { return 2 } + +fn f(x, y) { return 1.5 } + +print f(A(), A()) // expect: 1 + +print f(0, 0) // expect: 1.5 + +print f(A(), 1) // expect: 1.5 + +print f(A(), B()) // expect: 2 From 8a51c52296540d7711d6d982cdb4d94401313f09 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 27 Nov 2025 14:00:34 -0500 Subject: [PATCH 084/473] Better register allocation for function calls Fixed nested closures --- src/core/compile.c | 12 +++++++++++- test/types/type_closure_propagation.morpho | 12 ++++++++++++ .../types/type_nested_closure_propagation.morpho | 16 ++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 test/types/type_closure_propagation.morpho create mode 100644 test/types/type_nested_closure_propagation.morpho diff --git a/src/core/compile.c b/src/core/compile.c index 2aec9928e..79ec97a03 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3714,6 +3714,7 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re if (compiler_isinvocation(c, node)) { return compiler_invoke(c, node, reqout); } + registerindx top=compiler_regtop(c); compiler_beginargs(c); @@ -3735,8 +3736,17 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re } } + // Use the requested register for the call if it's on top and isn't typed + registerindx rCallReq = (reqoutleft, (reqoutleft, rCallReq); // Attempt to infer return type if (func.returntype==CONSTANT && MORPHO_ISNIL(rtype)) { diff --git a/test/types/type_closure_propagation.morpho b/test/types/type_closure_propagation.morpho new file mode 100644 index 000000000..98f2c42e5 --- /dev/null +++ b/test/types/type_closure_propagation.morpho @@ -0,0 +1,12 @@ +// Type propagation through closure + +fn outer(Int x) { + fn inner(Int y) { + Int result = x + y + return result + } + return inner +} + +Int result = outer(1)(2) +print result // expect: 3 diff --git a/test/types/type_nested_closure_propagation.morpho b/test/types/type_nested_closure_propagation.morpho new file mode 100644 index 000000000..32aa7e629 --- /dev/null +++ b/test/types/type_nested_closure_propagation.morpho @@ -0,0 +1,16 @@ +// Type propagation through deeply nested closures + +fn outer(Int x) { + fn middle(Int y) { + fn inner(Int z) { + Int result = x + y + z + return result + } + return inner + } + return middle +} + +Int result = outer(1)(2)(3) +print result // expect: 6 + From cfd3b1380445e49011e16ff2f7befd96b45a7ce1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 28 Nov 2025 10:39:15 -0500 Subject: [PATCH 085/473] Complex type inference --- src/classes/cmplx.c | 32 ++++++++++--------- src/core/compile.c | 19 ++++++----- .../types/type_complex_add_violation.morpho | 6 ++++ test/complex/types/type_complex_power.morpho | 14 ++++++++ .../types/type_complex_power_violation.morpho | 7 ++++ test/complex/types/type_complex_types.morpho | 18 +++++++++++ 6 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 test/complex/types/type_complex_add_violation.morpho create mode 100644 test/complex/types/type_complex_power.morpho create mode 100644 test/complex/types/type_complex_power_violation.morpho create mode 100644 test/complex/types/type_complex_types.morpho diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index 1d2e84f44..6a9dd3bf1 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -634,6 +634,8 @@ value Complex_angle(vm *v, int nargs, value *args) { complex_angle(a, &val); return MORPHO_FLOAT(val); } + +/** Absolute value of a complex number */ value Complex_abs(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); double val; @@ -670,21 +672,21 @@ value Complex_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexNum) MORPHO_METHOD(MORPHO_PRINT_METHOD, Complex_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADD_METHOD, Complex_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUB_METHOD, Complex_sub, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_MUL_METHOD, Complex_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_DIV_METHOD, Complex_div, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADDR_METHOD, Complex_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUBR_METHOD, Complex_subr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_MULR_METHOD, Complex_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_DIVR_METHOD, Complex_divr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_POW_METHOD, Complex_power, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_POWR_METHOD, Complex_powerr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(COMPLEX_ANGLE_METHOD, Complex_angle, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(COMPLEX_CONJUGATE_METHOD, Complex_conjugate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(COMPLEX_REAL_METHOD, Complex_getreal, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(COMPLEX_IMAG_METHOD, Complex_getimag, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(COMPLEX_ABS_METHOD, Complex_abs, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (...)", Complex_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (...)", Complex_sub, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (...)", Complex_mul, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (...)", Complex_div, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (...)", Complex_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Complex (...)", Complex_subr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (...)", Complex_mul, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "Complex (...)", Complex_divr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (...)", Complex_power, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (...)", Complex_powerr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_ANGLE_METHOD, "Float (...)", Complex_angle, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex (...)", Complex_conjugate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Float (...)", Complex_getreal, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Float (...)", Complex_getimag, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_ABS_METHOD, "Float (...)", Complex_abs, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/core/compile.c b/src/core/compile.c index 79ec97a03..241cc3d8f 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -310,6 +310,7 @@ value _dicttype; value _listtype; value _rangetype; value _tupletype; +value _complextype; value _inttype; value _floattype; @@ -2368,6 +2369,10 @@ opcodedispatchrule opcodedispatchrules[] ={ { OP_POW, MORPHO_POW_METHOD, MORPHO_POWR_METHOD }, }; +bool _isreal(value r) { + return MORPHO_ISEQUAL(r, _inttype) || MORPHO_ISEQUAL(r, _floattype); +} + bool compiler_arithmetictype(compiler *c, opcode op, registerindx left, registerindx right, value *type) { bool success=false; value ltype=MORPHO_NIL, rtype=MORPHO_NIL; @@ -2375,12 +2380,10 @@ bool compiler_arithmetictype(compiler *c, opcode op, registerindx left, register if (compiler_regcurrenttype(c, left, <ype) && compiler_regcurrenttype(c, right, &rtype)) { - if (MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_inttype)) { + if (MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_inttype) && op!=OP_POW) { *type=_inttype; success=true; - } else if ((MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_floattype)) || - (MORPHO_ISEQUAL(ltype,_floattype) && MORPHO_ISEQUAL(rtype,_inttype)) || - (MORPHO_ISEQUAL(ltype,_floattype) && MORPHO_ISEQUAL(rtype,_floattype))) { + } else if (_isreal(ltype) && _isreal(rtype)) { *type=_floattype; success=true; } else { @@ -2448,10 +2451,8 @@ static codeinfo compiler_binary(compiler *c, syntaxtreenode *node, registerindx /* Set the output type of the operation */ // TODO: Check input types? value type = MORPHO_NIL; - if (op<=OP_DIV) { // Arithmetic type + if (op<=OP_POW) { // Arithmetic type compiler_arithmetictype(c, op, left.dest, right.dest, &type); - } else if (op==OP_POW) { // Powers always generate floats TODO: THIS IS NOT TRUE - type=_floattype; } else { // Comparison operations type=_booltype; } @@ -3296,8 +3297,9 @@ static codeinfo compiler_declaration(compiler *c, syntaxtreenode *node, register } if (MORPHO_ISOBJECT(type)) { - compiler_regsettype(c, reg, type); + // TODO: This should probably be an either/or... if (vloc.returntype==GLOBAL) compiler_setglobaltype(c, vloc.dest, type); + compiler_regsettype(c, reg, type); } /* If this is an array, we must create it */ @@ -4966,6 +4968,7 @@ void compile_initialize(void) { _listtype = builtin_findclassfromcstring(LIST_CLASSNAME); _rangetype = builtin_findclassfromcstring(RANGE_CLASSNAME); _tupletype = builtin_findclassfromcstring(TUPLE_CLASSNAME); + _complextype = builtin_findclassfromcstring(COMPLEX_CLASSNAME); _inttype = builtin_findclassfromcstring(INT_CLASSNAME); _floattype = builtin_findclassfromcstring(FLOAT_CLASSNAME); diff --git a/test/complex/types/type_complex_add_violation.morpho b/test/complex/types/type_complex_add_violation.morpho new file mode 100644 index 000000000..d33979aa5 --- /dev/null +++ b/test/complex/types/type_complex_add_violation.morpho @@ -0,0 +1,6 @@ +// Check type detection for add + +Complex a = 1im +var b = 1 + +Float c = a + b // expect error 'TypeErr' diff --git a/test/complex/types/type_complex_power.morpho b/test/complex/types/type_complex_power.morpho new file mode 100644 index 000000000..e32a8158e --- /dev/null +++ b/test/complex/types/type_complex_power.morpho @@ -0,0 +1,14 @@ +// Check type inference + +Float R = 2.0 +Complex Z = 1 + 2im + +{ + Float a = R^2 + + Complex b = Z^2 + + Complex c = R^Z + + Complex d = Z^Z +} diff --git a/test/complex/types/type_complex_power_violation.morpho b/test/complex/types/type_complex_power_violation.morpho new file mode 100644 index 000000000..f0100ecac --- /dev/null +++ b/test/complex/types/type_complex_power_violation.morpho @@ -0,0 +1,7 @@ +// Check type inference + +Complex Z = 1 + 2im + +{ + Float a = Z^2 // expect error 'TypeErr' +} diff --git a/test/complex/types/type_complex_types.morpho b/test/complex/types/type_complex_types.morpho new file mode 100644 index 000000000..f588e6685 --- /dev/null +++ b/test/complex/types/type_complex_types.morpho @@ -0,0 +1,18 @@ +// Check type detection for add + +{ + Complex a = 1+1im + + Float b = a.real() + Float c = a.imag() + Float d = a.abs() + Float e = a.angle() + + Complex f = a + a + Complex g = a - a + Complex h = a * a + Complex p = a / a + Complex q = a ^ a +} + +print "ok" // expect: ok From 17f57b124fe5f6e623e5c3c7006e93a12251cb6d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 30 Nov 2025 17:58:21 -0500 Subject: [PATCH 086/473] Update version number --- src/build.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build.h b/src/build.h index 9c8e12c7a..4c5f4bb35 100644 --- a/src/build.h +++ b/src/build.h @@ -10,11 +10,11 @@ * Version * ********************************************************************** */ -#define MORPHO_VERSIONSTRING "0.6.3" +#define MORPHO_VERSIONSTRING "0.6.4" #define MORPHO_VERSION_MAJOR 0 #define MORPHO_VERSION_MINOR 6 -#define MORPHO_VERSION_PATCH 3 +#define MORPHO_VERSION_PATCH 4 /* ********************************************************************** * Paths and file system From ad08cf12c63b55a2075662ff4b8a593b9254a199 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 30 Nov 2025 19:50:30 -0500 Subject: [PATCH 087/473] vm_invoke can redirect veneer class calls to metafunctions --- src/core/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/vm.c b/src/core/vm.c index 915fcf473..7b9989986 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -577,7 +577,7 @@ static inline bool vm_invoke(vm *v, value obj, value method, int nargs, value *a for (unsigned int i=0; ifunction) (v, nargs, sargs); return true; - } + } else return morpho_invoke(v, obj, ifunc, nargs, args, out); } } } From cf37b900444862a51c069f8c78bbf63e44144739 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 30 Nov 2025 20:02:35 -0500 Subject: [PATCH 088/473] Printing, getting and setting implementation --- CMakeLists.txt | 2 +- src/xmatrix.c | 124 +++++++++++++++++++++++++++++++++++++----- src/xmatrix.h | 12 ++++ test/newlinalg.morpho | 12 ++-- 4 files changed, 132 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d0630fd6..e53fa9a27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ find_library(MORPHO_LIBRARY NAMES morpho libmorpho ) -target_link_libraries(newlinalg ${MORPHO_LIBRARY} ${ZMQ_LIBRARY} ${CZMQ_LIBRARY}) +target_link_libraries(newlinalg ${MORPHO_LIBRARY}) set(CMAKE_INSTALL_PREFIX ..) diff --git a/src/xmatrix.c b/src/xmatrix.c index 56d5b4e3a..9ba74122f 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -5,7 +5,10 @@ */ #include "newlinalg.h" -#include "xmatrix.h" +#include "xmatrix.h" + +#define MORPHO_INCLUDE_LINALG +#include /* ********************************************************************** * XMatrix objects @@ -36,6 +39,10 @@ objecttypedefn objectxmatrixdefn = { * XMatrix utility functions * ********************************************************************** */ +/* ---------------------- + * Constructors + * ---------------------- */ + objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { int nels = nrows*ncols; objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), OBJECT_XMATRIX); @@ -51,34 +58,65 @@ objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { return new; } +/* ---------------------- + * Accessing elements + * ---------------------- */ + +/** @brief Sets a matrix element. + @returns true if the element is in the range of the matrix, false otherwise */ +bool xmatrix_setelement(objectxmatrix *matrix, unsigned int row, unsigned int col, double value) { + if (!(colncols && rownrows)) return false; + + matrix->elements[col*matrix->nrows+row]=value; + return true; +} + +/** @brief Gets a matrix element + * @returns true if the element is in the range of the matrix, false otherwise */ +bool xmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int col, double *value) { + if (!(colncols && rownrows)) return false; + + if (value) *value=matrix->elements[col*matrix->nrows+row]; + return true; +} + +/* ---------------------- + * Display + * ---------------------- */ + +/** Prints a matrix */ +void xmatrix_print(vm *v, objectxmatrix *m) { + for (int i=0; inrows; i++) { // Rows run from 0...m + morpho_printf(v, "[ "); + for (int j=0; jncols; j++) { // Columns run from 0...k + double val=0.0; + xmatrix_getelement(m, i, j, &val); + morpho_printf(v, "%g ", (fabs(val)nrows-1 ? "\n" : "")); + } +} + + /* ********************************************************************** * XMatrix constructor * ********************************************************************** */ value xmatrix_constructor(vm *v, int nargs, value *args) { - value out=MORPHO_NIL; - int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); objectxmatrix *new=xmatrix_new(nrows, ncols, true); - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - - return out; + return morpho_wrapandbind(v, (object *) new); } value xmatrix_list_constructor(vm *v, int nargs, value *args) { - - return MORPHO_NIL; } value xmatrix_invalid_constructor(vm *v, int nargs, value *args) { - morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); + //morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); return MORPHO_NIL; } @@ -86,12 +124,72 @@ value xmatrix_invalid_constructor(vm *v, int nargs, value *args) { * XMatrix veneer class * ********************************************************************** */ +/** Prints a matrix */ +value XMatrix_print(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + xmatrix_print(v, m); + return MORPHO_NIL; +} + value XMatrix_add(vm *v, int nargs, value *args) { return MORPHO_NIL; } +/* --------- + * index() + * --------- */ + +value _getindex(vm *v, objectxmatrix *m, unsigned int i, unsigned int j) { + double out; + if (xmatrix_getelement(m, i, j, &out)) return MORPHO_FLOAT(out); + //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); + return MORPHO_NIL; +} + +value XMatrix_index__int(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _getindex(v, m, i, 0); +} + +value XMatrix_index__int_int(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + unsigned int j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _getindex(v, m, i, j); +} + +/* --------- + * setindex() + * --------- */ + +value _setindex(vm *v, objectxmatrix *m, unsigned int i, unsigned int j, value in) { + double val=0.0; + if (!morpho_valuetofloat(in, &val)) true; // Should raise an error (Matrix doesn't!) + if (!xmatrix_setelement(m, i, j, val)) true; //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); + return MORPHO_NIL; +} + +value XMatrix_setindex__int(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _setindex(v, m, i, 0, MORPHO_GETARG(args, 1)); +} + +value XMatrix_setindex__int_int(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + unsigned int j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _setindex(v, m, i, j, MORPHO_GETARG(args, 2)); +} + MORPHO_BEGINCLASS(XMatrix) -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.h b/src/xmatrix.h index a4a2006f6..48951f291 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -14,6 +14,12 @@ extern objecttype objectxmatrixtype; #define OBJECT_XMATRIX objectxmatrixtype +/** Matrices are a purely numerical collection type oriented toward linear algebra. + Elements are stored in column-major format, i.e. + [ 1 2 ] + [ 3 4 ] + is stored ( 1, 3, 2, 4 ) in memory. This is for compatibility with standard linear algebra packages */ + typedef struct { object obj; int nrows; @@ -23,6 +29,12 @@ typedef struct { double matrixdata[]; } objectxmatrix; +/** Tests whether an object is a matrix */ +#define MORPHO_ISXMATRIX(val) object_istype(val, OBJECT_XMATRIX) + +/** Gets the object as an matrix */ +#define MORPHO_GETXMATRIX(val) ((objectxmatrix *) MORPHO_GETOBJECT(val)) + /* ------------------------------------------------------- * Matrix veneer class * ------------------------------------------------------- */ diff --git a/test/newlinalg.morpho b/test/newlinalg.morpho index 58b69eed7..c84768486 100644 --- a/test/newlinalg.morpho +++ b/test/newlinalg.morpho @@ -1,8 +1,12 @@ import newlinalg -var a = XMatrix(2,2) -//var b = XMatrix([1,2,3]) - +var a = XMatrix(2,1) +a[0]=1 print a -//print b + +var b = XMatrix(2,2) +b[0,0]=1 +print b +print b[0] +print b[0,0] From bd9873efd8f4d49d12d69f0c46e75d683ce8c582 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 30 Nov 2025 20:08:40 -0500 Subject: [PATCH 089/473] Correct function labelling --- src/xmatrix.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index 9ba74122f..0acc5591b 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -4,12 +4,11 @@ * @brief New matrices */ +#define MORPHO_INCLUDE_LINALG + #include "newlinalg.h" #include "xmatrix.h" -#define MORPHO_INCLUDE_LINALG -#include - /* ********************************************************************** * XMatrix objects * ********************************************************************** */ @@ -97,12 +96,11 @@ void xmatrix_print(vm *v, objectxmatrix *m) { } } - /* ********************************************************************** * XMatrix constructor * ********************************************************************** */ -value xmatrix_constructor(vm *v, int nargs, value *args) { +value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -111,12 +109,12 @@ value xmatrix_constructor(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -value xmatrix_list_constructor(vm *v, int nargs, value *args) { +value xmatrix_constructor__list(vm *v, int nargs, value *args) { return MORPHO_NIL; } -value xmatrix_invalid_constructor(vm *v, int nargs, value *args) { - //morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); +value xmatrix_constructor__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); return MORPHO_NIL; } @@ -170,13 +168,13 @@ value _setindex(vm *v, objectxmatrix *m, unsigned int i, unsigned int j, value i return MORPHO_NIL; } -value XMatrix_setindex__int(vm *v, int nargs, value *args) { +value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); return _setindex(v, m, i, 0, MORPHO_GETARG(args, 1)); } -value XMatrix_setindex__int_int(vm *v, int nargs, value *args) { +value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); unsigned int j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -188,8 +186,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSE MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** @@ -203,8 +201,8 @@ void xmatrix_initialize(void) { object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_list_constructor, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_invalid_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); } From d8e497719839e3e3755ec4cfd955667e8d974c8f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 30 Nov 2025 20:37:01 -0500 Subject: [PATCH 090/473] Include BLAS and LAPACK Update CMakeLists --- CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++++++++- src/xmatrix.c | 51 ++++++++++++++++++++++++++++++++++++++++--- test/newlinalg.morpho | 6 +++++ 3 files changed, 101 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e53fa9a27..3b3a88019 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,9 @@ set_target_properties(newlinalg PROPERTIES PREFIX "") # Add sources add_subdirectory(src) -### +#------------------------------------------------------------------------------- +# Morpho library +#------------------------------------------------------------------------------- # Locate the morpho.h header file and store in MORPHO_HEADER find_file(MORPHO_HEADER @@ -48,6 +50,50 @@ find_library(MORPHO_LIBRARY target_link_libraries(newlinalg ${MORPHO_LIBRARY}) +#------------------------------------------------------------------------------- +# BLAS and LAPACK +#------------------------------------------------------------------------------- + +message(STATUS "Searching for BLAS and LAPACK") +# Locate a lapack version +# Currently we prefer LAPACKE +# TODO: Fix morpho source to select between lapack and lapacke +find_library(LAPACK_LIBRARY + NAMES lapacke liblapacke lapack liblapack libopenblas + HINTS + "C:\\Program Files\\Morpho\\lib\\" +) +if (LAPACK_LIBRARY) +message(STATUS "Found LAPACK at ${LAPACK_LIBRARY}") +endif() + +# Locate cblas +find_library(CBLAS_LIBRARY + NAMES cblas libcblas blas libblas openblas libopenblas + HINTS + "C:\\Program Files\\Morpho\\lib\\" +) +if (CBLAS_LIBRARY) +message(STATUS "Found blas at ${CBLAS_LIBRARY}") +endif() + +# Find cblas.h header file +find_path(CBLAS_INCLUDE cblas.h + HINTS + "C:\\Program Files\\Morpho\\include\\lapack") + +# Add cblas headers to include folders +target_include_directories(newlinalg PUBLIC ${CBLAS_INCLUDE}) + +message(STATUS "Found cblas headers at ${CBLAS_INCLUDE}") + +target_link_libraries(newlinalg ${CBLAS_LIBRARY}) +target_link_libraries(newlinalg ${LAPACK_LIBRARY}) + +#------------------------------------------------------------------------------- +# Install +#------------------------------------------------------------------------------- + set(CMAKE_INSTALL_PREFIX ..) # Install the resulting binary diff --git a/src/xmatrix.c b/src/xmatrix.c index 0acc5591b..25795eaed 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -79,6 +79,33 @@ bool xmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int co return true; } +/* ---------------------- + * Arithmetic operations + * ---------------------- */ + +/** Performs a + b -> out. */ +objectmatrixerror xmatrix_add(objectxmatrix *a, objectxmatrix *b, objectxmatrix *out) { + if (a->ncols==b->ncols && a->ncols==out->ncols && + a->nrows==b->nrows && a->nrows==out->nrows) { + if (a!=out) cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); + cblas_daxpy(a->ncols * a->nrows, 1.0, b->elements, 1, out->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Performs lambda*a + beta -> out. */ +objectmatrixerror xmatrix_addscalar(objectxmatrix *a, double lambda, double beta, objectxmatrix *out) { + if (a->ncols==out->ncols && a->nrows==out->nrows) { + for (unsigned int i=0; inrows*out->ncols; i++) { + out->elements[i]=lambda*a->elements[i]+beta; + } + return MATRIX_OK; + } + + return MATRIX_INCMPTBLDIM; +} + /* ---------------------- * Display * ---------------------- */ @@ -129,8 +156,25 @@ value XMatrix_print(vm *v, int nargs, value *args) { return MORPHO_NIL; } -value XMatrix_add(vm *v, int nargs, value *args) { - return MORPHO_NIL; +/* --------- + * add() + * --------- */ + +value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectxmatrix *new = NULL; + value out=MORPHO_NIL; + + if (a->ncols==b->ncols && a->nrows==b->nrows) { + new=xmatrix_new(a->nrows, a->ncols, false); + if (new) { + xmatrix_add(a, b, new); + out = morpho_wrapandbind(v, (object *) new); + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + + return out; } /* --------- @@ -183,7 +227,8 @@ value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), +//MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/test/newlinalg.morpho b/test/newlinalg.morpho index c84768486..d75212d2d 100644 --- a/test/newlinalg.morpho +++ b/test/newlinalg.morpho @@ -7,6 +7,12 @@ print a var b = XMatrix(2,2) b[0,0]=1 +b[0,1]=2 +b[1,0]=3 +b[1,1]=4 + print b print b[0] print b[0,0] + +print b+b From acb255a5e61044f620866880401e4cfe34a08392 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 30 Nov 2025 21:39:26 -0500 Subject: [PATCH 091/473] Simplify interfaces and add cloning --- src/xcomplexmatrix.c | 22 +++++++++++ src/xcomplexmatrix.h | 2 + src/xmatrix.c | 79 +++++++++++++++++++++++++-------------- src/xmatrix.h | 2 + test/complexmatrix.morpho | 5 +++ test/newlinalg.morpho | 6 +++ 6 files changed, 88 insertions(+), 28 deletions(-) create mode 100644 test/complexmatrix.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index e0d848917..0be53b5a5 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -5,3 +5,25 @@ */ #include "xcomplexmatrix.h" + +objecttype objectcomplexmatrixtype; + +//typedef objectxmatrix objectcomplexmatrix; + +/* ********************************************************************** + * ComplexMatrix veneer class + * ********************************************************************** */ + +/* + MORPHO_BEGINCLASS(ComplexMatrix) + MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY) + MORPHO_ENDCLASS + */ + +/* ********************************************************************** + * Initialization + * ********************************************************************** */ + +void complexmatrix_initialize(void) { + objectcomplexmatrixtype=object_addtype(&objectxmatrixdefn); +} diff --git a/src/xcomplexmatrix.h b/src/xcomplexmatrix.h index 7cfb91423..fbce1b36f 100644 --- a/src/xcomplexmatrix.h +++ b/src/xcomplexmatrix.h @@ -9,4 +9,6 @@ #include "newlinalg.h" +void complexmatrix_initialize(void); + #endif diff --git a/src/xmatrix.c b/src/xmatrix.c index 25795eaed..a2ea6e676 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -4,10 +4,12 @@ * @brief New matrices */ +#define ACCELERATE_NEW_LAPACK #define MORPHO_INCLUDE_LINALG #include "newlinalg.h" -#include "xmatrix.h" +#include "xmatrix.h" +#include "xcomplexmatrix.h" /* ********************************************************************** * XMatrix objects @@ -42,6 +44,7 @@ objecttypedefn objectxmatrixdefn = { * Constructors * ---------------------- */ +/** Create a new matrix */ objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { int nels = nrows*ncols; objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), OBJECT_XMATRIX); @@ -57,6 +60,14 @@ objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { return new; } +/** Clone a matrix */ +objectxmatrix *xmatrix_clone(objectxmatrix *in) { + objectxmatrix *new = xmatrix_new(in->nrows, in->ncols, false); + + if (new) cblas_dcopy(in->ncols * in->nrows, in->elements, 1, new->elements, 1); + return new; +} + /* ---------------------- * Accessing elements * ---------------------- */ @@ -83,26 +94,14 @@ bool xmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int co * Arithmetic operations * ---------------------- */ -/** Performs a + b -> out. */ -objectmatrixerror xmatrix_add(objectxmatrix *a, objectxmatrix *b, objectxmatrix *out) { - if (a->ncols==b->ncols && a->ncols==out->ncols && - a->nrows==b->nrows && a->nrows==out->nrows) { - if (a!=out) cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); - cblas_daxpy(a->ncols * a->nrows, 1.0, b->elements, 1, out->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; -} - -/** Performs lambda*a + beta -> out. */ -objectmatrixerror xmatrix_addscalar(objectxmatrix *a, double lambda, double beta, objectxmatrix *out) { - if (a->ncols==out->ncols && a->nrows==out->nrows) { - for (unsigned int i=0; inrows*out->ncols; i++) { - out->elements[i]=lambda*a->elements[i]+beta; - } +/** Performs out <- alpha*x + y */ +objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y, objectxmatrix *out) { + if (x->ncols==y->ncols && y->ncols==out->ncols && + x->nrows==y->nrows && y->nrows==out->nrows) { + if (x!=out) cblas_dcopy(x->ncols * x->nrows, x->elements, 1, out->elements, 1); + cblas_daxpy(x->ncols * x->nrows, alpha, y->elements, 1, out->elements, 1); return MATRIX_OK; } - return MATRIX_INCMPTBLDIM; } @@ -149,6 +148,10 @@ value xmatrix_constructor__err(vm *v, int nargs, value *args) { * XMatrix veneer class * ********************************************************************** */ +/* ---------------------- + * Common utility methods + * ---------------------- */ + /** Prints a matrix */ value XMatrix_print(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -156,11 +159,22 @@ value XMatrix_print(vm *v, int nargs, value *args) { return MORPHO_NIL; } -/* --------- - * add() - * --------- */ +/** Clones a matrix */ +value XMatrix_clone(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *new=xmatrix_clone(a); + if (new) { + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return out; +} -value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { +/* ---------- + * Arithmetic + * ---------- */ + +static value _axpy(vm *v, int nargs, value *args, double alpha) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); objectxmatrix *new = NULL; @@ -169,7 +183,7 @@ value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { if (a->ncols==b->ncols && a->nrows==b->nrows) { new=xmatrix_new(a->nrows, a->ncols, false); if (new) { - xmatrix_add(a, b, new); + xmatrix_axpy(alpha, a, b, new); out = morpho_wrapandbind(v, (object *) new); } } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); @@ -177,11 +191,19 @@ value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { return out; } +value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { + return _axpy(v,nargs,args,1.0); +} + +value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { + return _axpy(v,nargs,args,-1.0); +} + /* --------- * index() * --------- */ -value _getindex(vm *v, objectxmatrix *m, unsigned int i, unsigned int j) { +static value _getindex(vm *v, objectxmatrix *m, unsigned int i, unsigned int j) { double out; if (xmatrix_getelement(m, i, j, &out)) return MORPHO_FLOAT(out); //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); @@ -227,8 +249,9 @@ value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -//MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "(XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), @@ -243,11 +266,11 @@ void xmatrix_initialize(void) { objectxmatrixtype=object_addtype(&objectxmatrixdefn); value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), MORPHO_NIL); - object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + + complexmatrix_initialize(); } - diff --git a/src/xmatrix.h b/src/xmatrix.h index 48951f291..b8591d576 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -14,6 +14,8 @@ extern objecttype objectxmatrixtype; #define OBJECT_XMATRIX objectxmatrixtype +extern objecttypedefn objectxmatrixdefn; + /** Matrices are a purely numerical collection type oriented toward linear algebra. Elements are stored in column-major format, i.e. [ 1 2 ] diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho new file mode 100644 index 000000000..c6928e2f0 --- /dev/null +++ b/test/complexmatrix.morpho @@ -0,0 +1,5 @@ + +import newlinalg + +var a = ComplexMatrix(2,2) +print a diff --git a/test/newlinalg.morpho b/test/newlinalg.morpho index d75212d2d..3e9176e22 100644 --- a/test/newlinalg.morpho +++ b/test/newlinalg.morpho @@ -16,3 +16,9 @@ print b[0] print b[0,0] print b+b + +print b-b + +var c = b.clone() + +print b+c From 707077c85b554fdd7b322c24d1ab3fd2b4aa04db Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 1 Dec 2025 22:21:22 -0500 Subject: [PATCH 092/473] Helper functions and changes to aid buildit integration --- src/builtin/builtin.h | 4 ++-- src/datastructures/object.c | 4 ++-- src/datastructures/program.c | 10 ++++++++++ src/datastructures/program.h | 3 ++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index fee186786..1f381ff23 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -144,11 +144,11 @@ bool builtin_enumerateloop(vm *v, value obj, builtin_loopfunction fn, void *ref) * Veneer classes * ------------------------------------------------------- */ -void object_setveneerclass(objecttype type, value class); +void object_setveneerclass(objecttype type, value klass); objectclass *object_getveneerclass(objecttype type); bool object_veneerclasstotype(objectclass *clss, objecttype *type); -void value_setveneerclass(value type, value class); +void value_setveneerclass(value type, value klass); objectclass *value_getveneerclass(value type); objectclass *value_veneerclassfromtype(int type); bool value_veneerclasstotype(objectclass *clss, int *type); diff --git a/src/datastructures/object.c b/src/datastructures/object.c index 063655e89..bab47ebec 100644 --- a/src/datastructures/object.c +++ b/src/datastructures/object.c @@ -131,11 +131,11 @@ void morpho_freeobject(value val) { * ********************************************************************** */ /** @brief Sets the veneer class for a particular object type */ -void object_setveneerclass(objecttype type, value class) { +void object_setveneerclass(objecttype type, value klass) { if (_objectdefns[type].veneer!=NULL) { UNREACHABLE("Veneer class redefined.\n"); } - _objectdefns[type].veneer=(object *) MORPHO_GETCLASS(class); + _objectdefns[type].veneer=(object *) MORPHO_GETCLASS(klass); } /** @brief Gets the veneer for a particular object type */ diff --git a/src/datastructures/program.c b/src/datastructures/program.c index dd13b3ea9..07e1cad2c 100644 --- a/src/datastructures/program.c +++ b/src/datastructures/program.c @@ -80,6 +80,16 @@ instructionindx program_getentry(program *p) { return out; } +/** Retrieves the bytecode associated with the program */ +varray_instruction *program_getbytecode(program *p) { + return &p->code; +} + +/** Retrieves the global function */ +objectfunction *program_getglobalfn(program *p) { + return p->global; +} + /** @brief Binds an object to a program * @details Objects bound to the program are freed with the program; use for static data (e.g. held in constant tables) */ void program_bindobject(program *p, object *obj) { diff --git a/src/datastructures/program.h b/src/datastructures/program.h index 6fc5394d1..00a166442 100644 --- a/src/datastructures/program.h +++ b/src/datastructures/program.h @@ -57,7 +57,8 @@ typedef struct { #define MORPHO_PROGRAMSTART 0 void program_setentry(program *p, instructionindx entry); instructionindx program_getentry(program *p); -varray_value *program_getconstanttable(program *p); +varray_instruction *program_getbytecode(program *p); +objectfunction *program_getglobalfn(program *p); void program_bindobject(program *p, object *obj); value program_internsymbol(program *p, value symbol); From 18d4c5138618271531d4416981fd348fd8bc5c3b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 3 Dec 2025 20:49:04 -0500 Subject: [PATCH 093/473] Complex matrix implementation --- src/xcomplexmatrix.c | 22 +++++++++++++++++++++- src/xmatrix.c | 2 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 0be53b5a5..59b98115a 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -5,10 +5,30 @@ */ #include "xcomplexmatrix.h" +#include objecttype objectcomplexmatrixtype; -//typedef objectxmatrix objectcomplexmatrix; +typedef objectxmatrix objectcomplexmatrix; + +/** Sets a matrix element. */ +bool complexmatrix_setelement(objectcomplexmatrix *matrix, unsigned int row, unsigned int col, MorphoComplex value) { + if (!(colncols && rownrows)) return false; + + unsigned int ix = col*matrix->nrows+row; + matrix->elements[ix]=creal(value); + matrix->elements[ix+1]=cimag(value); + return true; +} + +/** Gets a matrix element */ +bool complexmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int col, MorphoComplex *value) { + if (!(colncols && rownrows)) return false; + + if (value) *value=MCBuild(0.0,0.0); + //matrix->elements[col*matrix->nrows+row]; + return true; +} /* ********************************************************************** * ComplexMatrix veneer class diff --git a/src/xmatrix.c b/src/xmatrix.c index a2ea6e676..38199df3d 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -123,7 +123,7 @@ void xmatrix_print(vm *v, objectxmatrix *m) { } /* ********************************************************************** - * XMatrix constructor + * XMatrix constructors * ********************************************************************** */ value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { From 3dba2e430131796d1a82cda8464754aaa3efc46e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 4 Dec 2025 20:49:22 -0500 Subject: [PATCH 094/473] Change type definitions --- src/xcomplexmatrix.c | 38 ++++++++++++++++++++++++++++++++------ src/xcomplexmatrix.h | 6 ++++++ src/xmatrix.c | 38 +++++++++++++++++++++----------------- src/xmatrix.h | 10 +++++++--- 4 files changed, 66 insertions(+), 26 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 59b98115a..a957cbd09 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -8,6 +8,7 @@ #include objecttype objectcomplexmatrixtype; +#define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype typedef objectxmatrix objectcomplexmatrix; @@ -15,7 +16,7 @@ typedef objectxmatrix objectcomplexmatrix; bool complexmatrix_setelement(objectcomplexmatrix *matrix, unsigned int row, unsigned int col, MorphoComplex value) { if (!(colncols && rownrows)) return false; - unsigned int ix = col*matrix->nrows+row; + int ix = 2*(col*matrix->nrows+row); matrix->elements[ix]=creal(value); matrix->elements[ix+1]=cimag(value); return true; @@ -25,20 +26,40 @@ bool complexmatrix_setelement(objectcomplexmatrix *matrix, unsigned int row, uns bool complexmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int col, MorphoComplex *value) { if (!(colncols && rownrows)) return false; + int ix = 2*(col*matrix->nrows+row); if (value) *value=MCBuild(0.0,0.0); //matrix->elements[col*matrix->nrows+row]; return true; } +/* ********************************************************************** + * ComplexMatrix constructors + * ********************************************************************** */ + +value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { + int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + + objectcomplexmatrix *new=NULL; //xmatrix_new(nrows, ncols, true); + + return morpho_wrapandbind(v, (object *) new); +} + /* ********************************************************************** * ComplexMatrix veneer class * ********************************************************************** */ -/* - MORPHO_BEGINCLASS(ComplexMatrix) - MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY) - MORPHO_ENDCLASS - */ +value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + unsigned int j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + //return _getindex(v, m, i, j); + return MORPHO_NIL; +} + +MORPHO_BEGINCLASS(ComplexMatrix) +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS /* ********************************************************************** * Initialization @@ -46,4 +67,9 @@ bool complexmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned void complexmatrix_initialize(void) { objectcomplexmatrixtype=object_addtype(&objectxmatrixdefn); + + value complexmatrixclass=builtin_addclass(COMPLEXMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexMatrix), MORPHO_NIL); + object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); + + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); } diff --git a/src/xcomplexmatrix.h b/src/xcomplexmatrix.h index fbce1b36f..71d50ee2e 100644 --- a/src/xcomplexmatrix.h +++ b/src/xcomplexmatrix.h @@ -9,6 +9,12 @@ #include "newlinalg.h" +/* ------------------------------------------------------- + * ComplexMatrix veneer class + * ------------------------------------------------------- */ + +#define COMPLEXMATRIX_CLASSNAME "ComplexMatrix" + void complexmatrix_initialize(void); #endif diff --git a/src/xmatrix.c b/src/xmatrix.c index 38199df3d..da79afbfa 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -19,8 +19,7 @@ objecttype objectxmatrixtype; /** Matrix object definitions */ size_t objectxmatrix_sizefn(object *obj) { - return sizeof(objectxmatrix)+sizeof(double) * - ((objectxmatrix *) obj)->nels; + return sizeof(objectxmatrix)+sizeof(double) * ((objectxmatrix *) obj)->nels; } void objectxmatrix_printfn(object *obj, void *v) { @@ -45,13 +44,14 @@ objecttypedefn objectxmatrixdefn = { * ---------------------- */ /** Create a new matrix */ -objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { - int nels = nrows*ncols; - objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), OBJECT_XMATRIX); +objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { + MatrixCount_t nels = nrows*ncols*nvals; + objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), type); if (new) { new->nrows=nrows; new->ncols=ncols; + new->nvals=nvals; new->nels=nels; new->elements=new->matrixdata; if (zero) memset(new->elements, 0, nels*sizeof(double)); @@ -60,6 +60,10 @@ objectxmatrix *xmatrix_new(int nrows, int ncols, bool zero) { return new; } +objectxmatrix *xmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { + return xmatrix_newwithtype(OBJECT_XMATRIX, nrows, ncols, 1, zero); +} + /** Clone a matrix */ objectxmatrix *xmatrix_clone(objectxmatrix *in) { objectxmatrix *new = xmatrix_new(in->nrows, in->ncols, false); @@ -74,7 +78,7 @@ objectxmatrix *xmatrix_clone(objectxmatrix *in) { /** @brief Sets a matrix element. @returns true if the element is in the range of the matrix, false otherwise */ -bool xmatrix_setelement(objectxmatrix *matrix, unsigned int row, unsigned int col, double value) { +bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { if (!(colncols && rownrows)) return false; matrix->elements[col*matrix->nrows+row]=value; @@ -83,7 +87,7 @@ bool xmatrix_setelement(objectxmatrix *matrix, unsigned int row, unsigned int co /** @brief Gets a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -bool xmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int col, double *value) { +bool xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { if (!(colncols && rownrows)) return false; if (value) *value=matrix->elements[col*matrix->nrows+row]; @@ -111,9 +115,9 @@ objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y, /** Prints a matrix */ void xmatrix_print(vm *v, objectxmatrix *m) { - for (int i=0; inrows; i++) { // Rows run from 0...m + for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); - for (int j=0; jncols; j++) { // Columns run from 0...k + for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k double val=0.0; xmatrix_getelement(m, i, j, &val); morpho_printf(v, "%g ", (fabs(val) Date: Thu, 4 Dec 2025 21:14:41 -0500 Subject: [PATCH 095/473] Constructor for ComplexMatrix --- src/xcomplexmatrix.c | 34 +++++++++++++++++++++++++--------- src/xmatrix.c | 5 +++-- src/xmatrix.h | 6 ++++++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index a957cbd09..79f5b05a1 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -12,23 +12,39 @@ objecttype objectcomplexmatrixtype; typedef objectxmatrix objectcomplexmatrix; +/* ********************************************************************** + * ComplexMatrix utility functions + * ********************************************************************** */ + +/* ---------------------- + * Constructor + * ---------------------- */ + +/** Create a new complex matrix */ +objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { + return (objectcomplexmatrix *) xmatrix_newwithtype(OBJECT_COMPLEXMATRIX, nrows, ncols, 2, zero); +} + +/* ---------------------- + * Element access + * ---------------------- */ + /** Sets a matrix element. */ -bool complexmatrix_setelement(objectcomplexmatrix *matrix, unsigned int row, unsigned int col, MorphoComplex value) { +bool complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { if (!(colncols && rownrows)) return false; - int ix = 2*(col*matrix->nrows+row); + MatrixCount_t ix = 2*(col*matrix->nrows+row); matrix->elements[ix]=creal(value); matrix->elements[ix+1]=cimag(value); return true; } /** Gets a matrix element */ -bool complexmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned int col, MorphoComplex *value) { +bool complexmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { if (!(colncols && rownrows)) return false; - int ix = 2*(col*matrix->nrows+row); - if (value) *value=MCBuild(0.0,0.0); - //matrix->elements[col*matrix->nrows+row]; + MatrixCount_t ix = 2*(col*matrix->nrows+row); + if (value) *value=MCBuild(matrix->elements[ix],matrix->elements[ix+1]); return true; } @@ -37,10 +53,10 @@ bool complexmatrix_getelement(objectxmatrix *matrix, unsigned int row, unsigned * ********************************************************************** */ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { - int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + MatrixIdx_t ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - objectcomplexmatrix *new=NULL; //xmatrix_new(nrows, ncols, true); + objectcomplexmatrix *new=complexmatrix_new(nrows, ncols, true); return morpho_wrapandbind(v, (object *) new); } diff --git a/src/xmatrix.c b/src/xmatrix.c index da79afbfa..7501bc490 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -43,7 +43,7 @@ objecttypedefn objectxmatrixdefn = { * Constructors * ---------------------- */ -/** Create a new matrix */ +/** Create a generic matrix with given type and layout */ objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { MatrixCount_t nels = nrows*ncols*nvals; objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), type); @@ -60,13 +60,14 @@ objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx return new; } +/** Create a new real matrix */ objectxmatrix *xmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { return xmatrix_newwithtype(OBJECT_XMATRIX, nrows, ncols, 1, zero); } /** Clone a matrix */ objectxmatrix *xmatrix_clone(objectxmatrix *in) { - objectxmatrix *new = xmatrix_new(in->nrows, in->ncols, false); + objectxmatrix *new = xmatrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); if (new) cblas_dcopy(in->ncols * in->nrows, in->elements, 1, new->elements, 1); return new; diff --git a/src/xmatrix.h b/src/xmatrix.h index 5468b357a..e180a413b 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -49,4 +49,10 @@ typedef struct { void xmatrix_initialize(void); +/* ------------------------------------------------------- + * Interface + * ------------------------------------------------------- */ + +objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); + #endif From 519f14a7cad9b8cd8bf58f744fe7a9e6d12c2916 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 4 Dec 2025 21:34:51 -0500 Subject: [PATCH 096/473] Generic objectxmatrix_printfn --- src/xmatrix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index 7501bc490..e99d9162f 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -23,7 +23,10 @@ size_t objectxmatrix_sizefn(object *obj) { } void objectxmatrix_printfn(object *obj, void *v) { - morpho_printf(v, "<" XMATRIX_CLASSNAME ">"); + objectclass *klass=object_getveneerclass(obj->type); + morpho_printf(v, "<"); + morpho_printvalue(v, klass->name); + morpho_printf(v, ">"); } objecttypedefn objectxmatrixdefn = { From 269be269568951878f97d376882b732e6e7fc113 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 4 Dec 2025 21:39:20 -0500 Subject: [PATCH 097/473] Correct indices --- src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 79f5b05a1..e97b65dc8 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -33,7 +33,7 @@ objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, boo bool complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { if (!(colncols && rownrows)) return false; - MatrixCount_t ix = 2*(col*matrix->nrows+row); + MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); matrix->elements[ix]=creal(value); matrix->elements[ix+1]=cimag(value); return true; diff --git a/src/xmatrix.c b/src/xmatrix.c index e99d9162f..2f7a7814c 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -85,7 +85,7 @@ objectxmatrix *xmatrix_clone(objectxmatrix *in) { bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { if (!(colncols && rownrows)) return false; - matrix->elements[col*matrix->nrows+row]=value; + matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; return true; } @@ -94,7 +94,7 @@ bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, bool xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { if (!(colncols && rownrows)) return false; - if (value) *value=matrix->elements[col*matrix->nrows+row]; + if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; return true; } From e1b2aa9051f052d0174b13ed2c678b0b022d6774 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 5 Dec 2025 07:39:47 -0500 Subject: [PATCH 098/473] Printing of ComplexMatrix type --- src/xcomplexmatrix.c | 47 ++++++++++++++++++++++++++++++++++++--- src/xmatrix.c | 29 +++++++++++++++++++----- src/xmatrix.h | 12 ++++++++++ test/complexmatrix.morpho | 6 +++++ 4 files changed, 86 insertions(+), 8 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index e97b65dc8..fcbd3a1bf 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -16,6 +16,17 @@ typedef objectxmatrix objectcomplexmatrix; * ComplexMatrix utility functions * ********************************************************************** */ +/* ---------------------- + * Callbacks + * ---------------------- */ + +static void _printelfn(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { + double *elptr; + xmatrix_getelementptr(m, i, j, &elptr); + objectcomplex cmplx = MORPHO_STATICCOMPLEX(elptr[0], elptr[1]); + complex_print(v, &cmplx); +} + /* ---------------------- * Constructor * ---------------------- */ @@ -40,7 +51,7 @@ bool complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, Matr } /** Gets a matrix element */ -bool complexmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { +bool complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { if (!(colncols && rownrows)) return false; MatrixCount_t ix = 2*(col*matrix->nrows+row); @@ -65,15 +76,45 @@ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { * ComplexMatrix veneer class * ********************************************************************** */ +/* ---------------------- + * Common utility methods + * ---------------------- */ + +/** Prints a matrix */ +value ComplexMatrix_print(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + xmatrix_print(v, m, _printelfn); + return MORPHO_NIL; +} + +/* --------- + * index() + * --------- */ + +static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { + double *el; + xmatrix_getelementptr(m, i, j, &el); //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); + objectcomplex *new = object_newcomplex(el[0], el[1]); + return morpho_wrapandbind(v, (object *) new); + return MORPHO_NIL; +} + +value ComplexMatrix_index__int(vm *v, int nargs, value *args) { + objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _getindex(v, m, i, 0); +} + value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); unsigned int j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - //return _getindex(v, m, i, j); - return MORPHO_NIL; + return _getindex(v, m, i, j); } MORPHO_BEGINCLASS(ComplexMatrix) +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", ComplexMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/xmatrix.c b/src/xmatrix.c index 2f7a7814c..2b460238d 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -42,6 +42,16 @@ objecttypedefn objectxmatrixdefn = { * XMatrix utility functions * ********************************************************************** */ +/* ---------------------- + * XMatrix callbacks + * ---------------------- */ + +static void _printelfn(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { + double val; + xmatrix_getelement(m, i, j, &val); + morpho_printf(v, "%g", (fabs(val)ncols && rownrows)) return false; + + if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); + return true; +} + /* ---------------------- * Arithmetic operations * ---------------------- */ @@ -118,13 +137,12 @@ objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y, * ---------------------- */ /** Prints a matrix */ -void xmatrix_print(vm *v, objectxmatrix *m) { +void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_elprintfn fn) { for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - double val=0.0; - xmatrix_getelement(m, i, j, &val); - morpho_printf(v, "%g ", (fabs(val)nrows-1 ? "\n" : "")); } @@ -163,7 +181,7 @@ value xmatrix_constructor__err(vm *v, int nargs, value *args) { /** Prints a matrix */ value XMatrix_print(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - xmatrix_print(v, m); + xmatrix_print(v, m, _printelfn); return MORPHO_NIL; } @@ -260,6 +278,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSE MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "(XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), +//MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "(Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index e180a413b..72d01929a 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -41,6 +41,12 @@ typedef struct { /** Gets the object as an matrix */ #define MORPHO_GETXMATRIX(val) ((objectxmatrix *) MORPHO_GETOBJECT(val)) +/* ------------------------------------------------------- + * Matrix callback types + * ------------------------------------------------------- */ + +typedef void (*xmatrix_elprintfn) (vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j); + /* ------------------------------------------------------- * Matrix veneer class * ------------------------------------------------------- */ @@ -55,4 +61,10 @@ void xmatrix_initialize(void); objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); +bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); +bool xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); +bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); + +void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_elprintfn fn); + #endif diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index c6928e2f0..51399550a 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -1,5 +1,11 @@ import newlinalg +var a = XMatrix(2,2) +print a + var a = ComplexMatrix(2,2) print a + +print a[0] +print a[0,0] \ No newline at end of file From 4db276748ba01f66dd1f816ef2ab31ce69059d65 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:59:33 -0500 Subject: [PATCH 099/473] Add elementid() function --- src/geometry/functional.c | 13 +++++++++++++ src/geometry/functional.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 5f4eb0ce5..026317f29 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -3990,6 +3990,17 @@ objectintegralelementref *integral_getelementref(vm *v) { return NULL; } +/* --------- + * Elementid + * --------- */ + +static value integral_elementid(vm *v, int nargs, value *args) { + objectintegralelementref *elref = integral_getelementref(v); + if (!elref) { morpho_runtimeerror(v, INTEGRAL_SPCLFN, ELEMENTID_FUNCTION); return MORPHO_NIL; } + + return MORPHO_INTEGER(elref->id); +} + /* -------- * Tangent * -------- */ @@ -4036,6 +4047,7 @@ int normlhandle; // TL storage handle for normal vectors /** Evaluates the normal vector */ void integral_evaluatenormal(vm *v, value *out) { objectintegralelementref *elref = integral_getelementref(v); + if (!elref) { morpho_runtimeerror(v, INTEGRAL_SPCLFN, NORMAL_FUNCTION); return; } int dim = elref->mesh->dim; @@ -5040,6 +5052,7 @@ void functional_initialize(void) { builtin_addclass(NEMATIC_CLASSNAME, MORPHO_GETCLASSDEFINITION(Nematic), objclass); builtin_addclass(NEMATICELECTRIC_CLASSNAME, MORPHO_GETCLASSDEFINITION(NematicElectric), objclass); + builtin_addfunction(ELEMENTID_FUNCTION, integral_elementid, BUILTIN_FLAGSEMPTY); builtin_addfunction(TANGENT_FUNCTION, integral_tangent, BUILTIN_FLAGSEMPTY); builtin_addfunction(NORMAL_FUNCTION, integral_normal, BUILTIN_FLAGSEMPTY); builtin_addfunction(GRAD_FUNCTION, integral_gradfn, BUILTIN_FLAGSEMPTY); diff --git a/src/geometry/functional.h b/src/geometry/functional.h index 0bf28b466..da19f32fd 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -56,6 +56,7 @@ #define FUNCTIONAL_INTEGRANDFORELEMENT_METHOD "integrandForElement" /* Special functions that can be used in integrands */ +#define ELEMENTID_FUNCTION "elementid" #define TANGENT_FUNCTION "tangent" #define NORMAL_FUNCTION "normal" #define GRAD_FUNCTION "grad" From 476240c035954764749109d093a02261f77f087a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 10 Dec 2025 22:19:47 -0500 Subject: [PATCH 100/473] Fix class identification in signature parsing. --- src/builtin/builtin.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index e965637d1..d880cfe3e 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -306,6 +306,7 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * builtin_bindobject(MORPHO_GETOBJECT(label)); objectclass *new = object_newclass(label); builtin_bindobject((object *) new); + bool success=true; if (!new) return false; @@ -340,7 +341,7 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * newmethod->name=object_stringfromcstring(desc[i].name, strlen(desc[i].name)); newmethod->flags=desc[i].flags; if (desc[i].signature) { - signature_parse(desc[i].signature, &newmethod->sig); + success &= signature_parse(desc[i].signature, &newmethod->sig); } dictionary_intern(&builtin_symboltable, newmethod->name); @@ -352,8 +353,8 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * } } - *out = MORPHO_OBJECT(new); - return true; + if (success)*out = MORPHO_OBJECT(new); + return success; } /** Defines a built in class (old interface) @@ -370,7 +371,8 @@ value builtin_addclass(char *name, builtinclassentry desc[], value superclass) { /** Finds a builtin class from its label */ value builtin_findclass(value name) { value out=MORPHO_NIL; - dictionary_get(&builtin_classtable, name, &out); + if (_currentclasstable) dictionary_get(_currentclasstable, name, &out); + if (MORPHO_ISNIL(out)) dictionary_get(&builtin_classtable, name, &out); return out; } From d076fdfde7d863605573d06fb674f2675b7d653d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 10 Dec 2025 22:50:48 -0500 Subject: [PATCH 101/473] Complex matrix addition --- src/xcomplexmatrix.c | 31 +++++++++++++++++- src/xmatrix.c | 68 ++++++++++++++++++++++++++++++++------- src/xmatrix.h | 3 ++ test/complexmatrix.morpho | 9 +++++- 4 files changed, 98 insertions(+), 13 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index fcbd3a1bf..0ca30b523 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -112,10 +112,39 @@ value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { return _getindex(v, m, i, j); } +/* --------- + * setIndex() + * --------- */ + +static value _setindex(vm *v, objectcomplexmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { + if (MORPHO_ISCOMPLEX(in) && + !complexmatrix_setelement(m, i, j, MORPHO_GETCOMPLEX(in)->Z)) { + // Should raise an error + } + return MORPHO_NIL; +} + +value ComplexMatrix_setindex__int_x(vm *v, int nargs, value *args) { + objectcomplexmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _setindex(v, m, i, 0, MORPHO_GETARG(args, 1)); +} + +value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { + objectcomplexmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _setindex(v, m, i, j, MORPHO_GETARG(args, 2)); +} + MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", ComplexMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.c b/src/xmatrix.c index 2b460238d..a5fff09fe 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -82,7 +82,7 @@ objectxmatrix *xmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { objectxmatrix *xmatrix_clone(objectxmatrix *in) { objectxmatrix *new = xmatrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); - if (new) cblas_dcopy(in->ncols * in->nrows, in->elements, 1, new->elements, 1); + if (new) cblas_dcopy((__LAPACK_int) in->nels, in->elements, 1, new->elements, 1); return new; } @@ -121,17 +121,32 @@ bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t c * Arithmetic operations * ---------------------- */ -/** Performs out <- alpha*x + y */ -objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y, objectxmatrix *out) { - if (x->ncols==y->ncols && y->ncols==out->ncols && - x->nrows==y->nrows && y->nrows==out->nrows) { - if (x!=out) cblas_dcopy(x->ncols * x->nrows, x->elements, 1, out->elements, 1); - cblas_daxpy(x->ncols * x->nrows, alpha, y->elements, 1, out->elements, 1); +/** Vector addition: Performs y <- alpha*x + y */ +objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { + if (x->ncols==y->ncols && x->nrows==y->nrows) { + cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); return MATRIX_OK; } return MATRIX_INCMPTBLDIM; } +/** Scales a matrix */ +objectmatrixerror xmatrix_scale(objectxmatrix *a, double scale) { + cblas_dscal((__LAPACK_int) a->nels, scale, a->elements, 1); + return MATRIX_OK; +} + +/** Performs a * b -> out */ +objectmatrixerror xmatrix_mul(objectxmatrix *a, objectxmatrix *b, objectxmatrix *out) { + if (a->ncols==b->nrows && a->nrows==out->nrows && b->ncols==out->ncols) { + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, 1.0, a->elements, a->nrows, b->elements, b->nrows, 0.0, out->elements, out->nrows); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} +//double complex alpha, beta; +//cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, &alpha, a->elements, a->nrows, b->elements, b->nrows, &beta, out->elements, out->nrows); + /* ---------------------- * Display * ---------------------- */ @@ -207,11 +222,11 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { value out=MORPHO_NIL; if (a->ncols==b->ncols && a->nrows==b->nrows) { - new=xmatrix_new(a->nrows, a->ncols, false); + new=xmatrix_clone(b); if (new) { - xmatrix_axpy(alpha, a, b, new); + xmatrix_axpy(alpha, a, new); out = morpho_wrapandbind(v, (object *) new); - } + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); return out; @@ -225,6 +240,36 @@ value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,-1.0); } +value XMatrix_mul__float(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + double scale; + morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); + + objectxmatrix *new = xmatrix_clone(a); + if (new) { + xmatrix_scale(new, scale); + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return out; +} + +value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (a->ncols==b->nrows) { + objectxmatrix *new = xmatrix_new(a->nrows, b->ncols, false); + if (new) { + xmatrix_mul(a, b, new); + out = morpho_wrapandbind(v, (object *) new); + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + return out; +} + /* --------- * index() * --------- */ @@ -278,7 +323,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSE MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "(XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), -//MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "(Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "(Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "(XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 72d01929a..0cb60a7e9 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -55,6 +55,9 @@ typedef void (*xmatrix_elprintfn) (vm *v, objectxmatrix *m, MatrixIdx_t i, Matri void xmatrix_initialize(void); +value XMatrix_add__xmatrix(vm *v, int nargs, value *args); +value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index 51399550a..cc0ec5a8f 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -2,10 +2,17 @@ import newlinalg var a = XMatrix(2,2) +a[0,0]=2 +a[1,1]=2 print a var a = ComplexMatrix(2,2) print a print a[0] -print a[0,0] \ No newline at end of file +print a[0,0] + +a[0,0] = 1+im +a[1,1] = 1-im + +print a+a From d61dd38d52f19ae71e41a6a5c623a1cbd67677ce Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 11 Dec 2025 07:24:15 -0500 Subject: [PATCH 102/473] Complex matrix multiplication --- src/xcomplexmatrix.c | 49 +++++++++++++++++++++++++++++++++++++-- src/xmatrix.c | 22 ++++++++---------- src/xmatrix.h | 1 + test/complexmatrix.morpho | 4 ++++ 4 files changed, 62 insertions(+), 14 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 0ca30b523..9c4ed277d 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -4,9 +4,15 @@ * @brief New linear algebra library */ -#include "xcomplexmatrix.h" +#define ACCELERATE_NEW_LAPACK +#define MORPHO_INCLUDE_LINALG + #include +#include "newlinalg.h" +#include "xmatrix.h" +#include "xcomplexmatrix.h" + objecttype objectcomplexmatrixtype; #define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype @@ -59,6 +65,23 @@ bool complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, Matr return true; } +/* ---------------------- + * Complex arithmetic + * ---------------------- */ + +/** Performs c <- alpha*(a*b) + beta*c with complex matrices */ +objectmatrixerror complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxmatrix *b, MorphoComplex beta, objectxmatrix *c) { + if (a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols) { + cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, + a->nrows, b->ncols, a->ncols, + &alpha, (__LAPACK_double_complex *) a->elements, + a->nrows, (__LAPACK_double_complex *) b->elements, b->nrows, + &beta, (__LAPACK_double_complex *) c->elements, c->nrows); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + /* ********************************************************************** * ComplexMatrix constructors * ********************************************************************** */ @@ -87,6 +110,26 @@ value ComplexMatrix_print(vm *v, int nargs, value *args) { return MORPHO_NIL; } +/* ---------------------- + * Arithmetic + * ---------------------- */ + +value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (a->ncols==b->nrows) { + objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); + if (new) { + MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); + complexmatrix_mmul(alpha, a, b, beta, new); + out = morpho_wrapandbind(v, (object *) new); + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + return out; +} + /* --------- * index() * --------- */ @@ -144,7 +187,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMat MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.c b/src/xmatrix.c index a5fff09fe..b9d7f9151 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -130,22 +130,20 @@ objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) return MATRIX_INCMPTBLDIM; } -/** Scales a matrix */ +/** Scales a matrix a <- scale * a >*/ objectmatrixerror xmatrix_scale(objectxmatrix *a, double scale) { cblas_dscal((__LAPACK_int) a->nels, scale, a->elements, 1); return MATRIX_OK; } -/** Performs a * b -> out */ -objectmatrixerror xmatrix_mul(objectxmatrix *a, objectxmatrix *b, objectxmatrix *out) { - if (a->ncols==b->nrows && a->nrows==out->nrows && b->ncols==out->ncols) { - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, 1.0, a->elements, a->nrows, b->elements, b->nrows, 0.0, out->elements, out->nrows); +/** Performs c <- alpha*(a*b) + beta*c*/ +objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *a, objectxmatrix *b, double beta, objectxmatrix *c) { + if (a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols) { + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, alpha, a->elements, a->nrows, b->elements, b->nrows, beta, c->elements, c->nrows); return MATRIX_OK; } return MATRIX_INCMPTBLDIM; } -//double complex alpha, beta; -//cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, &alpha, a->elements, a->nrows, b->elements, b->nrows, &beta, out->elements, out->nrows); /* ---------------------- * Display @@ -263,7 +261,7 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { if (a->ncols==b->nrows) { objectxmatrix *new = xmatrix_new(a->nrows, b->ncols, false); if (new) { - xmatrix_mul(a, b, new); + xmatrix_mmul(1.0, a, b, 0.0, new); out = morpho_wrapandbind(v, (object *) new); } } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); @@ -321,10 +319,10 @@ value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "(XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "(XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "(Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "(XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 0cb60a7e9..5ce104008 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -57,6 +57,7 @@ void xmatrix_initialize(void); value XMatrix_add__xmatrix(vm *v, int nargs, value *args); value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); +value XMatrix_mul__float(vm *v, int nargs, value *args); /* ------------------------------------------------------- * Interface diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index cc0ec5a8f..cacd64b4d 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -16,3 +16,7 @@ a[0,0] = 1+im a[1,1] = 1-im print a+a + +print a*3.0 + +print a*a From ed23c04f10b2174e100f1153175515a16f170ddd Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 11 Dec 2025 17:03:16 -0500 Subject: [PATCH 103/473] XMatrix mulr method --- src/xmatrix.c | 1 + test/complexmatrix.morpho | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/xmatrix.c b/src/xmatrix.c index b9d7f9151..6b047a135 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -323,6 +323,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xma MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index cacd64b4d..4e7fd943b 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -6,6 +6,8 @@ a[0,0]=2 a[1,1]=2 print a +print 2*a + var a = ComplexMatrix(2,2) print a From 9eda2e504e1964f401fcf8cf3cc9639fab652ced Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 11 Dec 2025 17:29:58 -0500 Subject: [PATCH 104/473] Raise ERROR_ALLOCATIONFAILED within wrapandbind --- src/core/vm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/vm.c b/src/core/vm.c index 7b9989986..d15d89c63 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -1763,13 +1763,14 @@ void morpho_bindobjects(vm *v, int nobj, value *obj) { /** @brief Convenience function to wrap a single object into a value and bind to the VM * @param v VM to use * @param out Object to wrap - * @returns object wrapped in a value, or MORPHO_NIL if obj is NULL */ + * @returns object wrapped in a value, or MORPHO_NIL if obj is NULL + * Also raises ERROR_ALLOCATIONFAILED if passed a null pointer */ value morpho_wrapandbind(vm *v, object *obj) { value out = MORPHO_NIL; if (obj) { out=MORPHO_OBJECT(obj); morpho_bindobjects(v, 1, &out); - } + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return out; } From bfebcb4834a23b35c6a7db1f76a51f2a11c03ffe Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 11 Dec 2025 17:40:03 -0500 Subject: [PATCH 105/473] Dimensions --- src/xcomplexmatrix.c | 15 ++++------ src/xmatrix.c | 63 ++++++++++++++++++++------------------- src/xmatrix.h | 4 +++ test/complexmatrix.morpho | 4 +++ 4 files changed, 46 insertions(+), 40 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 9c4ed277d..e05af9e9b 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -91,7 +91,6 @@ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { MatrixIdx_t ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); objectcomplexmatrix *new=complexmatrix_new(nrows, ncols, true); - return morpho_wrapandbind(v, (object *) new); } @@ -124,8 +123,8 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { if (new) { MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); complexmatrix_mmul(alpha, a, b, beta, new); - out = morpho_wrapandbind(v, (object *) new); } + out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); return out; } @@ -139,20 +138,17 @@ static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { xmatrix_getelementptr(m, i, j, &el); //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); objectcomplex *new = object_newcomplex(el[0], el[1]); return morpho_wrapandbind(v, (object *) new); - return MORPHO_NIL; } value ComplexMatrix_index__int(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _getindex(v, m, i, 0); + return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0); } value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - unsigned int j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _getindex(v, m, i, j); + unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j); } /* --------- @@ -182,6 +178,7 @@ value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", ComplexMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 6b047a135..b4274bcf1 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -166,11 +166,10 @@ void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_elprintfn fn) { * ********************************************************************** */ value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { - int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); objectxmatrix *new=xmatrix_new(nrows, ncols, true); - return morpho_wrapandbind(v, (object *) new); } @@ -203,10 +202,7 @@ value XMatrix_clone(vm *v, int nargs, value *args) { value out=MORPHO_NIL; objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *new=xmatrix_clone(a); - if (new) { - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - return out; + return morpho_wrapandbind(v, (object *) new); } /* ---------- @@ -221,10 +217,8 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { if (a->ncols==b->ncols && a->nrows==b->nrows) { new=xmatrix_clone(b); - if (new) { - xmatrix_axpy(alpha, a, new); - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + if (new) xmatrix_axpy(alpha, a, new); + out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); return out; @@ -246,11 +240,8 @@ value XMatrix_mul__float(vm *v, int nargs, value *args) { morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); objectxmatrix *new = xmatrix_clone(a); - if (new) { - xmatrix_scale(new, scale); - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - return out; + if (new) xmatrix_scale(new, scale); + return morpho_wrapandbind(v, (object *) new); } value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { @@ -260,10 +251,8 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { if (a->ncols==b->nrows) { objectxmatrix *new = xmatrix_new(a->nrows, b->ncols, false); - if (new) { - xmatrix_mmul(1.0, a, b, 0.0, new); - out = morpho_wrapandbind(v, (object *) new); - } + if (new) xmatrix_mmul(1.0, a, b, 0.0, new); + out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); return out; } @@ -280,16 +269,14 @@ static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { } value XMatrix_index__int(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _getindex(v, m, i, 0); + return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0); } value XMatrix_index__int_int(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _getindex(v, m, i, j); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j); } /* --------- @@ -304,18 +291,31 @@ value _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) } value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _setindex(v, m, i, 0, MORPHO_GETARG(args, 1)); + return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); } value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _setindex(v, m, i, j, MORPHO_GETARG(args, 2)); + return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); +} + +/* --------- + * Metadata + * --------- */ + +/** Matrix dimensions */ +value XMatrix_dimensions(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + + value dim[2] = { MORPHO_INTEGER(a->nrows), MORPHO_INTEGER(a->ncols) }; + objecttuple *new=object_newtuple(2, dim); + + return morpho_wrapandbind(v, (object *) new); } + MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), @@ -327,7 +327,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__floa MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.h b/src/xmatrix.h index 5ce104008..a1bb547bb 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -53,12 +53,16 @@ typedef void (*xmatrix_elprintfn) (vm *v, objectxmatrix *m, MatrixIdx_t i, Matri #define XMATRIX_CLASSNAME "XMatrix" +#define XMATRIX_DIMENSIONS_METHOD "dimensions" + void xmatrix_initialize(void); value XMatrix_add__xmatrix(vm *v, int nargs, value *args); value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); value XMatrix_mul__float(vm *v, int nargs, value *args); +value XMatrix_dimensions(vm *v, int nargs, value *args); + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index 4e7fd943b..0fb407351 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -5,6 +5,7 @@ var a = XMatrix(2,2) a[0,0]=2 a[1,1]=2 print a +print a.dimensions() print 2*a @@ -22,3 +23,6 @@ print a+a print a*3.0 print a*a + +Complex b = a[0,0] +print b From 093fc6928648e0c157fd0ff3038c11fd09b46aad Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 11 Dec 2025 17:52:08 -0500 Subject: [PATCH 106/473] dimensions, count --- src/xcomplexmatrix.c | 6 ++++-- src/xmatrix.c | 9 ++++++++- src/xmatrix.h | 3 +++ test/complexmatrix.morpho | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index e05af9e9b..f302d69ec 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -178,7 +178,7 @@ value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", ComplexMatrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), @@ -186,7 +186,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMat MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.c b/src/xmatrix.c index b4274bcf1..d8eeb6398 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -305,6 +305,12 @@ value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { * Metadata * --------- */ +/** Number of matrix elements */ +value XMatrix_count(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + return MORPHO_INTEGER(a->ncols*a->nrows); +} + /** Matrix dimensions */ value XMatrix_dimensions(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -328,7 +334,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__in MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.h b/src/xmatrix.h index a1bb547bb..1b40c2a22 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -57,11 +57,14 @@ typedef void (*xmatrix_elprintfn) (vm *v, objectxmatrix *m, MatrixIdx_t i, Matri void xmatrix_initialize(void); +value XMatrix_clone(vm *v, int nargs, value *args); + value XMatrix_add__xmatrix(vm *v, int nargs, value *args); value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); value XMatrix_mul__float(vm *v, int nargs, value *args); value XMatrix_dimensions(vm *v, int nargs, value *args); +value XMatrix_count(vm *v, int nargs, value *args); /* ------------------------------------------------------- * Interface diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index 0fb407351..8b92ddce8 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -6,6 +6,7 @@ a[0,0]=2 a[1,1]=2 print a print a.dimensions() +print a.count() print 2*a From 2cf8a61306321f472c4f4d84aa3fd0f53c505a42 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 13 Dec 2025 18:18:55 -0500 Subject: [PATCH 107/473] Inner products --- src/xcomplexmatrix.c | 31 ++++++++++++++++ src/xmatrix.c | 75 +++++++++++++++++++++++++++++++++++++++ src/xmatrix.h | 1 + test/complexmatrix.morpho | 8 +++++ 4 files changed, 115 insertions(+) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index f302d69ec..346729d7e 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -82,6 +82,17 @@ objectmatrixerror complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, obje return MATRIX_INCMPTBLDIM; } +/** Finds the Frobenius inner product of two complex matrices (a, b) = \sum_{i,j} conj(a)_ij * b_ij */ +objectmatrixerror complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { + if (a->ncols==b->ncols && a->nrows==b->nrows) { + cblas_zdotc_sub(a->nrows * a->ncols, (__LAPACK_double_complex *) a->elements, 1, + (__LAPACK_double_complex *) b->elements, 1, + (__LAPACK_double_complex *) out); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + /* ********************************************************************** * ComplexMatrix constructors * ********************************************************************** */ @@ -129,6 +140,25 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { return out; } +/* --------- + * Products + * --------- */ + +/** Frobenius inner product */ +value ComplexMatrix_inner(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + MorphoComplex prod=MCBuild(0.0, 0.0); + value out = MORPHO_NIL; + + if (complexmatrix_inner(a, b, &prod)==MATRIX_OK) { + objectcomplex *new = object_newcomplex(creal(prod), cimag(prod)); + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + + return out; +} + /* --------- * index() * --------- */ @@ -187,6 +217,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMat MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/xmatrix.c b/src/xmatrix.c index d8eeb6398..96fa38bbb 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -145,6 +145,33 @@ objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *a, objectxmatrix *b, return MATRIX_INCMPTBLDIM; } +/** Finds the Frobenius inner product of two matrices */ +objectmatrixerror xmatrix_inner(objectxmatrix *a, objectxmatrix *b, double *out) { + if (a->ncols==b->ncols && a->nrows==b->nrows) { + *out=cblas_ddot((__LAPACK_int) a->nels, a->elements, 1, b->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Solve the linear system a.x = b + * @param[in|out] a lhs — overwritten by the LU decomposition + * @param[in|out] b rhs — overwritten by the solution + * @param[out] pivot - you must provide an array with the same number of rows as a. + * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. */ +static objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); +#else + dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); +#endif + + return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); +} + + /* ---------------------- * Display * ---------------------- */ @@ -257,6 +284,51 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { return out; } +value XMatrix_div__float(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + double scale; + morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); + scale = 1.0/scale; + if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); + + objectxmatrix *new = xmatrix_clone(a); + if (new) xmatrix_scale(new, scale); + return morpho_wrapandbind(v, (object *) new); +} + +value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + double scale; + morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); + scale = 1.0/scale; + if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); + + objectxmatrix *new = xmatrix_clone(a); + if (new) xmatrix_scale(new, scale); + return morpho_wrapandbind(v, (object *) new); +} + +/* --------- + * Products + * --------- */ + +/** Frobenius inner product */ +value XMatrix_inner(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + double prod=0.0; + + if (xmatrix_inner(a, b, &prod)!=MATRIX_OK) { + morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } + + return MORPHO_FLOAT(prod); +} + /* --------- * index() * --------- */ @@ -330,6 +402,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xma MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 1b40c2a22..c6c2cddf7 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -54,6 +54,7 @@ typedef void (*xmatrix_elprintfn) (vm *v, objectxmatrix *m, MatrixIdx_t i, Matri #define XMATRIX_CLASSNAME "XMatrix" #define XMATRIX_DIMENSIONS_METHOD "dimensions" +#define XMATRIX_INNER_METHOD "inner" void xmatrix_initialize(void); diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index 8b92ddce8..c476767ce 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -8,6 +8,8 @@ print a print a.dimensions() print a.count() +print a.inner(a) + print 2*a var a = ComplexMatrix(2,2) @@ -27,3 +29,9 @@ print a*a Complex b = a[0,0] print b + +var A = ComplexMatrix(2,1) +A[0,0] = 1+im +A[1,0] = 1-im + +print A.inner(A) From f97622fa909ae7a427f5b6a539a2fe89a791fa52 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 14 Dec 2025 09:23:22 -0500 Subject: [PATCH 108/473] IdentityMatrix constructor --- src/xmatrix.c | 20 ++++++++++++++++++++ src/xmatrix.h | 2 ++ test/complexmatrix.morpho | 3 +++ 3 files changed, 25 insertions(+) diff --git a/src/xmatrix.c b/src/xmatrix.c index 96fa38bbb..29064a53c 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -136,6 +136,14 @@ objectmatrixerror xmatrix_scale(objectxmatrix *a, double scale) { return MATRIX_OK; } +/** Loads the identity matrix a <- I(n) */ +objectmatrixerror xmatrix_identity(objectxmatrix *a) { + if (a->ncols!=a->nrows) return MATRIX_NSQ; + memset(a->elements, 0, sizeof(double)*a->nrows*a->ncols); + for (int i=0; inrows; i++) a->elements[a->nvals*(i+a->nrows*i)]=1.0; + return MATRIX_OK; +} + /** Performs c <- alpha*(a*b) + beta*c*/ objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *a, objectxmatrix *b, double beta, objectxmatrix *c) { if (a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols) { @@ -209,6 +217,16 @@ value xmatrix_constructor__err(vm *v, int nargs, value *args) { return MORPHO_NIL; } +/** Creates an identity matrix */ +value xmatrix_identityconstructor(vm *v, int nargs, value *args) { + MatrixIdx_t n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + objectxmatrix *new = xmatrix_new(n,n,false); + if (new) xmatrix_identity(new); + + return morpho_wrapandbind(v, (object *) new); +} + /* ********************************************************************** * XMatrix veneer class * ********************************************************************** */ @@ -427,5 +445,7 @@ void xmatrix_initialize(void) { morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", xmatrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); + complexmatrix_initialize(); } diff --git a/src/xmatrix.h b/src/xmatrix.h index c6c2cddf7..6b83a3a5c 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -56,6 +56,8 @@ typedef void (*xmatrix_elprintfn) (vm *v, objectxmatrix *m, MatrixIdx_t i, Matri #define XMATRIX_DIMENSIONS_METHOD "dimensions" #define XMATRIX_INNER_METHOD "inner" +#define XMATRIX_IDENTITYCONSTRUCTOR "IdentityXMatrix" + void xmatrix_initialize(void); value XMatrix_clone(vm *v, int nargs, value *args); diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index c476767ce..7b9223bbe 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -1,6 +1,9 @@ import newlinalg +var I = IdentityXMatrix(2) +print I + var a = XMatrix(2,2) a[0,0]=2 a[1,1]=2 From 1e3f59f41a3de00ebf6e9505ec8bce99bacb27e8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 14 Dec 2025 10:27:56 -0500 Subject: [PATCH 109/473] Linear solve for regular matrix --- src/xmatrix.c | 85 +++++++++++++++++++++++++++------------ src/xmatrix.h | 7 ++++ test/complexmatrix.morpho | 18 +++++++++ 3 files changed, 85 insertions(+), 25 deletions(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index 29064a53c..5de40b83f 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -130,48 +130,57 @@ objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) return MATRIX_INCMPTBLDIM; } -/** Scales a matrix a <- scale * a >*/ -objectmatrixerror xmatrix_scale(objectxmatrix *a, double scale) { - cblas_dscal((__LAPACK_int) a->nels, scale, a->elements, 1); +/** Copies a matrix y <- a */ +objectmatrixerror xmatrix_copy(objectxmatrix *x, objectxmatrix *y) { + if (x->ncols==y->ncols && x->nrows==y->nrows) { + cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Scales a matrix x <- scale * x >*/ +objectmatrixerror xmatrix_scale(objectxmatrix *x, double scale) { + cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); return MATRIX_OK; } /** Loads the identity matrix a <- I(n) */ -objectmatrixerror xmatrix_identity(objectxmatrix *a) { - if (a->ncols!=a->nrows) return MATRIX_NSQ; - memset(a->elements, 0, sizeof(double)*a->nrows*a->ncols); - for (int i=0; inrows; i++) a->elements[a->nvals*(i+a->nrows*i)]=1.0; +objectmatrixerror xmatrix_identity(objectxmatrix *x) { + if (x->ncols!=x->nrows) return MATRIX_NSQ; + memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); + for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; return MATRIX_OK; } -/** Performs c <- alpha*(a*b) + beta*c*/ -objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *a, objectxmatrix *b, double beta, objectxmatrix *c) { - if (a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols) { - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, alpha, a->elements, a->nrows, b->elements, b->nrows, beta, c->elements, c->nrows); +/** Performs z <- alpha*(x*y) + beta*z */ +objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z) { + if (x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols) { + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); return MATRIX_OK; } return MATRIX_INCMPTBLDIM; } /** Finds the Frobenius inner product of two matrices */ -objectmatrixerror xmatrix_inner(objectxmatrix *a, objectxmatrix *b, double *out) { - if (a->ncols==b->ncols && a->nrows==b->nrows) { - *out=cblas_ddot((__LAPACK_int) a->nels, a->elements, 1, b->elements, 1); +objectmatrixerror xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { + if (x->ncols==y->ncols && x->nrows==y->nrows) { + *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); return MATRIX_OK; } return MATRIX_INCMPTBLDIM; } -/** Solve the linear system a.x = b +/** Solve the linear system a.x = b; * @param[in|out] a lhs — overwritten by the LU decomposition * @param[in|out] b rhs — overwritten by the solution * @param[out] pivot - you must provide an array with the same number of rows as a. * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. */ -static objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { +static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); + info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, x->elements, n, pivot, y->elements, n); #else dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); #endif @@ -179,6 +188,32 @@ static objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b, int * return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); } +/** Solve the linear system a.x = b using stack allocated memory for temporary */ +objectmatrixerror xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { + int pivot[a->nrows]; + double els[a->nels]; + objectxmatrix A = MORPHO_STATICXMATRIX(els, a->nrows, a->ncols); + xmatrix_copy(a, &A); + return _solve(&A, b, pivot); +} + +/** Solve the linear system a.x = b using heap allocated memory for temporary */ +objectmatrixerror xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { + int *pivot = MORPHO_MALLOC(sizeof(double)*a->nrows); + objectxmatrix *A = xmatrix_clone(a); + objectmatrixerror out = MATRIX_ALLOC; + if (pivot && A) { + out = _solve(A, b, pivot); + } + if (A) object_free((object *) A); + if (pivot) MORPHO_FREE(pivot); + return out; +} + +objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { + if (MATRIX_ISSMALL(a)) return xmatrix_solvesmall(a, b); + else return xmatrix_solvelarge(a, b); +} /* ---------------------- * Display @@ -317,17 +352,17 @@ value XMatrix_div__float(vm *v, int nargs, value *args) { } value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument value out=MORPHO_NIL; - double scale; - morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); - scale = 1.0/scale; - if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); + objectxmatrix *sol = xmatrix_clone(b); + if (sol) { + xmatrix_solve(a, sol); // TODO: Check for errors + out = morpho_wrapandbind(v, (object *) sol); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - objectxmatrix *new = xmatrix_clone(a); - if (new) xmatrix_scale(new, scale); - return morpho_wrapandbind(v, (object *) new); + return out; } /* --------- diff --git a/src/xmatrix.h b/src/xmatrix.h index 6b83a3a5c..0af0870b0 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -41,6 +41,13 @@ typedef struct { /** Gets the object as an matrix */ #define MORPHO_GETXMATRIX(val) ((objectxmatrix *) MORPHO_GETOBJECT(val)) +/** @brief Use to create static matrices on the C stack + @details Intended for small matrices; Caller needs to supply a double array of size nr*nc. */ +#define MORPHO_STATICXMATRIX(darray, nr, nc) { .obj.type=OBJECT_XMATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nels=nr*nc } + +/** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ +#define MATRIX_ISSMALL(m) (m->nrows*m->ncols Date: Sun, 14 Dec 2025 10:33:42 -0500 Subject: [PATCH 110/473] Harmonize ComplexMatrix and XMatrix --- src/xcomplexmatrix.c | 9 +++++---- test/complexmatrix.morpho | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 346729d7e..97c48290a 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -209,15 +209,16 @@ value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", ComplexMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index c2b8fd434..5277dda83 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -18,6 +18,7 @@ print b/A print A +/* System.exit() var I = IdentityXMatrix(2) print I @@ -56,3 +57,4 @@ A[0,0] = 1+im A[1,0] = 1-im print A.inner(A) +*/ \ No newline at end of file From fe58a94d8f0c67bd7ac2cebc64f67bbaa7376131 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 14 Dec 2025 12:30:52 -0500 Subject: [PATCH 111/473] Towards linear solve for complex matrices --- src/xcomplexmatrix.c | 19 +++++++++++++++++++ src/xmatrix.c | 12 ++++++++---- src/xmatrix.h | 2 ++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 97c48290a..b69efbb95 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -93,6 +93,24 @@ objectmatrixerror complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatri return MATRIX_INCMPTBLDIM; } +/** Low level solve for linear system a.x = b + * @param[in|out] a - lhs; overwritten by LU decomposition + * @param[in|out] b - rhs; overwritten by solution + * @param[out] pivot - you must provide an array with the same number of rows as a. + * @returns a matrix error code */ +static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); +#else + zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, + &n, pivot, (__LAPACK_double_complex *) b->elements, n, &info); +#endif + + return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); +} + /* ********************************************************************** * ComplexMatrix constructors * ********************************************************************** */ @@ -214,6 +232,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMat MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 5de40b83f..82eac3e9b 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -171,11 +171,11 @@ objectmatrixerror xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) return MATRIX_INCMPTBLDIM; } -/** Solve the linear system a.x = b; - * @param[in|out] a lhs — overwritten by the LU decomposition - * @param[in|out] b rhs — overwritten by the solution +/** Low level solve for linear system a.x = b + * @param[in|out] a - lhs; overwritten by LU decomposition + * @param[in|out] b - rhs; overwritten by solution * @param[out] pivot - you must provide an array with the same number of rows as a. - * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. */ + * @returns a matrix error code */ static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -210,6 +210,10 @@ objectmatrixerror xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { return out; } +/** Solve the linear system a.x = b; automatrically allocates storage depending on size of the matrix + * @param[in] a lhs + * @param[in|out] b rhs — overwritten by the solution + * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. */ objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { if (MATRIX_ISSMALL(a)) return xmatrix_solvesmall(a, b); else return xmatrix_solvelarge(a, b); diff --git a/src/xmatrix.h b/src/xmatrix.h index 0af0870b0..465898137 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -72,6 +72,8 @@ value XMatrix_clone(vm *v, int nargs, value *args); value XMatrix_add__xmatrix(vm *v, int nargs, value *args); value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); value XMatrix_mul__float(vm *v, int nargs, value *args); +value XMatrix_div__float(vm *v, int nargs, value *args); +value XMatrix_div__xmatrix(vm *v, int nargs, value *args); value XMatrix_dimensions(vm *v, int nargs, value *args); value XMatrix_count(vm *v, int nargs, value *args); From e37b5cb9c44f903ce70cd6cb2e0e01dd250c2336 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 14 Dec 2025 13:55:59 -0500 Subject: [PATCH 112/473] Matrix type interfaces and generic solve --- src/newlinalg.c | 3 +++ src/xcomplexmatrix.c | 26 ++++++++++++------------- src/xmatrix.c | 41 ++++++++++++++++++++++++++++++++++----- src/xmatrix.h | 22 ++++++++++++++++++--- test/complexmatrix.morpho | 19 ++++++++++++++---- 5 files changed, 86 insertions(+), 25 deletions(-) diff --git a/src/newlinalg.c b/src/newlinalg.c index d81906861..752a376c6 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -4,6 +4,9 @@ * @brief New linear algebra library */ +#define ACCELERATE_NEW_LAPACK +#define MORPHO_INCLUDE_LINALG + #include "newlinalg.h" /* ------------------------------------------------------- diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index b69efbb95..00b425535 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -105,12 +105,21 @@ static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); #else zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, - &n, pivot, (__LAPACK_double_complex *) b->elements, n, &info); + &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); #endif return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); } +/* ********************************************************************** + * Interface definition + * ********************************************************************** */ + +matrixinterfacedefn complexmatrixdefn = { + .printelfn = _printelfn, + .solvefn = _solve +}; + /* ********************************************************************** * ComplexMatrix constructors * ********************************************************************** */ @@ -127,17 +136,6 @@ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { * ComplexMatrix veneer class * ********************************************************************** */ -/* ---------------------- - * Common utility methods - * ---------------------- */ - -/** Prints a matrix */ -value ComplexMatrix_print(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - xmatrix_print(v, m, _printelfn); - return MORPHO_NIL; -} - /* ---------------------- * Arithmetic * ---------------------- */ @@ -225,7 +223,7 @@ value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(ComplexMatrix) -MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", ComplexMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), @@ -233,6 +231,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul_ MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), @@ -248,6 +247,7 @@ MORPHO_ENDCLASS void complexmatrix_initialize(void) { objectcomplexmatrixtype=object_addtype(&objectxmatrixdefn); + xmatrix_addinterface(&complexmatrixdefn); value complexmatrixclass=builtin_addclass(COMPLEXMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexMatrix), MORPHO_NIL); object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); diff --git a/src/xmatrix.c b/src/xmatrix.c index 82eac3e9b..1ebfcea57 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -11,6 +11,26 @@ #include "xmatrix.h" #include "xcomplexmatrix.h" +/* ********************************************************************** + * Matrix interface definitions + * ********************************************************************** */ + +/** Hold the matrix interface definitions as they're created */ +static matrixinterfacedefn _matrixdefn[LINALG_MAXMATRIXDEFNS]; +objecttype matrixinterfacedefnnext=0; /** Type of the next object definition */ + +void xmatrix_addinterface(matrixinterfacedefn *defn) { + if (matrixinterfacedefnnextobj.type-OBJECT_XMATRIX; + if (iindxnels]; objectxmatrix A = MORPHO_STATICXMATRIX(els, a->nrows, a->ncols); xmatrix_copy(a, &A); - return _solve(&A, b, pivot); + return (xmatrix_getinterface(a)->solvefn) (&A, b, pivot); } /** Solve the linear system a.x = b using heap allocated memory for temporary */ objectmatrixerror xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { - int *pivot = MORPHO_MALLOC(sizeof(double)*a->nrows); + int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); objectxmatrix *A = xmatrix_clone(a); objectmatrixerror out = MATRIX_ALLOC; if (pivot && A) { - out = _solve(A, b, pivot); + out = (xmatrix_getinterface(a)->solvefn) (A, b, pivot); } if (A) object_free((object *) A); if (pivot) MORPHO_FREE(pivot); @@ -224,7 +244,7 @@ objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { * ---------------------- */ /** Prints a matrix */ -void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_elprintfn fn) { +void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_printelfn_t fn) { for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k @@ -235,6 +255,15 @@ void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_elprintfn fn) { } } +/* ********************************************************************** + * Interface definition + * ********************************************************************** */ + +matrixinterfacedefn xmatrixdefn = { + .printelfn = _printelfn, + .solvefn = _solve +}; + /* ********************************************************************** * XMatrix constructors * ********************************************************************** */ @@ -277,7 +306,8 @@ value xmatrix_identityconstructor(vm *v, int nargs, value *args) { /** Prints a matrix */ value XMatrix_print(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - xmatrix_print(v, m, _printelfn); + matrixinterfacedefn *interface=xmatrix_getinterface(m); + xmatrix_print(v, m, interface->printelfn); return MORPHO_NIL; } @@ -476,6 +506,7 @@ MORPHO_ENDCLASS void xmatrix_initialize(void) { objectxmatrixtype=object_addtype(&objectxmatrixdefn); + xmatrix_addinterface(&xmatrixdefn); value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), MORPHO_NIL); object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); diff --git a/src/xmatrix.h b/src/xmatrix.h index 465898137..6d84a07ca 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -7,6 +7,8 @@ #ifndef xmatrix_h #define xmatrix_h +#define LINALG_MAXMATRIXDEFNS 4 + /* ------------------------------------------------------- * Matrix object type * ------------------------------------------------------- */ @@ -48,11 +50,24 @@ typedef struct { /** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ #define MATRIX_ISSMALL(m) (m->nrows*m->ncols Date: Sun, 14 Dec 2025 22:33:32 -0500 Subject: [PATCH 113/473] reshape --- src/xcomplexmatrix.c | 1 + src/xmatrix.c | 16 ++++++++++++++++ src/xmatrix.h | 2 ++ test/complexmatrix.morpho | 7 +++++-- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 00b425535..b067f6770 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -237,6 +237,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_i MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/xmatrix.c b/src/xmatrix.c index 1ebfcea57..aec0354b9 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -29,6 +29,7 @@ void xmatrix_addinterface(matrixinterfacedefn *defn) { matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a) { int iindx = a->obj.type-OBJECT_XMATRIX; if (iindxnrows*a->ncols) { + a->nrows=nrows; + a->ncols=ncols; + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + + return MORPHO_NIL; +} + /** Number of matrix elements */ value XMatrix_count(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -496,6 +511,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__in MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/xmatrix.h b/src/xmatrix.h index 6d84a07ca..01448da14 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -77,6 +77,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_DIMENSIONS_METHOD "dimensions" #define XMATRIX_INNER_METHOD "inner" +#define XMATRIX_RESHAPE_METHOD "reshape" #define XMATRIX_IDENTITYCONSTRUCTOR "IdentityXMatrix" @@ -91,6 +92,7 @@ value XMatrix_mul__float(vm *v, int nargs, value *args); value XMatrix_div__float(vm *v, int nargs, value *args); value XMatrix_div__xmatrix(vm *v, int nargs, value *args); +value XMatrix_reshape(vm *v, int nargs, value *args); value XMatrix_dimensions(vm *v, int nargs, value *args); value XMatrix_count(vm *v, int nargs, value *args); diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho index ce1db94b4..8e67b71d9 100644 --- a/test/complexmatrix.morpho +++ b/test/complexmatrix.morpho @@ -6,6 +6,11 @@ A[0,0] = 1+im A[1,1] = 1-im print A +A.reshape(4,1) +print A + +System.exit() + var b = ComplexMatrix(2,1) b[0,0] = Complex(0.5,0) b[1,0] = Complex(-0.5,0) @@ -13,8 +18,6 @@ print b print b/A -System.exit() - var A = XMatrix(2,2) A[0,0]=1 A[0,1]=2 From 1f109bbcba3d05d77c629fb1fe23537ee53eea66 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 18 Dec 2025 21:22:31 -0500 Subject: [PATCH 114/473] Added in provisional norms --- src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 71 +++++++++++++++++++++++++++++++++++++++ src/xmatrix.h | 1 + test/complexmatrix.morpho | 15 +++++++++ 4 files changed, 88 insertions(+), 1 deletion(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index b067f6770..b201e5b0f 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -12,7 +12,7 @@ #include "newlinalg.h" #include "xmatrix.h" #include "xcomplexmatrix.h" - +` objecttype objectcomplexmatrixtype; #define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype diff --git a/src/xmatrix.c b/src/xmatrix.c index aec0354b9..b8162d79d 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -183,6 +183,45 @@ objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, return MATRIX_INCMPTBLDIM; } +/* ---------------------- + * Unary operations + * ---------------------- */ + +// TODO: Fix with correct norms! + +/** Computes the Frobenius norm of a matrix */ +double xmatrix_norm(objectxmatrix *a) { + return cblas_dnrm2((__LAPACK_int) a->nels, a->elements, 1); +} + +/** Computes the L1 norm of a matrix */ +double xmatrix_l1norm(objectxmatrix *a) { + return cblas_dasum((__LAPACK_int) a->nels, a->elements, 1); +} + +/** Computes the Ln norm of a matrix */ +double xmatrix_lnnorm(objectxmatrix *a, double n) { + double sum=0.0, c=0.0, y,t; + + for (MatrixCount_t i=0; inels; i++) { + y=pow(a->elements[i],n)-c; // Kahan summation + t=sum+y; + c=(t-sum)-y; + sum=t; + } + return pow(sum,1.0/n); +} + +/** Computes the infinity norm of a matrix */ +double xmatrix_linfnorm(objectxmatrix *a) { + int imax=cblas_idamax((__LAPACK_int) a->nels, a->elements, 1); + return a->elements[imax]; +} + +/* ---------------------- + * Products + * ---------------------- */ + /** Finds the Frobenius inner product of two matrices */ objectmatrixerror xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { if (x->ncols==y->ncols && x->nrows==y->nrows) { @@ -400,6 +439,36 @@ value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { return out; } +/* ---------------- + * Unary operations + * ---------------- */ + +/** Matrix norm */ +value XMatrix_norm__x(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out = MORPHO_NIL; + double n; + + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { + if (fabs(n-1.0) Date: Fri, 19 Dec 2025 07:42:04 -0500 Subject: [PATCH 115/473] Error return system --- src/newlinalg.c | 20 ++++++++++ src/newlinalg.h | 29 ++++++++++++++ src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 44 ++++++++++----------- test/constructors/matrix_constructor.morpho | 10 +++++ test/constructors/vector_constructor.morpho | 10 +++++ test/index/matrix_getcolumn.morpho | 17 ++++++++ test/index/matrix_getindex.morpho | 21 ++++++++++ test/index/matrix_setindex.morpho | 13 ++++++ 9 files changed, 141 insertions(+), 25 deletions(-) create mode 100644 test/constructors/matrix_constructor.morpho create mode 100644 test/constructors/vector_constructor.morpho create mode 100644 test/index/matrix_getcolumn.morpho create mode 100644 test/index/matrix_getindex.morpho create mode 100644 test/index/matrix_setindex.morpho diff --git a/src/newlinalg.c b/src/newlinalg.c index 752a376c6..fd16dad29 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -9,12 +9,32 @@ #include "newlinalg.h" +/* ------------------------------------------------------- + * Errors + * ------------------------------------------------------- */ + +void linalg_raiseerror(vm *v, linalgError_t err) { + switch (err) { + case LINALGERR_OK: break; + case LINALGERR_INCOMPATIBLE_DIM: morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); break; + case LINALGERR_INDX_OUT_OF_BNDS: morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); break; + case LINALGERR_MATRIX_SINGULAR: morpho_runtimeerror(v, LINALG_SINGULAR); break; + case LINALGERR_NOT_SQUARE: morpho_runtimeerror(v, LINALG_NOTSQ); break; + case LINALGERR_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; + } +} + /* ------------------------------------------------------- * Initialization and finalization * ------------------------------------------------------- */ void newlinalg_initialize(void) { xmatrix_initialize(); + + morpho_defineerror(LINALG_INCOMPATIBLEMATRICES, ERROR_HALT, LINALG_INCOMPATIBLEMATRICES_MSG); + morpho_defineerror(LINALG_INDICESOUTSIDEBOUNDS, ERROR_HALT, LINALG_INDICESOUTSIDEBOUNDS_MSG); + morpho_defineerror(LINALG_SINGULAR, ERROR_HALT, LINALG_SINGULAR_MSG); + morpho_defineerror(LINALG_NOTSQ, ERROR_HALT, LINALG_NOTSQ_MSG); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index 43a0220ab..a4f887007 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -13,4 +13,33 @@ #include "xmatrix.h" +/* ------------------------------------------------------- + * objectmatrixerror type + * ------------------------------------------------------- */ + +typedef enum { + LINALGERR_OK, // Operation performed correctly + LINALGERR_INCOMPATIBLE_DIM, // Matrices have incompatible dimensions, e.g. for multiplication + LINALGERR_INDX_OUT_OF_BNDS, // Index out of bounds, e.g. for access. + LINALGERR_MATRIX_SINGULAR, // Matrix is singular + LINALGERR_NOT_SQUARE, // Matrix is required to be square for this algorithm + LINALGERR_ALLOC // Memory allocation failed +} linalgError_t; + +/* ------------------------------------------------------- + * Errors + * ------------------------------------------------------- */ + +#define LINALG_INCOMPATIBLEMATRICES "LnAlgMtrxIncmptbl" +#define LINALG_INCOMPATIBLEMATRICES_MSG "Matrices have incompatible shape." + +#define LINALG_INDICESOUTSIDEBOUNDS "LnAlgMtrxIndxBnds" +#define LINALG_INDICESOUTSIDEBOUNDS_MSG "Matrix index out of bounds." + +#define LINALG_SINGULAR "LnAlgMtrxSnglr" +#define LINALG_SINGULAR_MSG "Matrix is singular." + +#define LINALG_NOTSQ "LnAlgMtrxNtSq" +#define LINALG_NOTSQ_MSG "Matrix is not square." + #endif diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index b201e5b0f..b067f6770 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -12,7 +12,7 @@ #include "newlinalg.h" #include "xmatrix.h" #include "xcomplexmatrix.h" -` + objecttype objectcomplexmatrixtype; #define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype diff --git a/src/xmatrix.c b/src/xmatrix.c index b8162d79d..d6778dfdf 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -143,51 +143,47 @@ bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t c * ---------------------- */ /** Vector addition: Performs y <- alpha*x + y */ -objectmatrixerror xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { - if (x->ncols==y->ncols && x->nrows==y->nrows) { - cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +linalgError_t xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); + return LINALGERR_OK; } /** Copies a matrix y <- a */ -objectmatrixerror xmatrix_copy(objectxmatrix *x, objectxmatrix *y) { - if (x->ncols==y->ncols && x->nrows==y->nrows) { - cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +linalgError_t xmatrix_copy(objectxmatrix *x, objectxmatrix *y) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + return LINALGERR_OK; } /** Scales a matrix x <- scale * x >*/ -objectmatrixerror xmatrix_scale(objectxmatrix *x, double scale) { +void xmatrix_scale(objectxmatrix *x, double scale) { cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); - return MATRIX_OK; } /** Loads the identity matrix a <- I(n) */ -objectmatrixerror xmatrix_identity(objectxmatrix *x) { - if (x->ncols!=x->nrows) return MATRIX_NSQ; +linalgError_t xmatrix_identity(objectxmatrix *x) { + if (x->ncols!=x->nrows) return LINALGERR_NOT_SQUARE; memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; - return MATRIX_OK; + return LINALGERR_OK; } /** Performs z <- alpha*(x*y) + beta*z */ -objectmatrixerror xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z) { - if (x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols) { - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z) { + if (!(x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); + return LINALGERR_OK; } /* ---------------------- * Unary operations * ---------------------- */ -// TODO: Fix with correct norms! +// TODO: Fix with correct norms! /** Computes the Frobenius norm of a matrix */ double xmatrix_norm(objectxmatrix *a) { diff --git a/test/constructors/matrix_constructor.morpho b/test/constructors/matrix_constructor.morpho new file mode 100644 index 000000000..d85f095d9 --- /dev/null +++ b/test/constructors/matrix_constructor.morpho @@ -0,0 +1,10 @@ +// Create a Matrix + +import newlinalg + +var A = XMatrix(2,2) + +print A +// expect: [ 0 0 ] +// expect: [ 0 0 ] + diff --git a/test/constructors/vector_constructor.morpho b/test/constructors/vector_constructor.morpho new file mode 100644 index 000000000..3a508fb90 --- /dev/null +++ b/test/constructors/vector_constructor.morpho @@ -0,0 +1,10 @@ +// Create a column vector + +import newlinalg + +var A = Matrix(2) + +print A +// expect: [ 0 ] +// expect: [ 0 ] + diff --git a/test/index/matrix_getcolumn.morpho b/test/index/matrix_getcolumn.morpho new file mode 100644 index 000000000..ab92c5d31 --- /dev/null +++ b/test/index/matrix_getcolumn.morpho @@ -0,0 +1,17 @@ +// Set elements of a Matrix + +import newlinalg + +var A = XMatrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +print A.column(0) +// expect: [ 1 ] +// expect: [ 3 ] + +print A.column(1) +// expect: [ 2 ] +// expect: [ 4 ] diff --git a/test/index/matrix_getindex.morpho b/test/index/matrix_getindex.morpho new file mode 100644 index 000000000..7d8c16b8f --- /dev/null +++ b/test/index/matrix_getindex.morpho @@ -0,0 +1,21 @@ +// Get elements of a Matrix + +import newlinalg + +var A = XMatrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +// Array-like access +print A[0,0] // expect: 1 +print A[0,1] // expect: 2 +print A[1,0] // expect: 3 +print A[1,1] // expect: 4 + +// Vector-like access +print A[0] // expect: 1 +print A[1] // expect: 2 +print A[2] // expect: 3 +print A[3] // expect: 4 \ No newline at end of file diff --git a/test/index/matrix_setindex.morpho b/test/index/matrix_setindex.morpho new file mode 100644 index 000000000..af43f9c72 --- /dev/null +++ b/test/index/matrix_setindex.morpho @@ -0,0 +1,13 @@ +// Set elements of a Matrix + +import newlinalg + +var A = XMatrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] From 4a665427ee0b349f2da9ac763096c156066497f4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 19 Dec 2025 07:54:16 -0500 Subject: [PATCH 116/473] Functions use new error API --- src/newlinalg.c | 2 ++ src/newlinalg.h | 13 +++++++++++-- src/xcomplexmatrix.c | 4 ++-- src/xcomplexmatrix.h | 2 -- src/xmatrix.c | 23 ++++++++++------------- src/xmatrix.h | 2 +- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/newlinalg.c b/src/newlinalg.c index fd16dad29..749c00059 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -20,6 +20,7 @@ void linalg_raiseerror(vm *v, linalgError_t err) { case LINALGERR_INDX_OUT_OF_BNDS: morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); break; case LINALGERR_MATRIX_SINGULAR: morpho_runtimeerror(v, LINALG_SINGULAR); break; case LINALGERR_NOT_SQUARE: morpho_runtimeerror(v, LINALG_NOTSQ); break; + case LINALGERR_LAPACK_INVLD_ARGS: morpho_runtimeerror(v, LINALG_LAPACK_ARGS); break; case LINALGERR_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; } } @@ -35,6 +36,7 @@ void newlinalg_initialize(void) { morpho_defineerror(LINALG_INDICESOUTSIDEBOUNDS, ERROR_HALT, LINALG_INDICESOUTSIDEBOUNDS_MSG); morpho_defineerror(LINALG_SINGULAR, ERROR_HALT, LINALG_SINGULAR_MSG); morpho_defineerror(LINALG_NOTSQ, ERROR_HALT, LINALG_NOTSQ_MSG); + morpho_defineerror(LINALG_LAPACK_ARGS, ERROR_HALT, LINALG_LAPACK_ARGS_MSG); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index a4f887007..319eb3b2e 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -11,8 +11,6 @@ #include #include -#include "xmatrix.h" - /* ------------------------------------------------------- * objectmatrixerror type * ------------------------------------------------------- */ @@ -23,6 +21,7 @@ typedef enum { LINALGERR_INDX_OUT_OF_BNDS, // Index out of bounds, e.g. for access. LINALGERR_MATRIX_SINGULAR, // Matrix is singular LINALGERR_NOT_SQUARE, // Matrix is required to be square for this algorithm + LINALGERR_LAPACK_INVLD_ARGS, // Invalid arguments to LAPACK routine LINALGERR_ALLOC // Memory allocation failed } linalgError_t; @@ -42,4 +41,14 @@ typedef enum { #define LINALG_NOTSQ "LnAlgMtrxNtSq" #define LINALG_NOTSQ_MSG "Matrix is not square." +#define LINALG_LAPACK_ARGS "LnAlgLapackArgs" +#define LINALG_LAPACK_ARGS_MSG "Lapack function called with invalid arguments." + +/* ------------------------------------------------------- + * Include the rest of the library + * ------------------------------------------------------- */ + +#include "xmatrix.h" +#include "xcomplexmatrix.h" + #endif diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index b067f6770..536df986d 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -98,7 +98,7 @@ objectmatrixerror complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatri * @param[in|out] b - rhs; overwritten by solution * @param[out] pivot - you must provide an array with the same number of rows as a. * @returns a matrix error code */ -static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { +static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -108,7 +108,7 @@ static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); #endif - return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } /* ********************************************************************** diff --git a/src/xcomplexmatrix.h b/src/xcomplexmatrix.h index 71d50ee2e..4331a06a4 100644 --- a/src/xcomplexmatrix.h +++ b/src/xcomplexmatrix.h @@ -7,8 +7,6 @@ #ifndef xcomplexmatrix_h #define xcomplexmatrix_h -#include "newlinalg.h" - /* ------------------------------------------------------- * ComplexMatrix veneer class * ------------------------------------------------------- */ diff --git a/src/xmatrix.c b/src/xmatrix.c index d6778dfdf..13198b3c6 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -8,8 +8,6 @@ #define MORPHO_INCLUDE_LINALG #include "newlinalg.h" -#include "xmatrix.h" -#include "xcomplexmatrix.h" /* ********************************************************************** * Matrix interface definitions @@ -219,12 +217,11 @@ double xmatrix_linfnorm(objectxmatrix *a) { * ---------------------- */ /** Finds the Frobenius inner product of two matrices */ -objectmatrixerror xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { - if (x->ncols==y->ncols && x->nrows==y->nrows) { - *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +linalgError_t xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + return LINALGERR_OK; } /** Low level solve for linear system a.x = b @@ -232,7 +229,7 @@ objectmatrixerror xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) * @param[in|out] b - rhs; overwritten by solution * @param[out] pivot - you must provide an array with the same number of rows as a. * @returns a matrix error code */ -static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { +static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -241,11 +238,11 @@ static objectmatrixerror _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); #endif - return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } /** Solve the linear system a.x = b using stack allocated memory for temporary */ -objectmatrixerror xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { +linalgError_t xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { int pivot[a->nrows]; double els[a->nels]; objectxmatrix A = MORPHO_STATICXMATRIX(els, a->nrows, a->ncols); @@ -254,7 +251,7 @@ objectmatrixerror xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { } /** Solve the linear system a.x = b using heap allocated memory for temporary */ -objectmatrixerror xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { +linalgError_t xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); objectxmatrix *A = xmatrix_clone(a); objectmatrixerror out = MATRIX_ALLOC; @@ -270,7 +267,7 @@ objectmatrixerror xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { * @param[in] a lhs * @param[in|out] b rhs — overwritten by the solution * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. */ -objectmatrixerror xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { +linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { if (MATRIX_ISSMALL(a)) return xmatrix_solvesmall(a, b); else return xmatrix_solvelarge(a, b); } diff --git a/src/xmatrix.h b/src/xmatrix.h index 3c33a818d..e1ca7b4b2 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -59,7 +59,7 @@ typedef struct { typedef void (*xmatrix_printelfn_t) (vm *, objectxmatrix *, MatrixIdx_t, MatrixIdx_t); /** Function that solves a linear system */ -typedef objectmatrixerror (*xmatrix_solvefn_t) (objectxmatrix *, objectxmatrix *, int *); +typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *, objectxmatrix *, int *); typedef struct { xmatrix_printelfn_t printelfn; From e8b55d53e3163c6f00b4fd8cd0fb439d6be84651 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 19 Dec 2025 08:28:56 -0500 Subject: [PATCH 117/473] Improve error checking and reporting --- src/newlinalg.h | 11 +++++++++++ src/xcomplexmatrix.c | 6 +++--- src/xmatrix.c | 34 ++++++++++++++++------------------ src/xmatrix.h | 2 +- 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/src/newlinalg.h b/src/newlinalg.h index 319eb3b2e..c2826ce5f 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -44,6 +44,17 @@ typedef enum { #define LINALG_LAPACK_ARGS "LnAlgLapackArgs" #define LINALG_LAPACK_ARGS_MSG "Lapack function called with invalid arguments." +/* ------------------------------------------------------- + * Interface + * ------------------------------------------------------- */ + +void linalg_raiseerror(vm *v, linalgError_t err); + +/** Macro to simplify error checking: + - evaluates expression f that returns linalgError_t; + - if an error occurred, raises the corresponding error in a vm called v */ +#define LINALG_ERRCHECKVM(f) { linalgError_t err = f; if (err!=LINALGERR_OK) linalg_raiseerror(v, err); } + /* ------------------------------------------------------- * Include the rest of the library * ------------------------------------------------------- */ diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 536df986d..f5bfc148d 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -170,7 +170,7 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { if (complexmatrix_inner(a, b, &prod)==MATRIX_OK) { objectcomplex *new = object_newcomplex(creal(prod), cimag(prod)); out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } @@ -181,7 +181,7 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { double *el; - xmatrix_getelementptr(m, i, j, &el); //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); + if (!xmatrix_getelementptr(m, i, j, &el)) morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); objectcomplex *new = object_newcomplex(el[0], el[1]); return morpho_wrapandbind(v, (object *) new); } @@ -204,7 +204,7 @@ value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { static value _setindex(vm *v, objectcomplexmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { if (MORPHO_ISCOMPLEX(in) && !complexmatrix_setelement(m, i, j, MORPHO_GETCOMPLEX(in)->Z)) { - // Should raise an error + // TODO: Raise error } return MORPHO_NIL; } diff --git a/src/xmatrix.c b/src/xmatrix.c index 13198b3c6..4b2f3b42d 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -277,11 +277,12 @@ linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { * ---------------------- */ /** Prints a matrix */ -void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_printelfn_t fn) { +void xmatrix_print(vm *v, objectxmatrix *m) { + matrixinterfacedefn *interface=xmatrix_getinterface(m); for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - (*fn) (v, m, i, j); + (*interface->printelfn) (v, m, i, j); morpho_printf(v, " "); } morpho_printf(v, "]%s", (inrows-1 ? "\n" : "")); @@ -339,8 +340,7 @@ value xmatrix_identityconstructor(vm *v, int nargs, value *args) { /** Prints a matrix */ value XMatrix_print(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - matrixinterfacedefn *interface=xmatrix_getinterface(m); - xmatrix_print(v, m, interface->printelfn); + xmatrix_print(v, m); return MORPHO_NIL; } @@ -364,9 +364,9 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { if (a->ncols==b->ncols && a->nrows==b->nrows) { new=xmatrix_clone(b); - if (new) xmatrix_axpy(alpha, a, new); + if (new) xmatrix_axpy(alpha, a, new); // TODO: Error check out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } @@ -400,7 +400,7 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *new = xmatrix_new(a->nrows, b->ncols, false); if (new) xmatrix_mmul(1.0, a, b, 0.0, new); out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } @@ -425,7 +425,7 @@ value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *sol = xmatrix_clone(b); if (sol) { - xmatrix_solve(a, sol); // TODO: Check for errors + xmatrix_solve(a, sol); // TODO: Error check out = morpho_wrapandbind(v, (object *) sol); } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); @@ -472,9 +472,7 @@ value XMatrix_inner(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); double prod=0.0; - if (xmatrix_inner(a, b, &prod)!=MATRIX_OK) { - morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } + LINALG_ERRCHECKVM(xmatrix_inner(a, b, &prod)); return MORPHO_FLOAT(prod); } @@ -484,10 +482,10 @@ value XMatrix_inner(vm *v, int nargs, value *args) { * --------- */ static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { - double out; - if (xmatrix_getelement(m, i, j, &out)) return MORPHO_FLOAT(out); - //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); - return MORPHO_NIL; + double out=0.0; + + LINALG_ERRCHECKVM(xmatrix_getelement(m, i, j, &out)); + return MORPHO_FLOAT(out); } value XMatrix_index__int(vm *v, int nargs, value *args) { @@ -507,8 +505,8 @@ value XMatrix_index__int_int(vm *v, int nargs, value *args) { value _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { double val=0.0; - if (!morpho_valuetofloat(in, &val)) true; // Should raise an error (Matrix doesn't!) - if (!xmatrix_setelement(m, i, j, val)) true; //morpho_runtimeerror(v, XMATRIX_INDICESOUTSIDEBOUNDS); + if (!morpho_valuetofloat(in, &val)) true; // TODO: Should raise an error (Matrix doesn't!) + if (!xmatrix_setelement(m, i, j, val)) morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); return MORPHO_NIL; } @@ -536,7 +534,7 @@ value XMatrix_reshape(vm *v, int nargs, value *args) { if (nrows*ncols==a->nrows*a->ncols) { a->nrows=nrows; a->ncols=ncols; - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } diff --git a/src/xmatrix.h b/src/xmatrix.h index e1ca7b4b2..2a1012260 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -107,6 +107,6 @@ bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, bool xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); -void xmatrix_print(vm *v, objectxmatrix *m, xmatrix_printelfn_t fn); +void xmatrix_print(vm *v, objectxmatrix *m); #endif From b17715ea4b9997b12473d71dec0c787cafb0d658 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 12:08:14 -0500 Subject: [PATCH 118/473] getcolumn --- src/xmatrix.c | 39 ++++++++++++++++++++++++++++++ src/xmatrix.h | 2 ++ test/index/matrix_getcolumn.morpho | 2 ++ 3 files changed, 43 insertions(+) diff --git a/src/xmatrix.c b/src/xmatrix.c index 4b2f3b42d..98bc0ddde 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -136,6 +136,20 @@ bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t c return true; } +/** Copies the column col of matrix a into the column vector b */ +bool xmatrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { + if (b->nels!=a->nrows*a->nvals) return false; + + cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col*a->nrows, 1, b->elements, 1); +} + +/** Copies the column vector b into column col of matrix a */ +bool xmatrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { + if (b->nels!=a->nrows*a->nvals) return false; + + cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col*a->nrows, 1); +} + /* ---------------------- * Arithmetic operations * ---------------------- */ @@ -521,6 +535,29 @@ value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); } +/* --------- + * column + * --------- */ + +value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (i>=0 && incols) { + objectxmatrix *new=xmatrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); + if (new) xmatrix_getcolumn(a, i, new); + out=morpho_wrapandbind(v, (object *)new); + } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); + + return out; +} + +value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { + + return MORPHO_NIL; +} + /* --------- * Metadata * --------- */ @@ -571,6 +608,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__in MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "(_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "()", XMatrix_norm, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 2a1012260..8eb1131f4 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -75,6 +75,8 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_CLASSNAME "XMatrix" +#define XMATRIX_GETCOLUMN_METHOD "column" +#define XMATRIX_SETCOLUMN_METHOD "setcolumn" #define XMATRIX_DIMENSIONS_METHOD "dimensions" #define XMATRIX_INNER_METHOD "inner" #define XMATRIX_NORM_METHOD "norm" diff --git a/test/index/matrix_getcolumn.morpho b/test/index/matrix_getcolumn.morpho index ab92c5d31..926f15db7 100644 --- a/test/index/matrix_getcolumn.morpho +++ b/test/index/matrix_getcolumn.morpho @@ -15,3 +15,5 @@ print A.column(0) print A.column(1) // expect: [ 2 ] // expect: [ 4 ] + +print A.column(2) // expect error 'LnAlgMtrxIndxBnds' \ No newline at end of file From 7e729c6a709a3d88fe21ec458a66c90227777ccc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 12:36:53 -0500 Subject: [PATCH 119/473] Getcolumn/Setcolumn --- src/xcomplexmatrix.c | 21 +++++++------ src/xmatrix.c | 38 +++++++++++++---------- src/xmatrix.h | 11 ++++--- test/index/complexmatrix_getcolumn.morpho | 19 ++++++++++++ test/index/complexmatrix_setcolumn.morpho | 22 +++++++++++++ test/index/matrix_getcolumn.morpho | 2 +- test/index/matrix_setcolumn.morpho | 22 +++++++++++++ 7 files changed, 104 insertions(+), 31 deletions(-) create mode 100644 test/index/complexmatrix_getcolumn.morpho create mode 100644 test/index/complexmatrix_setcolumn.morpho create mode 100644 test/index/matrix_setcolumn.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index f5bfc148d..197f75d2c 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -47,22 +47,22 @@ objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, boo * ---------------------- */ /** Sets a matrix element. */ -bool complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { - if (!(colncols && rownrows)) return false; +linalgError_t complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); matrix->elements[ix]=creal(value); matrix->elements[ix+1]=cimag(value); - return true; + return LINALGERR_OK; } /** Gets a matrix element */ -bool complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { - if (!(colncols && rownrows)) return false; +linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; MatrixCount_t ix = 2*(col*matrix->nrows+row); if (value) *value=MCBuild(matrix->elements[ix],matrix->elements[ix+1]); - return true; + return LINALGERR_OK; } /* ---------------------- @@ -181,7 +181,7 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { double *el; - if (!xmatrix_getelementptr(m, i, j, &el)) morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); + LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &el)); objectcomplex *new = object_newcomplex(el[0], el[1]); return morpho_wrapandbind(v, (object *) new); } @@ -202,9 +202,8 @@ value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { * --------- */ static value _setindex(vm *v, objectcomplexmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { - if (MORPHO_ISCOMPLEX(in) && - !complexmatrix_setelement(m, i, j, MORPHO_GETCOMPLEX(in)->Z)) { - // TODO: Raise error + if (MORPHO_ISCOMPLEX(in)) { + LINALG_ERRCHECKVM(complexmatrix_setelement(m, i, j, MORPHO_GETCOMPLEX(in)->Z)); } return MORPHO_NIL; } @@ -237,6 +236,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_i MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) diff --git a/src/xmatrix.c b/src/xmatrix.c index 98bc0ddde..2babee7b2 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -111,43 +111,47 @@ objectxmatrix *xmatrix_clone(objectxmatrix *in) { /** @brief Sets a matrix element. @returns true if the element is in the range of the matrix, false otherwise */ -bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { - if (!(colncols && rownrows)) return false; +linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; - return true; + return LINALGERR_OK; } /** @brief Gets a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -bool xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { - if (!(colncols && rownrows)) return false; +linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; - return true; + return LINALGERR_OK; } /** @brief Gets a pointer to a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { - if (!(colncols && rownrows)) return false; +linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); - return true; + return LINALGERR_OK; } /** Copies the column col of matrix a into the column vector b */ -bool xmatrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { - if (b->nels!=a->nrows*a->nvals) return false; +linalgError_t xmatrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { + if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col*a->nrows, 1, b->elements, 1); + return LINALGERR_OK; } /** Copies the column vector b into column col of matrix a */ -bool xmatrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { - if (b->nels!=a->nrows*a->nvals) return false; +linalgError_t xmatrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { + if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col*a->nrows, 1); + return LINALGERR_OK; } /* ---------------------- @@ -268,7 +272,7 @@ linalgError_t xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { linalgError_t xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); objectxmatrix *A = xmatrix_clone(a); - objectmatrixerror out = MATRIX_ALLOC; + linalgError_t out = LINALGERR_ALLOC; if (pivot && A) { out = (xmatrix_getinterface(a)->solvefn) (A, b, pivot); } @@ -520,7 +524,7 @@ value XMatrix_index__int_int(vm *v, int nargs, value *args) { value _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { double val=0.0; if (!morpho_valuetofloat(in, &val)) true; // TODO: Should raise an error (Matrix doesn't!) - if (!xmatrix_setelement(m, i, j, val)) morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); + LINALG_ERRCHECKVM(xmatrix_setelement(m, i, j, val)); return MORPHO_NIL; } @@ -554,7 +558,9 @@ value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { } value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { - + LINALG_ERRCHECKVM(xmatrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)))); return MORPHO_NIL; } diff --git a/src/xmatrix.h b/src/xmatrix.h index 8eb1131f4..64aa14585 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -76,7 +76,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_CLASSNAME "XMatrix" #define XMATRIX_GETCOLUMN_METHOD "column" -#define XMATRIX_SETCOLUMN_METHOD "setcolumn" +#define XMATRIX_SETCOLUMN_METHOD "setColumn" #define XMATRIX_DIMENSIONS_METHOD "dimensions" #define XMATRIX_INNER_METHOD "inner" #define XMATRIX_NORM_METHOD "norm" @@ -95,6 +95,9 @@ value XMatrix_mul__float(vm *v, int nargs, value *args); value XMatrix_div__float(vm *v, int nargs, value *args); value XMatrix_div__xmatrix(vm *v, int nargs, value *args); +value XMatrix_getcolumn__int(vm *v, int nargs, value *args); +value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); + value XMatrix_reshape(vm *v, int nargs, value *args); value XMatrix_dimensions(vm *v, int nargs, value *args); value XMatrix_count(vm *v, int nargs, value *args); @@ -105,9 +108,9 @@ value XMatrix_count(vm *v, int nargs, value *args); objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); -bool xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); -bool xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); -bool xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); +linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); +linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); +linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); void xmatrix_print(vm *v, objectxmatrix *m); diff --git a/test/index/complexmatrix_getcolumn.morpho b/test/index/complexmatrix_getcolumn.morpho new file mode 100644 index 000000000..ee1b4b372 --- /dev/null +++ b/test/index/complexmatrix_getcolumn.morpho @@ -0,0 +1,19 @@ +// Get columns of a ComplexMatrix + +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +print A.column(0) +// expect: [ 1 + 1im ] +// expect: [ 3 + 3im ] + +print A.column(1) +// expect: [ 2 + 2im ] +// expect: [ 4 + 4im ] + +print A.column(2) // expect error 'LnAlgMtrxIndxBnds' diff --git a/test/index/complexmatrix_setcolumn.morpho b/test/index/complexmatrix_setcolumn.morpho new file mode 100644 index 000000000..3e7e5e78d --- /dev/null +++ b/test/index/complexmatrix_setcolumn.morpho @@ -0,0 +1,22 @@ +// Set columns of a Matrix + +import newlinalg + +var A = ComplexMatrix(2,2) + +var b = ComplexMatrix(2,1) +b[0] = 1+1im +b[1] = 3+3im + +var c = ComplexMatrix(2,1) +c[0] = 2+2im +c[1] = 4+4im + +A.setColumn(0,b) +A.setColumn(1,c) + +print A +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] + +print A.setColumn(2,b) // expect error 'LnAlgMtrxIndxBnds' diff --git a/test/index/matrix_getcolumn.morpho b/test/index/matrix_getcolumn.morpho index 926f15db7..1a46ce72a 100644 --- a/test/index/matrix_getcolumn.morpho +++ b/test/index/matrix_getcolumn.morpho @@ -1,4 +1,4 @@ -// Set elements of a Matrix +// Get columns of a Matrix import newlinalg diff --git a/test/index/matrix_setcolumn.morpho b/test/index/matrix_setcolumn.morpho new file mode 100644 index 000000000..b879d6518 --- /dev/null +++ b/test/index/matrix_setcolumn.morpho @@ -0,0 +1,22 @@ +// Set columns of a Matrix + +import newlinalg + +var A = XMatrix(2,2) + +var b = XMatrix(2,1) +b[0] = 1 +b[1] = 3 + +var c = XMatrix(2,1) +c[0] = 2 +c[1] = 4 + +A.setColumn(0,b) +A.setColumn(1,c) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] + +print A.setColumn(2,b) // expect error 'LnAlgMtrxIndxBnds' From 5c66fa1030ae05636a18862eaccbc97f243eba65 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 13:16:11 -0500 Subject: [PATCH 120/473] assign() method --- src/xcomplexmatrix.c | 1 + src/xmatrix.c | 10 ++++++++++ src/xmatrix.h | 1 + test/assign/complexmatrix_assign.morpho | 17 +++++++++++++++++ test/assign/matrix_assign.morpho | 16 ++++++++++++++++ 5 files changed, 45 insertions(+) create mode 100644 test/assign/complexmatrix_assign.morpho create mode 100644 test/assign/matrix_assign.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 197f75d2c..a9079fca9 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -223,6 +223,7 @@ value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 2babee7b2..e0b90de0a 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -362,6 +362,14 @@ value XMatrix_print(vm *v, int nargs, value *args) { return MORPHO_NIL; } +/** Copies the contents of one matrix into another */ +value XMatrix_assign(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + LINALG_ERRCHECKVM(xmatrix_copy(b, a)); + return MORPHO_NIL; +} + /** Clones a matrix */ value XMatrix_clone(vm *v, int nargs, value *args) { value out=MORPHO_NIL; @@ -600,7 +608,9 @@ value XMatrix_dimensions(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(XMatrix) + MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 64aa14585..780d932fb 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -87,6 +87,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); void xmatrix_initialize(void); value XMatrix_print(vm *v, int nargs, value *args); +value XMatrix_assign(vm *v, int nargs, value *args); value XMatrix_clone(vm *v, int nargs, value *args); value XMatrix_add__xmatrix(vm *v, int nargs, value *args); diff --git a/test/assign/complexmatrix_assign.morpho b/test/assign/complexmatrix_assign.morpho new file mode 100644 index 000000000..d55502db7 --- /dev/null +++ b/test/assign/complexmatrix_assign.morpho @@ -0,0 +1,17 @@ +// Assign one ComplexMatrix to another + +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +var B = ComplexMatrix(2,2) + +B.assign(A) + +print B +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] diff --git a/test/assign/matrix_assign.morpho b/test/assign/matrix_assign.morpho new file mode 100644 index 000000000..7d2e7c8f1 --- /dev/null +++ b/test/assign/matrix_assign.morpho @@ -0,0 +1,16 @@ +// Assign one matrix to another + +import newlinalg + +var A = XMatrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +var B = XMatrix(2,2) +B.assign(A) + +print B +// expect: [ 1 2 ] +// expect: [ 3 4 ] \ No newline at end of file From 4d9a4ddc5192bf5ee7627b6e6f9ed955b09d1f13 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 15:52:19 -0500 Subject: [PATCH 121/473] enumerate --- src/xcomplexmatrix.c | 11 ++++++-- src/xmatrix.c | 28 +++++++++++++++++-- src/xmatrix.h | 11 +++++++- .../matrix_list_constructor.morpho | 9 ++++++ test/methods/complexmatrix_enumerate.morpho | 15 ++++++++++ test/methods/matrix_enumerate.morpho | 15 ++++++++++ 6 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 test/constructors/matrix_list_constructor.morpho create mode 100644 test/methods/complexmatrix_enumerate.morpho create mode 100644 test/methods/matrix_enumerate.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index a9079fca9..ba768c72e 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -33,6 +33,11 @@ static void _printelfn(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { complex_print(v, &cmplx); } +static value _getelfn(vm *v, double *el) { + objectcomplex *new = object_newcomplex(el[0], el[1]); + return morpho_wrapandbind(v, (object *) new); +} + /* ---------------------- * Constructor * ---------------------- */ @@ -117,6 +122,7 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { matrixinterfacedefn complexmatrixdefn = { .printelfn = _printelfn, + .getelfn = _getelfn, .solvefn = _solve }; @@ -240,8 +246,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMat MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.c b/src/xmatrix.c index e0b90de0a..a3489b7ee 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -71,6 +71,10 @@ static void _printelfn(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { morpho_printf(v, "%g", (fabs(val)ncols*a->nrows); + } else if (incols*a->nrows) { + out=xmatrix_getinterface(a)->getelfn(v, a->elements+i*a->nvals); + } else { + linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); + } + + return out; +} + /** Number of matrix elements */ value XMatrix_count(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -629,8 +652,9 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setc MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "(_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "()", XMatrix_norm, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/xmatrix.h b/src/xmatrix.h index 780d932fb..3a17e7176 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -58,12 +58,20 @@ typedef struct { /** Function that prints a single matrix element */ typedef void (*xmatrix_printelfn_t) (vm *, objectxmatrix *, MatrixIdx_t, MatrixIdx_t); +/** Function that materializes a value from a pointer to an element */ +typedef value (*xmatrix_getelfn_t) (vm *, double *); + /** Function that solves a linear system */ typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *, objectxmatrix *, int *); +/** Function that sets a given entry given a value */ +//typedef void (*xmatrix_setfn_t) (objectxmatrix *, void *, value v); + typedef struct { xmatrix_printelfn_t printelfn; + xmatrix_getelfn_t getelfn; xmatrix_solvefn_t solvefn; +// xmatrix_setfn_t setfn; } matrixinterfacedefn; void xmatrix_addinterface(matrixinterfacedefn *defn); @@ -100,8 +108,9 @@ value XMatrix_getcolumn__int(vm *v, int nargs, value *args); value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); value XMatrix_reshape(vm *v, int nargs, value *args); -value XMatrix_dimensions(vm *v, int nargs, value *args); +value XMatrix_enumerate(vm *v, int nargs, value *args); value XMatrix_count(vm *v, int nargs, value *args); +value XMatrix_dimensions(vm *v, int nargs, value *args); /* ------------------------------------------------------- * Interface diff --git a/test/constructors/matrix_list_constructor.morpho b/test/constructors/matrix_list_constructor.morpho new file mode 100644 index 000000000..22ab6b693 --- /dev/null +++ b/test/constructors/matrix_list_constructor.morpho @@ -0,0 +1,9 @@ +// Create a Matrix from a List of Lists + +import newlinalg + +var A = XMatrix([[1,2],[3,4]]) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] diff --git a/test/methods/complexmatrix_enumerate.morpho b/test/methods/complexmatrix_enumerate.morpho new file mode 100644 index 000000000..c8ed07116 --- /dev/null +++ b/test/methods/complexmatrix_enumerate.morpho @@ -0,0 +1,15 @@ +// Enumerate elements of a matrix + +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0] = 1+im +A[0,1] = 0+0im +A[1,0] = 0+0im +A[1,1] = 1-im + +for (x in A) print x +// expect: 1 + 1im +// expect: 0 + 0im +// expect: 0 + 0im +// expect: 1 - 1im \ No newline at end of file diff --git a/test/methods/matrix_enumerate.morpho b/test/methods/matrix_enumerate.morpho new file mode 100644 index 000000000..8d2eabe2a --- /dev/null +++ b/test/methods/matrix_enumerate.morpho @@ -0,0 +1,15 @@ +// Enumerate elements of a matrix + +import newlinalg + +var A = XMatrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +for (x in A) print x +// expect: 1 +// expect: 2 +// expect: 3 +// expect: 4 From 270147c429881cafb1e74d35ee66f390a1ce3f00 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 15:58:52 -0500 Subject: [PATCH 122/473] Simplify printelfn --- src/xcomplexmatrix.c | 6 ++---- src/xmatrix.c | 9 +++++---- src/xmatrix.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index ba768c72e..05c537eed 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -26,10 +26,8 @@ typedef objectxmatrix objectcomplexmatrix; * Callbacks * ---------------------- */ -static void _printelfn(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { - double *elptr; - xmatrix_getelementptr(m, i, j, &elptr); - objectcomplex cmplx = MORPHO_STATICCOMPLEX(elptr[0], elptr[1]); +static void _printelfn(vm *v, double *el) { + objectcomplex cmplx = MORPHO_STATICCOMPLEX(el[0], el[1]); complex_print(v, &cmplx); } diff --git a/src/xmatrix.c b/src/xmatrix.c index a3489b7ee..e47536ec5 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -65,9 +65,8 @@ objecttypedefn objectxmatrixdefn = { * XMatrix callbacks * ---------------------- */ -static void _printelfn(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { - double val; - xmatrix_getelement(m, i, j, &val); +static void _printelfn(vm *v, double *el) { + double val=*el; morpho_printf(v, "%g", (fabs(val)nrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - (*interface->printelfn) (v, m, i, j); + xmatrix_getelementptr(m, i, j, &elptr); + (*interface->printelfn) (v, elptr); morpho_printf(v, " "); } morpho_printf(v, "]%s", (inrows-1 ? "\n" : "")); diff --git a/src/xmatrix.h b/src/xmatrix.h index 3a17e7176..6e55019c7 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -56,7 +56,7 @@ typedef struct { * ------------------------------------------------------- */ /** Function that prints a single matrix element */ -typedef void (*xmatrix_printelfn_t) (vm *, objectxmatrix *, MatrixIdx_t, MatrixIdx_t); +typedef void (*xmatrix_printelfn_t) (vm *, double *); /** Function that materializes a value from a pointer to an element */ typedef value (*xmatrix_getelfn_t) (vm *, double *); From 2ad86558b0378be40b5c27c2b3d56d1104810d65 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 18:02:42 -0500 Subject: [PATCH 123/473] Accumulate --- src/xcomplexmatrix.c | 1 + src/xmatrix.c | 13 +++++++++++++ src/xmatrix.h | 1 + test/arithmetic/complexmatrix_acc.morpho | 14 ++++++++++++++ test/arithmetic/matrix_acc.morpho | 12 ++++++++++++ 5 files changed, 41 insertions(+) create mode 100644 test/arithmetic/complexmatrix_acc.morpho create mode 100644 test/arithmetic/matrix_acc.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 05c537eed..f97f39fd8 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -236,6 +236,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", Comp MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index e47536ec5..435532e18 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -465,6 +465,18 @@ value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { return out; } +/** Accumulate in place */ +value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)); + + double alpha=1.0; + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) morpho_runtimeerror(v, MATRIX_ARITHARGS); + + LINALG_ERRCHECKVM(xmatrix_axpy(alpha, b, a)); + return MORPHO_NIL; +} + /* ---------------- * Unary operations * ---------------- */ @@ -643,6 +655,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xma MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 6e55019c7..f5cfa6756 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -103,6 +103,7 @@ value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); value XMatrix_mul__float(vm *v, int nargs, value *args); value XMatrix_div__float(vm *v, int nargs, value *args); value XMatrix_div__xmatrix(vm *v, int nargs, value *args); +value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args); value XMatrix_getcolumn__int(vm *v, int nargs, value *args); value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); diff --git a/test/arithmetic/complexmatrix_acc.morpho b/test/arithmetic/complexmatrix_acc.morpho new file mode 100644 index 000000000..8213224b9 --- /dev/null +++ b/test/arithmetic/complexmatrix_acc.morpho @@ -0,0 +1,14 @@ +// In-place accumulate +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[0,1]=1-im +A[1,0]=1-im +A[1,1]=1+im + +A.acc(2,A) + +print A +// expect: [ 3 + 3im 3 - 3im ] +// expect: [ 3 - 3im 3 + 3im ] \ No newline at end of file diff --git a/test/arithmetic/matrix_acc.morpho b/test/arithmetic/matrix_acc.morpho new file mode 100644 index 000000000..e1b4f0358 --- /dev/null +++ b/test/arithmetic/matrix_acc.morpho @@ -0,0 +1,12 @@ +// In-place accumulate +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=1 +A[1,0]=1 +A[1,1]=1 + +A.acc(2,A) + +print A From bcb78190e921b1f6f9ada2317edd1b79ef490c5a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 20:26:42 -0500 Subject: [PATCH 124/473] inverse() --- src/xcomplexmatrix.c | 57 ++++++++++++--- src/xmatrix.c | 77 +++++++++++++++------ src/xmatrix.h | 2 + test/methods/complexmatrix_inverse.morpho | 12 ++++ test/methods/matrix_inverse.morpho | 12 ++++ test/methods/matrix_inverse_singular.morpho | 11 +++ 6 files changed, 140 insertions(+), 31 deletions(-) create mode 100644 test/methods/complexmatrix_inverse.morpho create mode 100644 test/methods/matrix_inverse.morpho create mode 100644 test/methods/matrix_inverse_singular.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index f97f39fd8..da2362a0b 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -36,6 +36,24 @@ static value _getelfn(vm *v, double *el) { return morpho_wrapandbind(v, (object *) new); } +/** Low level solve for linear system a.x = b + * @param[in|out] a - lhs; overwritten by LU decomposition + * @param[in|out] b - rhs; overwritten by solution + * @param[out] pivot - you must provide an array with the same number of rows as a. + * @returns a matrix error code */ +static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); +#else + zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, + &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Constructor * ---------------------- */ @@ -96,19 +114,25 @@ objectmatrixerror complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatri return MATRIX_INCMPTBLDIM; } -/** Low level solve for linear system a.x = b - * @param[in|out] a - lhs; overwritten by LU decomposition - * @param[in|out] b - rhs; overwritten by solution - * @param[out] pivot - you must provide an array with the same number of rows as a. - * @returns a matrix error code */ -static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { - int n=a->nrows, nrhs = b->ncols, info; +/** Inverts the matrix a + * @param[in] a matrix to be inverted + * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ +linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { + int nrows=a->nrows, ncols=a->ncols, info; + int pivot[nrows]; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); + info=LAPACKE_zgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); #else - zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, - &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); + zgetrf_(&nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, pivot, &info); +#endif + if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); +#else + int lwork=nrows*ncols; __LAPACK_double_complex work[nrows*ncols]; + zgetri_(&nrows, (__LAPACK_double_complex *) a->elements, &nrows, pivot, work, &lwork, &info); #endif return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); @@ -160,6 +184,18 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { return out; } +/** Inverts a matrix */ +value ComplexMatrix_inverse(vm *v, int nargs, value *args) { + objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + objectcomplexmatrix *new = xmatrix_clone(a); + out = morpho_wrapandbind(v, (object *) new); + if (new) LINALG_ERRCHECKVM(complexmatrix_inverse(new)); + + return out; +} + /* --------- * Products * --------- */ @@ -237,6 +273,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 435532e18..79a7fc5ce 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -74,6 +74,23 @@ static value _getelfn(vm *v, double *el) { return MORPHO_FLOAT(*el); } +/** Low level solve for linear system a.x = b + * @param[in|out] a - lhs; overwritten by LU decomposition + * @param[in|out] b - rhs; overwritten by solution + * @param[out] pivot - you must provide an array with the same number of rows as a. + * @returns a matrix error code */ +static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, x->elements, n, pivot, y->elements, n); +#else + dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Constructors * ---------------------- */ @@ -245,23 +262,6 @@ linalgError_t xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { return LINALGERR_OK; } -/** Low level solve for linear system a.x = b - * @param[in|out] a - lhs; overwritten by LU decomposition - * @param[in|out] b - rhs; overwritten by solution - * @param[out] pivot - you must provide an array with the same number of rows as a. - * @returns a matrix error code */ -static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { - int n=a->nrows, nrhs = b->ncols, info; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, x->elements, n, pivot, y->elements, n); -#else - dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); -#endif - - return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); -} - /** Solve the linear system a.x = b using stack allocated memory for temporary */ linalgError_t xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { int pivot[a->nrows]; @@ -293,6 +293,30 @@ linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { else return xmatrix_solvelarge(a, b); } +/** Inverts the matrix a + * @param[in] a matrix to be inverted + * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ +linalgError_t xmatrix_inverse(objectxmatrix *a) { + int nrows=a->nrows, ncols=a->ncols, info; + int pivot[nrows]; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); +#else + dgetrf_(&nrows, &ncols, a->elements, &nrows, pivot, &info); +#endif + if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); +#else + int lwork=nrows*ncols; double work[nrows*ncols]; + dgetri_(&nrows, a->elements, &nrows, pivot, work, &lwork, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Display * ---------------------- */ @@ -457,10 +481,8 @@ value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { value out=MORPHO_NIL; objectxmatrix *sol = xmatrix_clone(b); - if (sol) { - xmatrix_solve(a, sol); // TODO: Error check - out = morpho_wrapandbind(v, (object *) sol); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + out = morpho_wrapandbind(v, (object *) sol); + if (sol) LINALG_ERRCHECKVM(xmatrix_solve(a, sol)); return out; } @@ -507,6 +529,18 @@ value XMatrix_norm(vm *v, int nargs, value *args) { return MORPHO_FLOAT(xmatrix_norm(a)); } +/** Inverts a matrix */ +value XMatrix_inverse(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + objectxmatrix *new = xmatrix_clone(a); + out = morpho_wrapandbind(v, (object *) new); + if (new) LINALG_ERRCHECKVM(xmatrix_inverse(new)); + + return out; +} + /* --------- * Products * --------- */ @@ -656,6 +690,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__floa MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "XMatrix ()", XMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index f5cfa6756..84e34dea0 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -87,6 +87,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_SETCOLUMN_METHOD "setColumn" #define XMATRIX_DIMENSIONS_METHOD "dimensions" #define XMATRIX_INNER_METHOD "inner" +#define XMATRIX_INVERSE_METHOD "inverse" #define XMATRIX_NORM_METHOD "norm" #define XMATRIX_RESHAPE_METHOD "reshape" @@ -118,6 +119,7 @@ value XMatrix_dimensions(vm *v, int nargs, value *args); * ------------------------------------------------------- */ objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); +objectxmatrix *xmatrix_clone(objectxmatrix *in); linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); diff --git a/test/methods/complexmatrix_inverse.morpho b/test/methods/complexmatrix_inverse.morpho new file mode 100644 index 000000000..9ae068292 --- /dev/null +++ b/test/methods/complexmatrix_inverse.morpho @@ -0,0 +1,12 @@ +// Inverse +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=0+0im +A[0,1]=1+im +A[1,0]=1-im +A[1,1]=0+0im + +print A.inverse() +// expect: [ 0 + 0im 0.5 + 0.5im ] +// expect: [ 0.5 - 0.5im 0 + 0im ] diff --git a/test/methods/matrix_inverse.morpho b/test/methods/matrix_inverse.morpho new file mode 100644 index 000000000..f7f07541d --- /dev/null +++ b/test/methods/matrix_inverse.morpho @@ -0,0 +1,12 @@ +// Inverse +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +print A.inverse() +// expect: [ -2 1 ] +// expect: [ 1.5 -0.5 ] diff --git a/test/methods/matrix_inverse_singular.morpho b/test/methods/matrix_inverse_singular.morpho new file mode 100644 index 000000000..7180cd65a --- /dev/null +++ b/test/methods/matrix_inverse_singular.morpho @@ -0,0 +1,11 @@ +// Inverse +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=2 +A[1,1]=4 + +print A.inverse() +// expect error 'LnAlgMtrxSnglr' From 44796d6ba356f7beb2613b0a3218d688473a40a2 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 20:42:49 -0500 Subject: [PATCH 125/473] Common index method implementation --- src/xcomplexmatrix.c | 26 ++---------------------- src/xmatrix.c | 9 +++++--- src/xmatrix.h | 4 ++++ test/index/complexmatrix_getindex.morpho | 21 +++++++++++++++++++ 4 files changed, 33 insertions(+), 27 deletions(-) create mode 100644 test/index/complexmatrix_getindex.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index da2362a0b..ce58b112f 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -215,28 +215,6 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { return out; } -/* --------- - * index() - * --------- */ - -static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { - double *el; - LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &el)); - objectcomplex *new = object_newcomplex(el[0], el[1]); - return morpho_wrapandbind(v, (object *) new); -} - -value ComplexMatrix_index__int(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0); -} - -value ComplexMatrix_index__int_int(vm *v, int nargs, value *args) { - unsigned int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j); -} - /* --------- * setIndex() * --------- */ @@ -275,8 +253,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMat MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", ComplexMatrix_index__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", ComplexMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 79a7fc5ce..ab4869c94 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -561,10 +561,13 @@ value XMatrix_inner(vm *v, int nargs, value *args) { * --------- */ static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { - double out=0.0; + value out=MORPHO_NIL; - LINALG_ERRCHECKVM(xmatrix_getelement(m, i, j, &out)); - return MORPHO_FLOAT(out); + double *elptr=NULL; + LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &elptr)); + + if (elptr) out=xmatrix_getinterface(m)->getelfn(v, elptr); + return out; } value XMatrix_index__int(vm *v, int nargs, value *args) { diff --git a/src/xmatrix.h b/src/xmatrix.h index 84e34dea0..4a4f2b25e 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -106,6 +106,10 @@ value XMatrix_div__float(vm *v, int nargs, value *args); value XMatrix_div__xmatrix(vm *v, int nargs, value *args); value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args); + +value XMatrix_index__int(vm *v, int nargs, value *args); +value XMatrix_index__int_int(vm *v, int nargs, value *args); + value XMatrix_getcolumn__int(vm *v, int nargs, value *args); value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); diff --git a/test/index/complexmatrix_getindex.morpho b/test/index/complexmatrix_getindex.morpho new file mode 100644 index 000000000..e833722f7 --- /dev/null +++ b/test/index/complexmatrix_getindex.morpho @@ -0,0 +1,21 @@ +// Get elements of a ComplexMatrix + +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +// Array-like access +print A[0,0] // expect: 1 + 1im +print A[0,1] // expect: 2 + 2im +print A[1,0] // expect: 3 + 3im +print A[1,1] // expect: 4 + 4im + +// Vector-like access +print A[0] // expect: 1 + 1im +print A[1] // expect: 2 + 2im +print A[2] // expect: 3 + 3im +print A[3] // expect: 4 + 4im From 885e022d2cdc1f926aa23af5306794ff56133897 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 21 Dec 2025 21:37:35 -0500 Subject: [PATCH 126/473] trace --- src/xcomplexmatrix.c | 54 ++++++++++++++++--------- src/xmatrix.c | 24 +++++++++-- src/xmatrix.h | 1 + test/methods/complexmatrix_trace.morpho | 11 +++++ test/methods/matrix_trace.morpho | 11 +++++ 5 files changed, 79 insertions(+), 22 deletions(-) create mode 100644 test/methods/complexmatrix_trace.morpho create mode 100644 test/methods/matrix_trace.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index ce58b112f..4e24853a1 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -91,27 +91,33 @@ linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t * ---------------------- */ /** Performs c <- alpha*(a*b) + beta*c with complex matrices */ -objectmatrixerror complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxmatrix *b, MorphoComplex beta, objectxmatrix *c) { - if (a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols) { - cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, - a->nrows, b->ncols, a->ncols, - &alpha, (__LAPACK_double_complex *) a->elements, - a->nrows, (__LAPACK_double_complex *) b->elements, b->nrows, - &beta, (__LAPACK_double_complex *) c->elements, c->nrows); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxmatrix *b, MorphoComplex beta, objectxmatrix *c) { + if (!(a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, + a->nrows, b->ncols, a->ncols, + &alpha, (__LAPACK_double_complex *) a->elements, + a->nrows, (__LAPACK_double_complex *) b->elements, b->nrows, + &beta, (__LAPACK_double_complex *) c->elements, c->nrows); + return LINALGERR_OK; } /** Finds the Frobenius inner product of two complex matrices (a, b) = \sum_{i,j} conj(a)_ij * b_ij */ -objectmatrixerror complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { - if (a->ncols==b->ncols && a->nrows==b->nrows) { - cblas_zdotc_sub(a->nrows * a->ncols, (__LAPACK_double_complex *) a->elements, 1, - (__LAPACK_double_complex *) b->elements, 1, - (__LAPACK_double_complex *) out); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +linalgError_t complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { + if (!(a->ncols==b->ncols && a->nrows==b->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_zdotc_sub(a->nrows * a->ncols, (__LAPACK_double_complex *) a->elements, 1, + (__LAPACK_double_complex *) b->elements, 1, + (__LAPACK_double_complex *) out); + return LINALGERR_OK; +} + +/** Calculate the trace of a matrix */ +linalgError_t complexmatrix_trace(objectcomplexmatrix *a, MorphoComplex *out) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + MorphoComplex one = MCBuild(1.0, 0.0); + cblas_zdotu_sub(a->nrows, (__LAPACK_double_complex *) a->elements, a->ncols+1, (__LAPACK_double_complex *) &one, 0, (__LAPACK_double_complex *) out); + return LINALGERR_OK; } /** Inverts the matrix a @@ -184,6 +190,15 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { return out; } +/** Computes the trace */ +value ComplexMatrix_trace(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MorphoComplex tr=MCBuild(0,0); + LINALG_ERRCHECKVM(complexmatrix_trace(a, &tr)); + objectcomplex *new = object_newcomplex(creal(tr), cimag(tr)); + return morpho_wrapandbind(v, (object *) new); +} + /** Inverts a matrix */ value ComplexMatrix_inverse(vm *v, int nargs, value *args) { objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -207,7 +222,7 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { MorphoComplex prod=MCBuild(0.0, 0.0); value out = MORPHO_NIL; - if (complexmatrix_inner(a, b, &prod)==MATRIX_OK) { + if (complexmatrix_inner(a, b, &prod)==LINALGERR_OK) { objectcomplex *new = object_newcomplex(creal(prod), cimag(prod)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); @@ -259,6 +274,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index ab4869c94..61607a420 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -250,8 +250,17 @@ double xmatrix_linfnorm(objectxmatrix *a) { return a->elements[imax]; } +/** Calculate the trace of a matrix */ +linalgError_t xmatrix_trace(objectxmatrix *a, double *out) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + *out=1.0; + *out=cblas_ddot(a->nrows, a->elements, a->ncols+1, out, 0); + + return LINALGERR_OK; +} + /* ---------------------- - * Products + * Binary operations * ---------------------- */ /** Finds the Frobenius inner product of two matrices */ @@ -529,6 +538,14 @@ value XMatrix_norm(vm *v, int nargs, value *args) { return MORPHO_FLOAT(xmatrix_norm(a)); } +/** Computes the trace */ +value XMatrix_trace(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + double out=0.0; + LINALG_ERRCHECKVM(xmatrix_trace(a, &out)); + return MORPHO_FLOAT(out); +} + /** Inverts a matrix */ value XMatrix_inverse(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -701,8 +718,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "(_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "()", XMatrix_norm, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 4a4f2b25e..afc0602b8 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -90,6 +90,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_INVERSE_METHOD "inverse" #define XMATRIX_NORM_METHOD "norm" #define XMATRIX_RESHAPE_METHOD "reshape" +#define XMATRIX_TRACE_METHOD "trace" #define XMATRIX_IDENTITYCONSTRUCTOR "IdentityXMatrix" diff --git a/test/methods/complexmatrix_trace.morpho b/test/methods/complexmatrix_trace.morpho new file mode 100644 index 000000000..694a60aa3 --- /dev/null +++ b/test/methods/complexmatrix_trace.morpho @@ -0,0 +1,11 @@ +// Inverse +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.trace() +// expect: 5 + 5im diff --git a/test/methods/matrix_trace.morpho b/test/methods/matrix_trace.morpho new file mode 100644 index 000000000..dc70fcf50 --- /dev/null +++ b/test/methods/matrix_trace.morpho @@ -0,0 +1,11 @@ +// Inverse +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +print A.trace() +// expect: 5 From 481a1ca7bcc6c2baa886c788db3ab013851f0653 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 23 Dec 2025 11:03:50 -0500 Subject: [PATCH 127/473] Eigenvalues and Eigensystem --- src/newlinalg.c | 4 + src/newlinalg.h | 8 + src/xcomplexmatrix.c | 38 ++- src/xmatrix.c | 266 ++++++++++++------ src/xmatrix.h | 32 ++- test/methods/complexmatrix_eigensystem.morpho | 17 ++ test/methods/complexmatrix_eigenvalues.morpho | 13 + test/methods/matrix_eigensystem.morpho | 16 ++ test/methods/matrix_eigenvalues.morpho | 11 + 9 files changed, 304 insertions(+), 101 deletions(-) create mode 100644 test/methods/complexmatrix_eigensystem.morpho create mode 100644 test/methods/complexmatrix_eigenvalues.morpho create mode 100644 test/methods/matrix_eigensystem.morpho create mode 100644 test/methods/matrix_eigenvalues.morpho diff --git a/src/newlinalg.c b/src/newlinalg.c index 749c00059..9789b4640 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -21,6 +21,8 @@ void linalg_raiseerror(vm *v, linalgError_t err) { case LINALGERR_MATRIX_SINGULAR: morpho_runtimeerror(v, LINALG_SINGULAR); break; case LINALGERR_NOT_SQUARE: morpho_runtimeerror(v, LINALG_NOTSQ); break; case LINALGERR_LAPACK_INVLD_ARGS: morpho_runtimeerror(v, LINALG_LAPACK_ARGS); break; + case LINALGERR_OP_FAILED: morpho_runtimeerror(v, LINALG_OPFAILED); break; + case LINALGERR_NOT_SUPPORTED: morpho_runtimeerror(v, LINALG_NOTSUPPORTED); break; case LINALGERR_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; } } @@ -37,6 +39,8 @@ void newlinalg_initialize(void) { morpho_defineerror(LINALG_SINGULAR, ERROR_HALT, LINALG_SINGULAR_MSG); morpho_defineerror(LINALG_NOTSQ, ERROR_HALT, LINALG_NOTSQ_MSG); morpho_defineerror(LINALG_LAPACK_ARGS, ERROR_HALT, LINALG_LAPACK_ARGS_MSG); + morpho_defineerror(LINALG_OPFAILED, ERROR_HALT, LINALG_OPFAILED_MSG); + morpho_defineerror(LINALG_NOTSUPPORTED, ERROR_HALT, LINALG_NOTSUPPORTED_MSG); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index c2826ce5f..95241ee73 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -22,6 +22,8 @@ typedef enum { LINALGERR_MATRIX_SINGULAR, // Matrix is singular LINALGERR_NOT_SQUARE, // Matrix is required to be square for this algorithm LINALGERR_LAPACK_INVLD_ARGS, // Invalid arguments to LAPACK routine + LINALGERR_OP_FAILED, // Matrix operation failed + LINALGERR_NOT_SUPPORTED, // Operation not supported for this matrix type LINALGERR_ALLOC // Memory allocation failed } linalgError_t; @@ -44,6 +46,12 @@ typedef enum { #define LINALG_LAPACK_ARGS "LnAlgLapackArgs" #define LINALG_LAPACK_ARGS_MSG "Lapack function called with invalid arguments." +#define LINALG_OPFAILED "LnAlgMtrxOpFld" +#define LINALG_OPFAILED_MSG "Matrix operation failed." + +#define LINALG_NOTSUPPORTED "LnAlgMtrxNtSpprtd" +#define LINALG_NOTSUPPORTED_MSG "Operation not supported for this matrix type." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 4e24853a1..76028bcbc 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -36,11 +36,7 @@ static value _getelfn(vm *v, double *el) { return morpho_wrapandbind(v, (object *) new); } -/** Low level solve for linear system a.x = b - * @param[in|out] a - lhs; overwritten by LU decomposition - * @param[in|out] b - rhs; overwritten by solution - * @param[out] pivot - you must provide an array with the same number of rows as a. - * @returns a matrix error code */ +/** Low level linear solve */ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -54,6 +50,20 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Low level eigensolver */ +static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { + int info, n=a->nrows; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, acopy, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); +#else + int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; + zgeev_("N", (vec ? "V" : "N"), &n, (__LAPACK_double_complex *) a->elements, &n, (__LAPACK_double_complex *) w, NULL, &n, (__LAPACK_double_complex *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Constructor * ---------------------- */ @@ -151,7 +161,8 @@ linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { matrixinterfacedefn complexmatrixdefn = { .printelfn = _printelfn, .getelfn = _getelfn, - .solvefn = _solve + .solvefn = _solve, + .eigenfn = _eigen }; /* ********************************************************************** @@ -258,6 +269,13 @@ MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), + MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), @@ -268,13 +286,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMat MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 61607a420..7490facdd 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -74,11 +74,7 @@ static value _getelfn(vm *v, double *el) { return MORPHO_FLOAT(*el); } -/** Low level solve for linear system a.x = b - * @param[in|out] a - lhs; overwritten by LU decomposition - * @param[in|out] b - rhs; overwritten by solution - * @param[out] pivot - you must provide an array with the same number of rows as a. - * @returns a matrix error code */ +/** Low level linear solve */ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -91,6 +87,21 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Low level eigensolver */ +static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { + int info, n=a->nrows; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); +#else + int lwork=4*n; double work[4*n], wr[n], wi[n]; + dgeev_("N", (vec ? "V" : "N"), &n, a->elements, &n, wr, wi, NULL, &n, (vec ? vec->elements : NULL), &n, work, &lwork, &info); + for (int i=0; i0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Constructors * ---------------------- */ @@ -326,6 +337,20 @@ linalgError_t xmatrix_inverse(objectxmatrix *a) { return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Interface to eigensystem */ +linalgError_t xmatrix_eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + + xmatrix_eigenfn_t efn = xmatrix_getinterface(a)->eigenfn; + if (!efn) return LINALGERR_NOT_SUPPORTED; + + objectxmatrix *temp = xmatrix_clone(a); + if (!temp) return LINALGERR_ALLOC; + + return efn(temp, w, vec); +} + /* ---------------------- * Display * ---------------------- */ @@ -352,7 +377,8 @@ void xmatrix_print(vm *v, objectxmatrix *m) { matrixinterfacedefn xmatrixdefn = { .printelfn = _printelfn, .getelfn = _getelfn, - .solvefn = _solve + .solvefn = _solve, + .eigenfn = _eigen }; /* ********************************************************************** @@ -368,7 +394,6 @@ value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { } value xmatrix_constructor__list(vm *v, int nargs, value *args) { - return MORPHO_NIL; } @@ -418,6 +443,78 @@ value XMatrix_clone(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/* --------- + * index() + * --------- */ + +static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { + value out=MORPHO_NIL; + + double *elptr=NULL; + LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &elptr)); + + if (elptr) out=xmatrix_getinterface(m)->getelfn(v, elptr); + return out; +} + +value XMatrix_index__int(vm *v, int nargs, value *args) { + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0); +} + +value XMatrix_index__int_int(vm *v, int nargs, value *args) { + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j); +} + +/* --------- + * setindex() + * --------- */ + +value _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { + double val=0.0; + if (!morpho_valuetofloat(in, &val)) true; // TODO: Should raise an error (Matrix doesn't!) + LINALG_ERRCHECKVM(xmatrix_setelement(m, i, j, val)); + return MORPHO_NIL; +} + +value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); +} + +value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); +} + +/* --------- + * column + * --------- */ + +value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (i>=0 && incols) { + objectxmatrix *new=xmatrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); + if (new) xmatrix_getcolumn(a, i, new); + out=morpho_wrapandbind(v, (object *)new); + } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); + + return out; +} + +value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { + LINALG_ERRCHECKVM(xmatrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)))); + return MORPHO_NIL; +} + /* ---------- * Arithmetic * ---------- */ @@ -558,91 +655,96 @@ value XMatrix_inverse(vm *v, int nargs, value *args) { return out; } -/* --------- - * Products - * --------- */ - -/** Frobenius inner product */ -value XMatrix_inner(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - double prod=0.0; +bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { + value ev[n]; + for (int i=0; incols; + MorphoComplex w[n]; + linalgError_t err=xmatrix_eigen(a, w, NULL); + if (err==LINALGERR_OK) { + if (_processeigenvalues(v, n, w, &out)) { + morpho_bindobjects(v, 1, &out); // TODO: Correctly bind subsidiary values + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + } else linalg_raiseerror(v, err); - double *elptr=NULL; - LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &elptr)); - - if (elptr) out=xmatrix_getinterface(m)->getelfn(v, elptr); return out; } -value XMatrix_index__int(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0); -} - -value XMatrix_index__int_int(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j); -} - -/* --------- - * setindex() - * --------- */ +#define _CHK(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _eigensystem_cleanup; } -value _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { - double val=0.0; - if (!morpho_valuetofloat(in, &val)) true; // TODO: Should raise an error (Matrix doesn't!) - LINALG_ERRCHECKVM(xmatrix_setelement(m, i, j, val)); +/** Finds the eigenvalues and eigenvectors of a matrix */ +value XMatrix_eigensystem(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + + value ev=MORPHO_NIL; // Will hold eigenvalues + objectxmatrix *evec=NULL; // Holds eigenvectors + objecttuple *otuple=NULL; // Tuple to return everything + + MatrixIdx_t n=a->ncols; + MorphoComplex w[n]; + + evec=xmatrix_clone(a); + _CHK(evec); + + linalgError_t err=xmatrix_eigen(a, w, evec); + if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto _eigensystem_cleanup; } + + _CHK(_processeigenvalues(v, n, w, &ev)); + + value outtuple[2] = { ev, MORPHO_OBJECT(evec) }; + otuple = object_newtuple(2, outtuple); + _CHK(otuple); + + return morpho_wrapandbind(v, (object *) otuple); // TODO: Correctly bind subsidiary values + +_eigensystem_cleanup: + if (evec) object_free((object *) evec); + if (otuple) object_free((object *) otuple); + morpho_freeobject(ev); // TODO: Free contents? + return MORPHO_NIL; } - -value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); -} - -value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); -} +#undef _CHK /* --------- - * column + * Products * --------- */ -value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { +/** Frobenius inner product */ +value XMatrix_inner(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + double prod=0.0; - if (i>=0 && incols) { - objectxmatrix *new=xmatrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); - if (new) xmatrix_getcolumn(a, i, new); - out=morpho_wrapandbind(v, (object *)new); - } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); + LINALG_ERRCHECKVM(xmatrix_inner(a, b, &prod)); - return out; -} - -value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { - LINALG_ERRCHECKVM(xmatrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), - MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)))); - return MORPHO_NIL; + return MORPHO_FLOAT(prod); } /* --------- @@ -702,6 +804,12 @@ MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), @@ -710,17 +818,13 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__floa MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "XMatrix ()", XMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index afc0602b8..d4866eb63 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -61,8 +61,19 @@ typedef void (*xmatrix_printelfn_t) (vm *, double *); /** Function that materializes a value from a pointer to an element */ typedef value (*xmatrix_getelfn_t) (vm *, double *); -/** Function that solves a linear system */ -typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *, objectxmatrix *, int *); +/** Function that solves the linear system a.x = b + * @param[in|out] a - lhs; overwritten by LU decomposition + * @param[in|out] b - rhs; overwritten by solution + * @param[out] pivot - you must provide an array with the same number of rows as a. + * @returns a matrix error code */ +typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *a, objectxmatrix *b, int *pivot); + +/** Function that finds the eigenvalues of a matrix + * @param[in|out] a - lhs; overwritten + * @param[out] w - eigenvalues; dimension N + * @param[out] vec - right eigenvectors. Can be NULL if only eigenvalues requested + * @returns a matrix error code */ +typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec); /** Function that sets a given entry given a value */ //typedef void (*xmatrix_setfn_t) (objectxmatrix *, void *, value v); @@ -71,6 +82,7 @@ typedef struct { xmatrix_printelfn_t printelfn; xmatrix_getelfn_t getelfn; xmatrix_solvefn_t solvefn; + xmatrix_eigenfn_t eigenfn; // xmatrix_setfn_t setfn; } matrixinterfacedefn; @@ -86,6 +98,8 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_GETCOLUMN_METHOD "column" #define XMATRIX_SETCOLUMN_METHOD "setColumn" #define XMATRIX_DIMENSIONS_METHOD "dimensions" +#define XMATRIX_EIGENVALUES_METHOD "eigenvalues" +#define XMATRIX_EIGENSYSTEM_METHOD "eigensystem" #define XMATRIX_INNER_METHOD "inner" #define XMATRIX_INVERSE_METHOD "inverse" #define XMATRIX_NORM_METHOD "norm" @@ -100,6 +114,12 @@ value XMatrix_print(vm *v, int nargs, value *args); value XMatrix_assign(vm *v, int nargs, value *args); value XMatrix_clone(vm *v, int nargs, value *args); +value XMatrix_index__int(vm *v, int nargs, value *args); +value XMatrix_index__int_int(vm *v, int nargs, value *args); + +value XMatrix_getcolumn__int(vm *v, int nargs, value *args); +value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); + value XMatrix_add__xmatrix(vm *v, int nargs, value *args); value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); value XMatrix_mul__float(vm *v, int nargs, value *args); @@ -107,12 +127,8 @@ value XMatrix_div__float(vm *v, int nargs, value *args); value XMatrix_div__xmatrix(vm *v, int nargs, value *args); value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args); - -value XMatrix_index__int(vm *v, int nargs, value *args); -value XMatrix_index__int_int(vm *v, int nargs, value *args); - -value XMatrix_getcolumn__int(vm *v, int nargs, value *args); -value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); +value XMatrix_eigenvalues(vm *v, int nargs, value *args); +value XMatrix_eigensystem(vm *v, int nargs, value *args); value XMatrix_reshape(vm *v, int nargs, value *args); value XMatrix_enumerate(vm *v, int nargs, value *args); diff --git a/test/methods/complexmatrix_eigensystem.morpho b/test/methods/complexmatrix_eigensystem.morpho new file mode 100644 index 000000000..1cd107c45 --- /dev/null +++ b/test/methods/complexmatrix_eigensystem.morpho @@ -0,0 +1,17 @@ +// Eigenvalues and eigenvectors +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=0im +A[0,1]=im +A[1,0]=im +A[1,1]=0im + +var es=A.eigensystem() +print es +// expect: ((0 + 1im, 0 - 1im), ) + +print es[0] +// expect: (0 + 1im, 0 - 1im) + +print es[1] diff --git a/test/methods/complexmatrix_eigenvalues.morpho b/test/methods/complexmatrix_eigenvalues.morpho new file mode 100644 index 000000000..d22445999 --- /dev/null +++ b/test/methods/complexmatrix_eigenvalues.morpho @@ -0,0 +1,13 @@ +// Eigenvalues +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=0+0im +A[0,1]=im +A[1,0]=im +A[1,1]=0+0im + +print A + +print A.eigenvalues() +// expect: (0 + 1im, 0 - 1im) diff --git a/test/methods/matrix_eigensystem.morpho b/test/methods/matrix_eigensystem.morpho new file mode 100644 index 000000000..ea7dfd988 --- /dev/null +++ b/test/methods/matrix_eigensystem.morpho @@ -0,0 +1,16 @@ +// Eigenvalues and eigenvectors +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=0 +A[0,1]=1 +A[1,0]=1 +A[1,1]=0 + +var es=A.eigensystem() + +print es + +print es[0] + +print es[1] diff --git a/test/methods/matrix_eigenvalues.morpho b/test/methods/matrix_eigenvalues.morpho new file mode 100644 index 000000000..430f25baf --- /dev/null +++ b/test/methods/matrix_eigenvalues.morpho @@ -0,0 +1,11 @@ +// Eigenvalues +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=0 +A[0,1]=1 +A[1,0]=1 +A[1,1]=0 + +print A.eigenvalues() +// expect: (-1, 1) From f4ea12016b96f108613b4ab8e9d9061bdb6b1de5 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 23 Dec 2025 16:35:03 -0500 Subject: [PATCH 128/473] Add scalar or nil to XMatrix --- src/newlinalg.c | 1 + src/newlinalg.h | 3 ++ src/xmatrix.c | 40 ++++++++++++++++++++++++ test/arithmetic/matrix_add_nil.morpho | 8 +++++ test/arithmetic/matrix_add_scalar.morpho | 8 +++++ test/arithmetic/matrix_sub_scalar.morpho | 8 +++++ 6 files changed, 68 insertions(+) create mode 100644 test/arithmetic/matrix_add_nil.morpho create mode 100644 test/arithmetic/matrix_add_scalar.morpho create mode 100644 test/arithmetic/matrix_sub_scalar.morpho diff --git a/src/newlinalg.c b/src/newlinalg.c index 9789b4640..5c66b3068 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -41,6 +41,7 @@ void newlinalg_initialize(void) { morpho_defineerror(LINALG_LAPACK_ARGS, ERROR_HALT, LINALG_LAPACK_ARGS_MSG); morpho_defineerror(LINALG_OPFAILED, ERROR_HALT, LINALG_OPFAILED_MSG); morpho_defineerror(LINALG_NOTSUPPORTED, ERROR_HALT, LINALG_NOTSUPPORTED_MSG); + morpho_defineerror(LINALG_INVLDARGS, ERROR_HALT, LINALG_INVLDARGS_MSG); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index 95241ee73..365501dfd 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -52,6 +52,9 @@ typedef enum { #define LINALG_NOTSUPPORTED "LnAlgMtrxNtSpprtd" #define LINALG_NOTSUPPORTED_MSG "Operation not supported for this matrix type." +#define LINALG_INVLDARGS "LnAlgMtrxInvldArg" +#define LINALG_INVLDARGS_MSG "Invalid arguments to matrix method." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/src/xmatrix.c b/src/xmatrix.c index 7490facdd..8ba233379 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -226,6 +226,14 @@ linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, dou return LINALGERR_OK; } +/** Performs x <- z + alpha */ +linalgError_t xmatrix_addscalar(objectxmatrix *a, double alpha) { + for (MatrixCount_t i=0; incols*a->nrows; i++) { + a->elements[i*a->nvals]+=alpha; + } + return MATRIX_OK; +} + /* ---------------------- * Unary operations * ---------------------- */ @@ -519,6 +527,7 @@ value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { * Arithmetic * ---------- */ +/** Add a vector */ static value _axpy(vm *v, int nargs, value *args, double alpha) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -534,14 +543,41 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { return out; } +/** Add a scalar */ +static value _xpa(vm *v, int nargs, value *args, double beta) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + double alpha; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { + objectxmatrix *new = xmatrix_clone(a); + if (new) xmatrix_addscalar(new, alpha*beta); + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INVLDARGS); + + return out; +} + value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,1.0); } +value XMatrix_add__nil(vm *v, int nargs, value *args) { + return MORPHO_SELF(args); +} + +value XMatrix_add__x(vm *v, int nargs, value *args) { + return _xpa(v,nargs,args,1.0); +} + value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,-1.0); } +value XMatrix_sub__x(vm *v, int nargs, value *args) { + return _xpa(v,nargs,args,-1.0); +} + value XMatrix_mul__float(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value out=MORPHO_NIL; @@ -811,7 +847,11 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex_ MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), diff --git a/test/arithmetic/matrix_add_nil.morpho b/test/arithmetic/matrix_add_nil.morpho new file mode 100644 index 000000000..23f4f313c --- /dev/null +++ b/test/arithmetic/matrix_add_nil.morpho @@ -0,0 +1,8 @@ +// Add a scalar +import newlinalg + +var A = XMatrix(2,2) + +print A + nil +// expect: [ 0 0 ] +// expect: [ 0 0 ] diff --git a/test/arithmetic/matrix_add_scalar.morpho b/test/arithmetic/matrix_add_scalar.morpho new file mode 100644 index 000000000..8d4569089 --- /dev/null +++ b/test/arithmetic/matrix_add_scalar.morpho @@ -0,0 +1,8 @@ +// Add a scalar +import newlinalg + +var A = XMatrix(2,2) + +print A + 2 +// expect: [ 2 2 ] +// expect: [ 2 2 ] diff --git a/test/arithmetic/matrix_sub_scalar.morpho b/test/arithmetic/matrix_sub_scalar.morpho new file mode 100644 index 000000000..511a29b97 --- /dev/null +++ b/test/arithmetic/matrix_sub_scalar.morpho @@ -0,0 +1,8 @@ +// Subtract a scalar +import newlinalg + +var A = XMatrix(2,2) + +print A - 2 +// expect: [ -2 -2 ] +// expect: [ -2 -2 ] From a58595d0cedc3bc563bc3541db7e62621387c420 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 23 Dec 2025 18:50:17 -0500 Subject: [PATCH 129/473] Add scalars, nil and more to complexmatrix --- src/xcomplexmatrix.c | 8 ++++- src/xmatrix.c | 29 ++++++++++++------- src/xmatrix.h | 4 +++ test/arithmetic/complexmatrix_add_nil.morpho | 8 +++++ .../complexmatrix_add_scalar.morpho | 10 +++++++ test/arithmetic/complexmatrix_addr_nil.morpho | 8 +++++ .../complexmatrix_sub_scalar.morpho | 10 +++++++ .../complexmatrix_subr_scalar.morpho | 10 +++++++ test/arithmetic/matrix_addr_nil.morpho | 9 ++++++ test/arithmetic/matrix_addr_scalar.morpho | 8 +++++ test/arithmetic/matrix_subr_scalar.morpho | 10 +++++++ 11 files changed, 103 insertions(+), 11 deletions(-) create mode 100644 test/arithmetic/complexmatrix_add_nil.morpho create mode 100644 test/arithmetic/complexmatrix_add_scalar.morpho create mode 100644 test/arithmetic/complexmatrix_addr_nil.morpho create mode 100644 test/arithmetic/complexmatrix_sub_scalar.morpho create mode 100644 test/arithmetic/complexmatrix_subr_scalar.morpho create mode 100644 test/arithmetic/matrix_addr_nil.morpho create mode 100644 test/arithmetic/matrix_addr_scalar.morpho create mode 100644 test/arithmetic/matrix_subr_scalar.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 76028bcbc..def380981 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -275,9 +275,15 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), - MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 8ba233379..299312753 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -226,10 +226,13 @@ linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, dou return LINALGERR_OK; } -/** Performs x <- z + alpha */ -linalgError_t xmatrix_addscalar(objectxmatrix *a, double alpha) { +/** Performs z <- alpha*z + beta */ +linalgError_t xmatrix_addscalar(objectxmatrix *a, double alpha, double beta) { for (MatrixCount_t i=0; incols*a->nrows; i++) { - a->elements[i*a->nvals]+=alpha; + for (int k=0; knvals; k++) { + a->elements[i*a->nvals+k]*=alpha; + if (k==0) a->elements[i*a->nvals+k]+=beta; + } } return MATRIX_OK; } @@ -544,14 +547,14 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { } /** Add a scalar */ -static value _xpa(vm *v, int nargs, value *args, double beta) { +static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value out=MORPHO_NIL; - double alpha; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { + double beta; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &beta)) { objectxmatrix *new = xmatrix_clone(a); - if (new) xmatrix_addscalar(new, alpha*beta); + if (new) xmatrix_addscalar(new, sgna, beta*sgnb); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INVLDARGS); @@ -567,7 +570,7 @@ value XMatrix_add__nil(vm *v, int nargs, value *args) { } value XMatrix_add__x(vm *v, int nargs, value *args) { - return _xpa(v,nargs,args,1.0); + return _xpa(v,nargs,args,1.0,1.0); } value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { @@ -575,7 +578,11 @@ value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { } value XMatrix_sub__x(vm *v, int nargs, value *args) { - return _xpa(v,nargs,args,-1.0); + return _xpa(v,nargs,args,1.0,-1.0); +} + +value XMatrix_subr__x(vm *v, int nargs, value *args) { + return _xpa(v,nargs,args,-1.0,1.0); } value XMatrix_mul__float(vm *v, int nargs, value *args) { @@ -836,7 +843,6 @@ value XMatrix_dimensions(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(XMatrix) - MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), @@ -849,9 +855,12 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setc MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "XMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index d4866eb63..c7fa2be5f 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -121,7 +121,11 @@ value XMatrix_getcolumn__int(vm *v, int nargs, value *args); value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); value XMatrix_add__xmatrix(vm *v, int nargs, value *args); +value XMatrix_add__nil(vm *v, int nargs, value *args); +value XMatrix_add__x(vm *v, int nargs, value *args); value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); +value XMatrix_sub__x(vm *v, int nargs, value *args); +value XMatrix_subr__x(vm *v, int nargs, value *args); value XMatrix_mul__float(vm *v, int nargs, value *args); value XMatrix_div__float(vm *v, int nargs, value *args); value XMatrix_div__xmatrix(vm *v, int nargs, value *args); diff --git a/test/arithmetic/complexmatrix_add_nil.morpho b/test/arithmetic/complexmatrix_add_nil.morpho new file mode 100644 index 000000000..b5fb8c5fb --- /dev/null +++ b/test/arithmetic/complexmatrix_add_nil.morpho @@ -0,0 +1,8 @@ +// Add a scalar +import newlinalg + +var A = ComplexMatrix(2,2) + +print A + nil +// expect: [ 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im ] diff --git a/test/arithmetic/complexmatrix_add_scalar.morpho b/test/arithmetic/complexmatrix_add_scalar.morpho new file mode 100644 index 000000000..99921516f --- /dev/null +++ b/test/arithmetic/complexmatrix_add_scalar.morpho @@ -0,0 +1,10 @@ +// Add a scalar +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[1,1]=1+im + +print A + 2 +// expect: [ 3 + 1im 2 + 0im ] +// expect: [ 2 + 0im 3 + 1im ] diff --git a/test/arithmetic/complexmatrix_addr_nil.morpho b/test/arithmetic/complexmatrix_addr_nil.morpho new file mode 100644 index 000000000..16c4faded --- /dev/null +++ b/test/arithmetic/complexmatrix_addr_nil.morpho @@ -0,0 +1,8 @@ +// Add a scalar +import newlinalg + +var A = ComplexMatrix(2,2) + +print nil + A +// expect: [ 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im ] diff --git a/test/arithmetic/complexmatrix_sub_scalar.morpho b/test/arithmetic/complexmatrix_sub_scalar.morpho new file mode 100644 index 000000000..fed8777b9 --- /dev/null +++ b/test/arithmetic/complexmatrix_sub_scalar.morpho @@ -0,0 +1,10 @@ +// Subtract a scalar +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=2+2im +A[1,1]=2+2im + +print A - 2 +// expect: [ 0 + 2im -2 + 0im ] +// expect: [ -2 + 0im 0 + 2im ] \ No newline at end of file diff --git a/test/arithmetic/complexmatrix_subr_scalar.morpho b/test/arithmetic/complexmatrix_subr_scalar.morpho new file mode 100644 index 000000000..547e355c2 --- /dev/null +++ b/test/arithmetic/complexmatrix_subr_scalar.morpho @@ -0,0 +1,10 @@ +// Subtract a scalar +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[1,1]=1+im + +print 2 - A +// expect: [ 1 - 1im 2 + 0im ] +// expect: [ 2 + 0im 1 - 1im ] diff --git a/test/arithmetic/matrix_addr_nil.morpho b/test/arithmetic/matrix_addr_nil.morpho new file mode 100644 index 000000000..2cd52c765 --- /dev/null +++ b/test/arithmetic/matrix_addr_nil.morpho @@ -0,0 +1,9 @@ +// Add nil from the right +import newlinalg + +var A = XMatrix(2,2) +A += 1 + +print nil + A +// expect: [ 1 1 ] +// expect: [ 1 1 ] diff --git a/test/arithmetic/matrix_addr_scalar.morpho b/test/arithmetic/matrix_addr_scalar.morpho new file mode 100644 index 000000000..e50b33364 --- /dev/null +++ b/test/arithmetic/matrix_addr_scalar.morpho @@ -0,0 +1,8 @@ +// Add a scalar from the right +import newlinalg + +var A = XMatrix(2,2) + +print 2 + A +// expect: [ 2 2 ] +// expect: [ 2 2 ] diff --git a/test/arithmetic/matrix_subr_scalar.morpho b/test/arithmetic/matrix_subr_scalar.morpho new file mode 100644 index 000000000..02ac3acdc --- /dev/null +++ b/test/arithmetic/matrix_subr_scalar.morpho @@ -0,0 +1,10 @@ +// Subtract a scalar +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[1,1]=1 + +print 2 - A +// expect: [ 1 2 ] +// expect: [ 2 1 ] From 464293c8cefb2b9307b32bf3b0f323baee250552 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 23 Dec 2025 19:09:12 -0500 Subject: [PATCH 130/473] Transpose --- src/xcomplexmatrix.c | 1 + src/xmatrix.c | 45 +++++++++++++++++---- src/xmatrix.h | 5 ++- test/methods/complexmatrix_transpose.morpho | 14 +++++++ test/methods/matrix_transpose.morpho | 14 +++++++ 5 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 test/methods/complexmatrix_transpose.morpho create mode 100644 test/methods/matrix_transpose.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index def380981..bf820fad3 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -291,6 +291,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div_ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 299312753..e5a5e7d39 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -226,15 +226,29 @@ linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, dou return LINALGERR_OK; } -/** Performs z <- alpha*z + beta */ -linalgError_t xmatrix_addscalar(objectxmatrix *a, double alpha, double beta) { - for (MatrixCount_t i=0; incols*a->nrows; i++) { - for (int k=0; knvals; k++) { - a->elements[i*a->nvals+k]*=alpha; - if (k==0) a->elements[i*a->nvals+k]+=beta; +/** Performs x <- alpha*x + beta */ +linalgError_t xmatrix_addscalar(objectxmatrix *x, double alpha, double beta) { + for (MatrixCount_t i=0; incols*x->nrows; i++) { + for (int k=0; knvals; k++) { + x->elements[i*x->nvals+k]*=alpha; + if (k==0) x->elements[i*x->nvals+k]+=beta; } } - return MATRIX_OK; + return LINALGERR_OK; +} + +/** Performs y <- x^T>*/ +linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y) { + if (!(x->ncols==y->nrows && x->nrows==y->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + for (MatrixCount_t i=0; incols; i++) { + for (MatrixCount_t j=0; jnrows; j++) { + for (int k=0; knvals; k++) { + y->elements[j*y->nrows*y->nvals+i*y->nvals+k] = x->elements[i*x->nrows*x->nvals+j*x->nvals+k]; + } + } + } + return LINALGERR_OK; } /* ---------------------- @@ -698,6 +712,22 @@ value XMatrix_inverse(vm *v, int nargs, value *args) { return out; } +/** Inverts a matrix */ +value XMatrix_transpose(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + objectxmatrix *new = xmatrix_clone(a); + if (new) { + new->ncols=a->nrows; + new->nrows=a->ncols; + LINALG_ERRCHECKVM(xmatrix_transpose(a, new)); + } + out = morpho_wrapandbind(v, (object *) new); + + return out; +} + bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { value ev[n]; for (int i=0; i Date: Tue, 23 Dec 2025 23:21:15 -0500 Subject: [PATCH 131/473] Add in additional tests --- TEST_COVERAGE_ANALYSIS.md | 176 ++++++++++++++++++ .../complexmatrix_div_matrix.morpho | 17 ++ .../complexmatrix_div_scalar.morpho | 11 ++ .../complexmatrix_mul_matrix.morpho | 19 ++ .../complexmatrix_mul_scalar.morpho | 11 ++ test/arithmetic/matrix_div_matrix.morpho | 17 ++ test/arithmetic/matrix_div_scalar.morpho | 11 ++ test/arithmetic/matrix_mul_matrix.morpho | 19 ++ test/arithmetic/matrix_mul_scalar.morpho | 11 ++ test/assign/complexmatrix_clone.morpho | 19 ++ .../complexmatrix_constructor.morpho | 10 + ...mplexmatrix_incompatible_dimensions.morpho | 13 ++ .../complexmatrix_index_out_of_bounds.morpho | 10 + .../complexmatrix_non_square_error.morpho | 10 + test/index/complexmatrix_setindex.morpho | 21 +++ test/methods/complexmatrix_count.morpho | 14 ++ test/methods/complexmatrix_dimensions.morpho | 9 + test/methods/complexmatrix_inner.morpho | 18 ++ .../complexmatrix_inverse_singular.morpho | 12 ++ test/methods/complexmatrix_reshape.morpho | 16 ++ test/methods/matrix_count.morpho | 14 ++ test/methods/matrix_dimensions.morpho | 9 + test/methods/matrix_inner.morpho | 18 ++ test/methods/matrix_norm.morpho | 12 ++ test/methods/matrix_reshape.morpho | 16 ++ 25 files changed, 513 insertions(+) create mode 100644 TEST_COVERAGE_ANALYSIS.md create mode 100644 test/arithmetic/complexmatrix_div_matrix.morpho create mode 100644 test/arithmetic/complexmatrix_div_scalar.morpho create mode 100644 test/arithmetic/complexmatrix_mul_matrix.morpho create mode 100644 test/arithmetic/complexmatrix_mul_scalar.morpho create mode 100644 test/arithmetic/matrix_div_matrix.morpho create mode 100644 test/arithmetic/matrix_div_scalar.morpho create mode 100644 test/arithmetic/matrix_mul_matrix.morpho create mode 100644 test/arithmetic/matrix_mul_scalar.morpho create mode 100644 test/assign/complexmatrix_clone.morpho create mode 100644 test/constructors/complexmatrix_constructor.morpho create mode 100644 test/errors/complexmatrix_incompatible_dimensions.morpho create mode 100644 test/errors/complexmatrix_index_out_of_bounds.morpho create mode 100644 test/errors/complexmatrix_non_square_error.morpho create mode 100644 test/index/complexmatrix_setindex.morpho create mode 100644 test/methods/complexmatrix_count.morpho create mode 100644 test/methods/complexmatrix_dimensions.morpho create mode 100644 test/methods/complexmatrix_inner.morpho create mode 100644 test/methods/complexmatrix_inverse_singular.morpho create mode 100644 test/methods/complexmatrix_reshape.morpho create mode 100644 test/methods/matrix_count.morpho create mode 100644 test/methods/matrix_dimensions.morpho create mode 100644 test/methods/matrix_inner.morpho create mode 100644 test/methods/matrix_norm.morpho create mode 100644 test/methods/matrix_reshape.morpho diff --git a/TEST_COVERAGE_ANALYSIS.md b/TEST_COVERAGE_ANALYSIS.md new file mode 100644 index 000000000..6bce7c99b --- /dev/null +++ b/TEST_COVERAGE_ANALYSIS.md @@ -0,0 +1,176 @@ +# Test Coverage Analysis for morpho-newlinalg + +## Overview +This document analyzes the completeness of the test suite for the linear algebra library, with a focus on ComplexMatrix functionality. + +## Current Test Coverage + +### Constructors +**XMatrix:** +- ✅ `matrix_constructor.morpho` - Basic constructor +- ✅ `matrix_list_constructor.morpho` - Constructor from list of lists +- ✅ `vector_constructor.morpho` - Vector constructor + +**ComplexMatrix:** +- ❌ Missing: `complexmatrix_constructor.morpho` - Basic constructor test +- ❌ Missing: `complexmatrix_list_constructor.morpho` - Constructor from list (if supported) + +### Indexing Operations +**XMatrix:** +- ✅ `matrix_getindex.morpho` - Get element by index +- ✅ `matrix_setindex.morpho` - Set element by index +- ✅ `matrix_getcolumn.morpho` - Get column +- ✅ `matrix_setcolumn.morpho` - Set column + +**ComplexMatrix:** +- ✅ `complexmatrix_getindex.morpho` - Get element by index +- ❌ Missing: `complexmatrix_setindex.morpho` - Set element by index +- ✅ `complexmatrix_getcolumn.morpho` - Get column +- ✅ `complexmatrix_setcolumn.morpho` - Set column + +### Arithmetic Operations +**XMatrix:** +- ✅ `matrix_add_scalar.morpho` - Add scalar +- ✅ `matrix_add_nil.morpho` - Add nil +- ✅ `matrix_addr_nil.morpho` - Addr nil +- ✅ `matrix_addr_scalar.morpho` - Addr scalar +- ✅ `matrix_sub_scalar.morpho` - Subtract scalar +- ✅ `matrix_subr_scalar.morpho` - Subr scalar +- ✅ `matrix_acc.morpho` - Accumulate +- ❌ Missing: `matrix_mul_scalar.morpho` - Multiply by scalar +- ❌ Missing: `matrix_mul_matrix.morpho` - Matrix multiplication +- ❌ Missing: `matrix_div_scalar.morpho` - Divide by scalar +- ❌ Missing: `matrix_div_matrix.morpho` - Matrix division (solve) + +**ComplexMatrix:** +- ✅ `complexmatrix_add_scalar.morpho` - Add scalar +- ✅ `complexmatrix_add_nil.morpho` - Add nil +- ✅ `complexmatrix_addr_nil.morpho` - Addr nil +- ❌ Missing: `complexmatrix_sub_scalar.morpho` - Subtract scalar (exists but may need verification) +- ✅ `complexmatrix_subr_scalar.morpho` - Subr scalar +- ✅ `complexmatrix_acc.morpho` - Accumulate +- ❌ Missing: `complexmatrix_mul_scalar.morpho` - Multiply by scalar +- ❌ Missing: `complexmatrix_mul_matrix.morpho` - Matrix multiplication +- ❌ Missing: `complexmatrix_div_scalar.morpho` - Divide by scalar +- ❌ Missing: `complexmatrix_div_matrix.morpho` - Matrix division (solve) + +### Assignment and Cloning +**XMatrix:** +- ✅ `matrix_assign.morpho` - Assignment + +**ComplexMatrix:** +- ✅ `complexmatrix_assign.morpho` - Assignment +- ❌ Missing: `complexmatrix_clone.morpho` - Clone test + +### Methods +**XMatrix:** +- ✅ `matrix_trace.morpho` - Trace +- ✅ `matrix_inverse.morpho` - Inverse +- ✅ `matrix_inverse_singular.morpho` - Inverse error case +- ✅ `matrix_transpose.morpho` - Transpose +- ✅ `matrix_eigenvalues.morpho` - Eigenvalues +- ✅ `matrix_eigensystem.morpho` - Eigensystem +- ✅ `matrix_enumerate.morpho` - Enumerate +- ❌ Missing: `matrix_inner.morpho` - Inner product +- ❌ Missing: `matrix_norm.morpho` - Norm +- ❌ Missing: `matrix_count.morpho` - Count +- ❌ Missing: `matrix_dimensions.morpho` - Dimensions +- ❌ Missing: `matrix_reshape.morpho` - Reshape + +**ComplexMatrix:** +- ✅ `complexmatrix_trace.morpho` - Trace +- ✅ `complexmatrix_inverse.morpho` - Inverse +- ❌ Missing: `complexmatrix_inverse_singular.morpho` - Inverse error case +- ✅ `complexmatrix_transpose.morpho` - Transpose +- ✅ `complexmatrix_eigenvalues.morpho` - Eigenvalues +- ✅ `complexmatrix_eigensystem.morpho` - Eigensystem +- ✅ `complexmatrix_enumerate.morpho` - Enumerate +- ❌ Missing: `complexmatrix_inner.morpho` - Inner product +- ❌ Missing: `complexmatrix_count.morpho` - Count +- ❌ Missing: `complexmatrix_dimensions.morpho` - Dimensions +- ❌ Missing: `complexmatrix_reshape.morpho` - Reshape + +## Missing Test Categories + +### 1. Error Handling Tests +- **Out of bounds indexing** - Test negative indices, indices >= matrix dimensions +- **Incompatible dimensions** - Test arithmetic operations with mismatched dimensions +- **Non-square matrix errors** - Test operations requiring square matrices (trace, inverse, eigenvalues) on non-square matrices +- **Singular matrix errors** - Test inverse on singular complex matrices +- **Division by zero** - Test scalar division by zero + +### 2. Edge Cases +- **Empty matrices** - 0x0, 0x1, 1x0 matrices +- **Single element matrices** - 1x1 matrices +- **Large matrices** - Stress tests for large dimensions +- **Zero matrices** - Operations with all-zero matrices +- **Identity matrices** - Operations with identity matrices (if constructor exists) + +### 3. Complex-Specific Tests +- **Pure real matrices** - ComplexMatrix with all real values +- **Pure imaginary matrices** - ComplexMatrix with all imaginary values +- **Complex conjugation** - Test if inner product uses conjugation correctly +- **Complex arithmetic edge cases** - Operations with very small/large complex numbers + +### 4. Integration Tests +- **Chained operations** - Multiple operations in sequence +- **Mixed operations** - Combining different operations +- **Memory management** - Large number of operations to check for leaks + +## Recommended New Tests + +### ✅ Created Tests (High Priority - Core Functionality) + +1. ✅ **complexmatrix_constructor.morpho** - Basic constructor test +2. ✅ **complexmatrix_mul_matrix.morpho** - Matrix multiplication +3. ✅ **complexmatrix_mul_scalar.morpho** - Scalar multiplication +4. ✅ **complexmatrix_div_scalar.morpho** - Scalar division +5. ✅ **complexmatrix_div_matrix.morpho** - Matrix division (linear solve) +6. ✅ **complexmatrix_inner.morpho** - Inner product +7. ✅ **complexmatrix_inverse_singular.morpho** - Error case for singular matrix +8. ✅ **complexmatrix_count.morpho** - Count elements +9. ✅ **complexmatrix_dimensions.morpho** - Get dimensions +10. ✅ **complexmatrix_reshape.morpho** - Reshape matrix +11. ✅ **complexmatrix_setindex.morpho** - Set element by index +12. ✅ **complexmatrix_clone.morpho** - Clone matrix + +### ✅ Created Tests (Error Cases) + +13. ✅ **complexmatrix_index_out_of_bounds.morpho** - Out of bounds indexing +14. ✅ **complexmatrix_incompatible_dimensions.morpho** - Dimension mismatch errors +15. ✅ **complexmatrix_non_square_error.morpho** - Non-square matrix errors + +### ✅ Created Tests (XMatrix Missing Tests) + +16. ✅ **matrix_mul_matrix.morpho** - XMatrix matrix multiplication +17. ✅ **matrix_mul_scalar.morpho** - XMatrix scalar multiplication +18. ✅ **matrix_div_scalar.morpho** - XMatrix scalar division +19. ✅ **matrix_div_matrix.morpho** - XMatrix matrix division +20. ✅ **matrix_inner.morpho** - XMatrix inner product +21. ✅ **matrix_norm.morpho** - XMatrix norm +22. ✅ **matrix_count.morpho** - XMatrix count +23. ✅ **matrix_dimensions.morpho** - XMatrix dimensions +24. ✅ **matrix_reshape.morpho** - XMatrix reshape + +### Lower Priority (Edge Cases) + +23. **complexmatrix_empty.morpho** - Empty matrix operations +24. **complexmatrix_single_element.morpho** - 1x1 matrix +25. **complexmatrix_zero.morpho** - Zero matrix operations +26. **complexmatrix_pure_real.morpho** - Real-valued complex matrix +27. **complexmatrix_pure_imaginary.morpho** - Imaginary-valued complex matrix + +## Test Organization Suggestions + +Consider organizing tests into additional subdirectories: +- `errors/` - Error handling tests +- `edge_cases/` - Edge case tests +- `integration/` - Integration tests + +## Notes + +- ComplexMatrix does NOT have a `norm()` method (unlike XMatrix) +- Some operations may need tests for both real and complex scalars +- The `inner()` method for ComplexMatrix uses complex conjugation (Frobenius inner product) +- Matrix division (`/`) is implemented as solving a linear system + diff --git a/test/arithmetic/complexmatrix_div_matrix.morpho b/test/arithmetic/complexmatrix_div_matrix.morpho new file mode 100644 index 000000000..a41a8967b --- /dev/null +++ b/test/arithmetic/complexmatrix_div_matrix.morpho @@ -0,0 +1,17 @@ +// Divide ComplexMatrix by ComplexMatrix (solve linear system) +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+0im +A[0,1]=0+1im +A[1,0]=1+0im +A[1,1]=1+1im + +var b = ComplexMatrix(2,1) +b[0,0]=1+1im +b[1,0]=2+0im + +print b / A +// expect: [ 1 + 0im ] +// expect: [ 1 + 1im ] + diff --git a/test/arithmetic/complexmatrix_div_scalar.morpho b/test/arithmetic/complexmatrix_div_scalar.morpho new file mode 100644 index 000000000..8f5e2d3af --- /dev/null +++ b/test/arithmetic/complexmatrix_div_scalar.morpho @@ -0,0 +1,11 @@ +// Divide ComplexMatrix by scalar +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=2+2im +A[1,1]=4+4im + +print A / 2 +// expect: [ 1 + 1im 0 + 0im ] +// expect: [ 0 + 0im 2 + 2im ] + diff --git a/test/arithmetic/complexmatrix_mul_matrix.morpho b/test/arithmetic/complexmatrix_mul_matrix.morpho new file mode 100644 index 000000000..15fb9b0dd --- /dev/null +++ b/test/arithmetic/complexmatrix_mul_matrix.morpho @@ -0,0 +1,19 @@ +// Multiply two ComplexMatrices +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = ComplexMatrix(2,2) +B[0,0]=1+0im +B[0,1]=0+1im +B[1,0]=1+0im +B[1,1]=0+1im + +print A * B +// expect: [ 3 + 1im 2 + 3im ] +// expect: [ 7 + 3im 4 + 7im ] + diff --git a/test/arithmetic/complexmatrix_mul_scalar.morpho b/test/arithmetic/complexmatrix_mul_scalar.morpho new file mode 100644 index 000000000..66f9379a2 --- /dev/null +++ b/test/arithmetic/complexmatrix_mul_scalar.morpho @@ -0,0 +1,11 @@ +// Multiply ComplexMatrix by scalar +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[1,1]=2+2im + +print A * 2 +// expect: [ 2 + 2im 0 + 0im ] +// expect: [ 0 + 0im 4 + 4im ] + diff --git a/test/arithmetic/matrix_div_matrix.morpho b/test/arithmetic/matrix_div_matrix.morpho new file mode 100644 index 000000000..eb37485b9 --- /dev/null +++ b/test/arithmetic/matrix_div_matrix.morpho @@ -0,0 +1,17 @@ +// Divide XMatrix by XMatrix (solve linear system) +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +var b = XMatrix(2,1) +b[0]=1 +b[1]=2 + +print b / A +// expect: [ 0 ] +// expect: [ 0.5 ] + diff --git a/test/arithmetic/matrix_div_scalar.morpho b/test/arithmetic/matrix_div_scalar.morpho new file mode 100644 index 000000000..79a829ccc --- /dev/null +++ b/test/arithmetic/matrix_div_scalar.morpho @@ -0,0 +1,11 @@ +// Divide XMatrix by scalar +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=2 +A[1,1]=4 + +print A / 2 +// expect: [ 1 0 ] +// expect: [ 0 2 ] + diff --git a/test/arithmetic/matrix_mul_matrix.morpho b/test/arithmetic/matrix_mul_matrix.morpho new file mode 100644 index 000000000..01ec46ed9 --- /dev/null +++ b/test/arithmetic/matrix_mul_matrix.morpho @@ -0,0 +1,19 @@ +// Multiply two XMatrices +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +var B = XMatrix(2,2) +B[0,0]=1 +B[0,1]=0 +B[1,0]=0 +B[1,1]=1 + +print A * B +// expect: [ 1 2 ] +// expect: [ 3 4 ] + diff --git a/test/arithmetic/matrix_mul_scalar.morpho b/test/arithmetic/matrix_mul_scalar.morpho new file mode 100644 index 000000000..190e4def4 --- /dev/null +++ b/test/arithmetic/matrix_mul_scalar.morpho @@ -0,0 +1,11 @@ +// Multiply XMatrix by scalar +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[1,1]=2 + +print A * 2 +// expect: [ 2 0 ] +// expect: [ 0 4 ] + diff --git a/test/assign/complexmatrix_clone.morpho b/test/assign/complexmatrix_clone.morpho new file mode 100644 index 000000000..3e1a2b618 --- /dev/null +++ b/test/assign/complexmatrix_clone.morpho @@ -0,0 +1,19 @@ +// Clone a ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = A.clone() + +// Modify original +A[0,0]=9+9im + +// Clone should be unchanged +print B +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] + diff --git a/test/constructors/complexmatrix_constructor.morpho b/test/constructors/complexmatrix_constructor.morpho new file mode 100644 index 000000000..daf69f526 --- /dev/null +++ b/test/constructors/complexmatrix_constructor.morpho @@ -0,0 +1,10 @@ +// Create a ComplexMatrix + +import newlinalg + +var A = ComplexMatrix(2,2) + +print A +// expect: [ 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im ] + diff --git a/test/errors/complexmatrix_incompatible_dimensions.morpho b/test/errors/complexmatrix_incompatible_dimensions.morpho new file mode 100644 index 000000000..f9f59eef0 --- /dev/null +++ b/test/errors/complexmatrix_incompatible_dimensions.morpho @@ -0,0 +1,13 @@ +// Incompatible dimensions error +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im + +var B = ComplexMatrix(3,3) +B[0,0]=1+1im + +// Try to add incompatible matrices +print A + B +// expect error 'LnAlgMtrxIncmptbl' + diff --git a/test/errors/complexmatrix_index_out_of_bounds.morpho b/test/errors/complexmatrix_index_out_of_bounds.morpho new file mode 100644 index 000000000..6b09281d5 --- /dev/null +++ b/test/errors/complexmatrix_index_out_of_bounds.morpho @@ -0,0 +1,10 @@ +// Index out of bounds error +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im + +// Try to access out of bounds +print A[5,5] +// expect error 'LnAlgMtrxIndxBnds' + diff --git a/test/errors/complexmatrix_non_square_error.morpho b/test/errors/complexmatrix_non_square_error.morpho new file mode 100644 index 000000000..16fb77df2 --- /dev/null +++ b/test/errors/complexmatrix_non_square_error.morpho @@ -0,0 +1,10 @@ +// Non-square matrix error (for operations requiring square matrices) +import newlinalg + +var A = ComplexMatrix(2,3) +A[0,0]=1+1im + +// Try trace on non-square matrix +print A.trace() +// expect error 'LnAlgMtrxNtSq' + diff --git a/test/index/complexmatrix_setindex.morpho b/test/index/complexmatrix_setindex.morpho new file mode 100644 index 000000000..ad73e4bf1 --- /dev/null +++ b/test/index/complexmatrix_setindex.morpho @@ -0,0 +1,21 @@ +// Set elements of a ComplexMatrix + +import newlinalg + +var A = ComplexMatrix(2,2) + +// Set using two indices +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +print A +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] + +// Set using single index (vector-like) +A[0] = 5+5im +print A[0,0] +// expect: 5 + 5im + diff --git a/test/methods/complexmatrix_count.morpho b/test/methods/complexmatrix_count.morpho new file mode 100644 index 000000000..481b8eaba --- /dev/null +++ b/test/methods/complexmatrix_count.morpho @@ -0,0 +1,14 @@ +// Count elements in ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,3) +A[0,0]=1+1im +A[0,1]=2+2im +A[0,2]=3+3im +A[1,0]=4+4im +A[1,1]=5+5im +A[1,2]=6+6im + +print A.count() +// expect: 6 + diff --git a/test/methods/complexmatrix_dimensions.morpho b/test/methods/complexmatrix_dimensions.morpho new file mode 100644 index 000000000..1b6cb8b93 --- /dev/null +++ b/test/methods/complexmatrix_dimensions.morpho @@ -0,0 +1,9 @@ +// Get dimensions of ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,3) +A[0,0]=1+1im + +print A.dimensions() +// expect: (2, 3) + diff --git a/test/methods/complexmatrix_inner.morpho b/test/methods/complexmatrix_inner.morpho new file mode 100644 index 000000000..f747e5a46 --- /dev/null +++ b/test/methods/complexmatrix_inner.morpho @@ -0,0 +1,18 @@ +// Inner product of ComplexMatrices (Frobenius inner product with conjugation) +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = ComplexMatrix(2,2) +B[0,0]=1+0im +B[0,1]=0+1im +B[1,0]=1+0im +B[1,1]=0+1im + +print A.inner(B) +// expect: 10 - 10im + diff --git a/test/methods/complexmatrix_inverse_singular.morpho b/test/methods/complexmatrix_inverse_singular.morpho new file mode 100644 index 000000000..90f1e954d --- /dev/null +++ b/test/methods/complexmatrix_inverse_singular.morpho @@ -0,0 +1,12 @@ +// Inverse of singular ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+0im +A[0,1]=2+0im +A[1,0]=2+0im +A[1,1]=4+0im + +print A.inverse() +// expect error 'LnAlgMtrxSnglr' + diff --git a/test/methods/complexmatrix_reshape.morpho b/test/methods/complexmatrix_reshape.morpho new file mode 100644 index 000000000..e17789d9a --- /dev/null +++ b/test/methods/complexmatrix_reshape.morpho @@ -0,0 +1,16 @@ +// Reshape ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +A.reshape(4,1) +print A +// expect: [ 1 + 1im ] +// expect: [ 2 + 2im ] +// expect: [ 3 + 3im ] +// expect: [ 4 + 4im ] + diff --git a/test/methods/matrix_count.morpho b/test/methods/matrix_count.morpho new file mode 100644 index 000000000..133144aee --- /dev/null +++ b/test/methods/matrix_count.morpho @@ -0,0 +1,14 @@ +// Count elements in XMatrix +import newlinalg + +var A = XMatrix(2,3) +A[0,0]=1 +A[0,1]=2 +A[0,2]=3 +A[1,0]=4 +A[1,1]=5 +A[1,2]=6 + +print A.count() +// expect: 6 + diff --git a/test/methods/matrix_dimensions.morpho b/test/methods/matrix_dimensions.morpho new file mode 100644 index 000000000..ba8eabc1f --- /dev/null +++ b/test/methods/matrix_dimensions.morpho @@ -0,0 +1,9 @@ +// Get dimensions of XMatrix +import newlinalg + +var A = XMatrix(2,3) +A[0,0]=1 + +print A.dimensions() +// expect: (2, 3) + diff --git a/test/methods/matrix_inner.morpho b/test/methods/matrix_inner.morpho new file mode 100644 index 000000000..f37c665e4 --- /dev/null +++ b/test/methods/matrix_inner.morpho @@ -0,0 +1,18 @@ +// Inner product of XMatrices +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +var B = XMatrix(2,2) +B[0,0]=1 +B[0,1]=0 +B[1,0]=0 +B[1,1]=1 + +print A.inner(B) +// expect: 5 + diff --git a/test/methods/matrix_norm.morpho b/test/methods/matrix_norm.morpho new file mode 100644 index 000000000..e64447ca7 --- /dev/null +++ b/test/methods/matrix_norm.morpho @@ -0,0 +1,12 @@ +// Norm of XMatrix +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=3 +A[0,1]=4 +A[1,0]=0 +A[1,1]=0 + +print A.norm() +// expect: 5 + diff --git a/test/methods/matrix_reshape.morpho b/test/methods/matrix_reshape.morpho new file mode 100644 index 000000000..d6722d243 --- /dev/null +++ b/test/methods/matrix_reshape.morpho @@ -0,0 +1,16 @@ +// Reshape XMatrix +import newlinalg + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +A.reshape(4,1) +print A +// expect: [ 1 ] +// expect: [ 2 ] +// expect: [ 3 ] +// expect: [ 4 ] + From d319dfc2fdb36c9b0905372c85323d892cf5eb3e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 23 Dec 2025 23:30:44 -0500 Subject: [PATCH 132/473] Delete TEST_COVERAGE_ANALYSIS.md --- TEST_COVERAGE_ANALYSIS.md | 176 -------------------------------------- 1 file changed, 176 deletions(-) delete mode 100644 TEST_COVERAGE_ANALYSIS.md diff --git a/TEST_COVERAGE_ANALYSIS.md b/TEST_COVERAGE_ANALYSIS.md deleted file mode 100644 index 6bce7c99b..000000000 --- a/TEST_COVERAGE_ANALYSIS.md +++ /dev/null @@ -1,176 +0,0 @@ -# Test Coverage Analysis for morpho-newlinalg - -## Overview -This document analyzes the completeness of the test suite for the linear algebra library, with a focus on ComplexMatrix functionality. - -## Current Test Coverage - -### Constructors -**XMatrix:** -- ✅ `matrix_constructor.morpho` - Basic constructor -- ✅ `matrix_list_constructor.morpho` - Constructor from list of lists -- ✅ `vector_constructor.morpho` - Vector constructor - -**ComplexMatrix:** -- ❌ Missing: `complexmatrix_constructor.morpho` - Basic constructor test -- ❌ Missing: `complexmatrix_list_constructor.morpho` - Constructor from list (if supported) - -### Indexing Operations -**XMatrix:** -- ✅ `matrix_getindex.morpho` - Get element by index -- ✅ `matrix_setindex.morpho` - Set element by index -- ✅ `matrix_getcolumn.morpho` - Get column -- ✅ `matrix_setcolumn.morpho` - Set column - -**ComplexMatrix:** -- ✅ `complexmatrix_getindex.morpho` - Get element by index -- ❌ Missing: `complexmatrix_setindex.morpho` - Set element by index -- ✅ `complexmatrix_getcolumn.morpho` - Get column -- ✅ `complexmatrix_setcolumn.morpho` - Set column - -### Arithmetic Operations -**XMatrix:** -- ✅ `matrix_add_scalar.morpho` - Add scalar -- ✅ `matrix_add_nil.morpho` - Add nil -- ✅ `matrix_addr_nil.morpho` - Addr nil -- ✅ `matrix_addr_scalar.morpho` - Addr scalar -- ✅ `matrix_sub_scalar.morpho` - Subtract scalar -- ✅ `matrix_subr_scalar.morpho` - Subr scalar -- ✅ `matrix_acc.morpho` - Accumulate -- ❌ Missing: `matrix_mul_scalar.morpho` - Multiply by scalar -- ❌ Missing: `matrix_mul_matrix.morpho` - Matrix multiplication -- ❌ Missing: `matrix_div_scalar.morpho` - Divide by scalar -- ❌ Missing: `matrix_div_matrix.morpho` - Matrix division (solve) - -**ComplexMatrix:** -- ✅ `complexmatrix_add_scalar.morpho` - Add scalar -- ✅ `complexmatrix_add_nil.morpho` - Add nil -- ✅ `complexmatrix_addr_nil.morpho` - Addr nil -- ❌ Missing: `complexmatrix_sub_scalar.morpho` - Subtract scalar (exists but may need verification) -- ✅ `complexmatrix_subr_scalar.morpho` - Subr scalar -- ✅ `complexmatrix_acc.morpho` - Accumulate -- ❌ Missing: `complexmatrix_mul_scalar.morpho` - Multiply by scalar -- ❌ Missing: `complexmatrix_mul_matrix.morpho` - Matrix multiplication -- ❌ Missing: `complexmatrix_div_scalar.morpho` - Divide by scalar -- ❌ Missing: `complexmatrix_div_matrix.morpho` - Matrix division (solve) - -### Assignment and Cloning -**XMatrix:** -- ✅ `matrix_assign.morpho` - Assignment - -**ComplexMatrix:** -- ✅ `complexmatrix_assign.morpho` - Assignment -- ❌ Missing: `complexmatrix_clone.morpho` - Clone test - -### Methods -**XMatrix:** -- ✅ `matrix_trace.morpho` - Trace -- ✅ `matrix_inverse.morpho` - Inverse -- ✅ `matrix_inverse_singular.morpho` - Inverse error case -- ✅ `matrix_transpose.morpho` - Transpose -- ✅ `matrix_eigenvalues.morpho` - Eigenvalues -- ✅ `matrix_eigensystem.morpho` - Eigensystem -- ✅ `matrix_enumerate.morpho` - Enumerate -- ❌ Missing: `matrix_inner.morpho` - Inner product -- ❌ Missing: `matrix_norm.morpho` - Norm -- ❌ Missing: `matrix_count.morpho` - Count -- ❌ Missing: `matrix_dimensions.morpho` - Dimensions -- ❌ Missing: `matrix_reshape.morpho` - Reshape - -**ComplexMatrix:** -- ✅ `complexmatrix_trace.morpho` - Trace -- ✅ `complexmatrix_inverse.morpho` - Inverse -- ❌ Missing: `complexmatrix_inverse_singular.morpho` - Inverse error case -- ✅ `complexmatrix_transpose.morpho` - Transpose -- ✅ `complexmatrix_eigenvalues.morpho` - Eigenvalues -- ✅ `complexmatrix_eigensystem.morpho` - Eigensystem -- ✅ `complexmatrix_enumerate.morpho` - Enumerate -- ❌ Missing: `complexmatrix_inner.morpho` - Inner product -- ❌ Missing: `complexmatrix_count.morpho` - Count -- ❌ Missing: `complexmatrix_dimensions.morpho` - Dimensions -- ❌ Missing: `complexmatrix_reshape.morpho` - Reshape - -## Missing Test Categories - -### 1. Error Handling Tests -- **Out of bounds indexing** - Test negative indices, indices >= matrix dimensions -- **Incompatible dimensions** - Test arithmetic operations with mismatched dimensions -- **Non-square matrix errors** - Test operations requiring square matrices (trace, inverse, eigenvalues) on non-square matrices -- **Singular matrix errors** - Test inverse on singular complex matrices -- **Division by zero** - Test scalar division by zero - -### 2. Edge Cases -- **Empty matrices** - 0x0, 0x1, 1x0 matrices -- **Single element matrices** - 1x1 matrices -- **Large matrices** - Stress tests for large dimensions -- **Zero matrices** - Operations with all-zero matrices -- **Identity matrices** - Operations with identity matrices (if constructor exists) - -### 3. Complex-Specific Tests -- **Pure real matrices** - ComplexMatrix with all real values -- **Pure imaginary matrices** - ComplexMatrix with all imaginary values -- **Complex conjugation** - Test if inner product uses conjugation correctly -- **Complex arithmetic edge cases** - Operations with very small/large complex numbers - -### 4. Integration Tests -- **Chained operations** - Multiple operations in sequence -- **Mixed operations** - Combining different operations -- **Memory management** - Large number of operations to check for leaks - -## Recommended New Tests - -### ✅ Created Tests (High Priority - Core Functionality) - -1. ✅ **complexmatrix_constructor.morpho** - Basic constructor test -2. ✅ **complexmatrix_mul_matrix.morpho** - Matrix multiplication -3. ✅ **complexmatrix_mul_scalar.morpho** - Scalar multiplication -4. ✅ **complexmatrix_div_scalar.morpho** - Scalar division -5. ✅ **complexmatrix_div_matrix.morpho** - Matrix division (linear solve) -6. ✅ **complexmatrix_inner.morpho** - Inner product -7. ✅ **complexmatrix_inverse_singular.morpho** - Error case for singular matrix -8. ✅ **complexmatrix_count.morpho** - Count elements -9. ✅ **complexmatrix_dimensions.morpho** - Get dimensions -10. ✅ **complexmatrix_reshape.morpho** - Reshape matrix -11. ✅ **complexmatrix_setindex.morpho** - Set element by index -12. ✅ **complexmatrix_clone.morpho** - Clone matrix - -### ✅ Created Tests (Error Cases) - -13. ✅ **complexmatrix_index_out_of_bounds.morpho** - Out of bounds indexing -14. ✅ **complexmatrix_incompatible_dimensions.morpho** - Dimension mismatch errors -15. ✅ **complexmatrix_non_square_error.morpho** - Non-square matrix errors - -### ✅ Created Tests (XMatrix Missing Tests) - -16. ✅ **matrix_mul_matrix.morpho** - XMatrix matrix multiplication -17. ✅ **matrix_mul_scalar.morpho** - XMatrix scalar multiplication -18. ✅ **matrix_div_scalar.morpho** - XMatrix scalar division -19. ✅ **matrix_div_matrix.morpho** - XMatrix matrix division -20. ✅ **matrix_inner.morpho** - XMatrix inner product -21. ✅ **matrix_norm.morpho** - XMatrix norm -22. ✅ **matrix_count.morpho** - XMatrix count -23. ✅ **matrix_dimensions.morpho** - XMatrix dimensions -24. ✅ **matrix_reshape.morpho** - XMatrix reshape - -### Lower Priority (Edge Cases) - -23. **complexmatrix_empty.morpho** - Empty matrix operations -24. **complexmatrix_single_element.morpho** - 1x1 matrix -25. **complexmatrix_zero.morpho** - Zero matrix operations -26. **complexmatrix_pure_real.morpho** - Real-valued complex matrix -27. **complexmatrix_pure_imaginary.morpho** - Imaginary-valued complex matrix - -## Test Organization Suggestions - -Consider organizing tests into additional subdirectories: -- `errors/` - Error handling tests -- `edge_cases/` - Edge case tests -- `integration/` - Integration tests - -## Notes - -- ComplexMatrix does NOT have a `norm()` method (unlike XMatrix) -- Some operations may need tests for both real and complex scalars -- The `inner()` method for ComplexMatrix uses complex conjugation (Frobenius inner product) -- Matrix division (`/`) is implemented as solving a linear system - From 9401167d3d2379156915ba9c457f7ec83fce6ce1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 23 Dec 2025 23:39:00 -0500 Subject: [PATCH 133/473] Fix minor errors --- src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index bf820fad3..87b622004 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -55,7 +55,7 @@ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v int info, n=a->nrows; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, acopy, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); + info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, (__LAPACK_double_complex *) w, NULL, n, (vec ? vec->elements : NULL), n); #else int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; zgeev_("N", (vec ? "V" : "N"), &n, (__LAPACK_double_complex *) a->elements, &n, (__LAPACK_double_complex *) w, NULL, &n, (__LAPACK_double_complex *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); diff --git a/src/xmatrix.c b/src/xmatrix.c index e5a5e7d39..64e6423f8 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -79,7 +79,7 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, x->elements, n, pivot, y->elements, n); + info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); #else dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); #endif @@ -826,7 +826,7 @@ value XMatrix_inner(vm *v, int nargs, value *args) { /** Reshape a matrix */ value XMatrix_reshape(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); From 001fdcfd42e3f1930a6168feb7b360b87b3a865e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 08:47:06 -0500 Subject: [PATCH 134/473] Generic setindex methods --- src/newlinalg.c | 2 + src/newlinalg.h | 4 ++ src/xcomplexmatrix.c | 38 ++++------ src/xmatrix.c | 23 +++--- src/xmatrix.h | 72 ++++++++++--------- test/index/complexmatrix_setindex_real.morpho | 16 +++++ 6 files changed, 86 insertions(+), 69 deletions(-) create mode 100644 test/index/complexmatrix_setindex_real.morpho diff --git a/src/newlinalg.c b/src/newlinalg.c index 5c66b3068..c8b072d11 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -23,6 +23,7 @@ void linalg_raiseerror(vm *v, linalgError_t err) { case LINALGERR_LAPACK_INVLD_ARGS: morpho_runtimeerror(v, LINALG_LAPACK_ARGS); break; case LINALGERR_OP_FAILED: morpho_runtimeerror(v, LINALG_OPFAILED); break; case LINALGERR_NOT_SUPPORTED: morpho_runtimeerror(v, LINALG_NOTSUPPORTED); break; + case LINALGERR_NON_NUMERICAL: morpho_runtimeerror(v, LINALG_NNNMRCL_ARG); break; case LINALGERR_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; } } @@ -42,6 +43,7 @@ void newlinalg_initialize(void) { morpho_defineerror(LINALG_OPFAILED, ERROR_HALT, LINALG_OPFAILED_MSG); morpho_defineerror(LINALG_NOTSUPPORTED, ERROR_HALT, LINALG_NOTSUPPORTED_MSG); morpho_defineerror(LINALG_INVLDARGS, ERROR_HALT, LINALG_INVLDARGS_MSG); + morpho_defineerror(LINALG_NNNMRCL_ARG, ERROR_HALT, LINALG_NNNMRCL_ARG_MSG); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index 365501dfd..670f9bf11 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -24,6 +24,7 @@ typedef enum { LINALGERR_LAPACK_INVLD_ARGS, // Invalid arguments to LAPACK routine LINALGERR_OP_FAILED, // Matrix operation failed LINALGERR_NOT_SUPPORTED, // Operation not supported for this matrix type + LINALGERR_NON_NUMERICAL, // Non numerical args supplied LINALGERR_ALLOC // Memory allocation failed } linalgError_t; @@ -55,6 +56,9 @@ typedef enum { #define LINALG_INVLDARGS "LnAlgMtrxInvldArg" #define LINALG_INVLDARGS_MSG "Invalid arguments to matrix method." +#define LINALG_NNNMRCL_ARG "LnAlgMtrxNnNmrclArg" +#define LINALG_NNNMRCL_ARG_MSG "Matrix method requires numerical arguments." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 87b622004..dd35ac3ba 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -36,6 +36,15 @@ static value _getelfn(vm *v, double *el) { return morpho_wrapandbind(v, (object *) new); } +static linalgError_t _setelfn(vm *v, value in, double *el) { + if (MORPHO_ISCOMPLEX(in)) { + *((MorphoComplex *) el) = MORPHO_GETCOMPLEX(in)->Z; + } else if (morpho_valuetofloat(in, el)) { + el[1] = 0.0; // Set real part to zero + } else return LINALGERR_NON_NUMERICAL; + return LINALGERR_OK; +} + /** Low level linear solve */ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -161,6 +170,7 @@ linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { matrixinterfacedefn complexmatrixdefn = { .printelfn = _printelfn, .getelfn = _getelfn, + .setelfn = _setelfn, .solvefn = _solve, .eigenfn = _eigen }; @@ -241,38 +251,14 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { return out; } -/* --------- - * setIndex() - * --------- */ - -static value _setindex(vm *v, objectcomplexmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { - if (MORPHO_ISCOMPLEX(in)) { - LINALG_ERRCHECKVM(complexmatrix_setelement(m, i, j, MORPHO_GETCOMPLEX(in)->Z)); - } - return MORPHO_NIL; -} - -value ComplexMatrix_setindex__int_x(vm *v, int nargs, value *args) { - objectcomplexmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _setindex(v, m, i, 0, MORPHO_GETARG(args, 1)); -} - -value ComplexMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { - objectcomplexmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _setindex(v, m, i, j, MORPHO_GETARG(args, 2)); -} - MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int, Complex)", ComplexMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int, Complex)", ComplexMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 64e6423f8..6070d704c 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -74,6 +74,11 @@ static value _getelfn(vm *v, double *el) { return MORPHO_FLOAT(*el); } +static linalgError_t _setelfn(vm *v, value in, double *el) { + if (!morpho_valuetofloat(in, el)) return LINALGERR_NON_NUMERICAL; + return LINALGERR_OK; +} + /** Low level linear solve */ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -332,7 +337,7 @@ linalgError_t xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { /** Solve the linear system a.x = b; automatrically allocates storage depending on size of the matrix * @param[in] a lhs * @param[in|out] b rhs — overwritten by the solution - * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. */ + * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { if (MATRIX_ISSMALL(a)) return xmatrix_solvesmall(a, b); else return xmatrix_solvelarge(a, b); @@ -402,6 +407,7 @@ void xmatrix_print(vm *v, objectxmatrix *m) { matrixinterfacedefn xmatrixdefn = { .printelfn = _printelfn, .getelfn = _getelfn, + .setelfn = _setelfn, .solvefn = _solve, .eigenfn = _eigen }; @@ -497,22 +503,21 @@ value XMatrix_index__int_int(vm *v, int nargs, value *args) { * setindex() * --------- */ -value _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { - double val=0.0; - if (!morpho_valuetofloat(in, &val)) true; // TODO: Should raise an error (Matrix doesn't!) - LINALG_ERRCHECKVM(xmatrix_setelement(m, i, j, val)); - return MORPHO_NIL; +static void _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { + double *elptr=NULL; + LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &elptr)); + if (elptr) LINALG_ERRCHECKVM(xmatrix_getinterface(m)->setelfn(v, in, elptr)); } value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); + _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); } value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); + _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); } /* --------- @@ -826,7 +831,7 @@ value XMatrix_inner(vm *v, int nargs, value *args) { /** Reshape a matrix */ value XMatrix_reshape(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); diff --git a/src/xmatrix.h b/src/xmatrix.h index 44bc4195b..8db0c24b6 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -61,6 +61,9 @@ typedef void (*xmatrix_printelfn_t) (vm *, double *); /** Function that materializes a value from a pointer to an element */ typedef value (*xmatrix_getelfn_t) (vm *, double *); +/** Function that sets the an element given a value */ +typedef linalgError_t (*xmatrix_setelfn_t) (vm *, value, double *); + /** Function that solves the linear system a.x = b * @param[in|out] a - lhs; overwritten by LU decomposition * @param[in|out] b - rhs; overwritten by solution @@ -75,15 +78,12 @@ typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *a, objectxmatrix *b, * @returns a matrix error code */ typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec); -/** Function that sets a given entry given a value */ -//typedef void (*xmatrix_setfn_t) (objectxmatrix *, void *, value v); - typedef struct { xmatrix_printelfn_t printelfn; xmatrix_getelfn_t getelfn; + xmatrix_setelfn_t setelfn; xmatrix_solvefn_t solvefn; xmatrix_eigenfn_t eigenfn; -// xmatrix_setfn_t setfn; } matrixinterfacedefn; void xmatrix_addinterface(matrixinterfacedefn *defn); @@ -111,36 +111,40 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); void xmatrix_initialize(void); -value XMatrix_print(vm *v, int nargs, value *args); -value XMatrix_assign(vm *v, int nargs, value *args); -value XMatrix_clone(vm *v, int nargs, value *args); - -value XMatrix_index__int(vm *v, int nargs, value *args); -value XMatrix_index__int_int(vm *v, int nargs, value *args); - -value XMatrix_getcolumn__int(vm *v, int nargs, value *args); -value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args); - -value XMatrix_add__xmatrix(vm *v, int nargs, value *args); -value XMatrix_add__nil(vm *v, int nargs, value *args); -value XMatrix_add__x(vm *v, int nargs, value *args); -value XMatrix_sub__xmatrix(vm *v, int nargs, value *args); -value XMatrix_sub__x(vm *v, int nargs, value *args); -value XMatrix_subr__x(vm *v, int nargs, value *args); -value XMatrix_mul__float(vm *v, int nargs, value *args); -value XMatrix_div__float(vm *v, int nargs, value *args); -value XMatrix_div__xmatrix(vm *v, int nargs, value *args); -value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args); - -value XMatrix_transpose(vm *v, int nargs, value *args); - -value XMatrix_eigenvalues(vm *v, int nargs, value *args); -value XMatrix_eigensystem(vm *v, int nargs, value *args); - -value XMatrix_reshape(vm *v, int nargs, value *args); -value XMatrix_enumerate(vm *v, int nargs, value *args); -value XMatrix_count(vm *v, int nargs, value *args); -value XMatrix_dimensions(vm *v, int nargs, value *args); +#define IMPLEMENTATIONFN(fn) value fn (vm *v, int nargs, value *args) + +IMPLEMENTATIONFN(XMatrix_print); +IMPLEMENTATIONFN(XMatrix_assign); +IMPLEMENTATIONFN(XMatrix_clone); + +IMPLEMENTATIONFN(XMatrix_index__int); +IMPLEMENTATIONFN(XMatrix_index__int_int); +IMPLEMENTATIONFN(XMatrix_setindex__int_x); +IMPLEMENTATIONFN(XMatrix_setindex__int_int_x); + +IMPLEMENTATIONFN(XMatrix_getcolumn__int); +IMPLEMENTATIONFN(XMatrix_setcolumn__int_xmatrix); + +IMPLEMENTATIONFN(XMatrix_add__xmatrix); +IMPLEMENTATIONFN(XMatrix_add__nil); +IMPLEMENTATIONFN(XMatrix_add__x); +IMPLEMENTATIONFN(XMatrix_sub__xmatrix); +IMPLEMENTATIONFN(XMatrix_sub__x); +IMPLEMENTATIONFN(XMatrix_subr__x); +IMPLEMENTATIONFN(XMatrix_mul__float); +IMPLEMENTATIONFN(XMatrix_div__float); +IMPLEMENTATIONFN(XMatrix_div__xmatrix); +IMPLEMENTATIONFN(XMatrix_acc__x_xmatrix); + +IMPLEMENTATIONFN(XMatrix_transpose); +IMPLEMENTATIONFN(XMatrix_eigenvalues); +IMPLEMENTATIONFN(XMatrix_eigensystem); +IMPLEMENTATIONFN(XMatrix_reshape); +IMPLEMENTATIONFN(XMatrix_enumerate); +IMPLEMENTATIONFN(XMatrix_count); +IMPLEMENTATIONFN(XMatrix_dimensions); + +#undef DECLARE_IMPLEMENTATIONFN /* ------------------------------------------------------- * Interface diff --git a/test/index/complexmatrix_setindex_real.morpho b/test/index/complexmatrix_setindex_real.morpho new file mode 100644 index 000000000..d6ed6f9e3 --- /dev/null +++ b/test/index/complexmatrix_setindex_real.morpho @@ -0,0 +1,16 @@ +// Set elements of a ComplexMatrix with mixture of Complex and Real args + +import newlinalg + +var A = ComplexMatrix(2,2) + +// Set using two indices +A[0,0] = 1+im // Make sure imag part is zero'd out +A[0,0] = 1 +A[0,1] = 2+2im +A[1,0] = 3.0 +A[1,1] = 4+4im + +print A +// expect: [ 1 + 0im 2 + 2im ] +// expect: [ 3 + 0im 4 + 4im ] From a2103d94b3fe09e6c4bd539158072eb916f78ab7 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 10:48:06 -0500 Subject: [PATCH 135/473] Matrix roll --- src/xcomplexmatrix.c | 2 + src/xmatrix.c | 71 +++++++++++++++++++++++++- src/xmatrix.h | 3 ++ test/methods/complexmatrix_roll.morpho | 51 ++++++++++++++++++ test/methods/matrix_roll.morpho | 51 ++++++++++++++++++ 5 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 test/methods/complexmatrix_roll.morpho create mode 100644 test/methods/matrix_roll.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index dd35ac3ba..da019f1fe 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -283,6 +283,8 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) diff --git a/src/xmatrix.c b/src/xmatrix.c index 6070d704c..cd8dcb2ee 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -400,6 +400,52 @@ void xmatrix_print(vm *v, objectxmatrix *m) { } } +/* ---------------------- + * Roll + * ---------------------- */ + +/** Rolls the matrix list */ +static void _rollflat(objectxmatrix *a, objectxmatrix *b, int nplaces) { + MatrixCount_t N=a->nrows*a->ncols*a->nvals; + MatrixCount_t n = abs(nplaces)*a->nvals; + if (n>N) n = n % N; + MatrixCount_t Np = N - n; // Number of elements to roll + + if (nplaces<0) { + memcpy(b->matrixdata, a->matrixdata+n, sizeof(double)*Np); + memcpy(b->matrixdata+Np, a->matrixdata, sizeof(double)*n); + } else { + memcpy(b->matrixdata+n, a->matrixdata, sizeof(double)*Np); + if (n>0) memcpy(b->matrixdata, a->matrixdata+Np, sizeof(double)*n); + } +} + +/** Copies a arow from matrix a into brow for matrix b */ +static void _copyrow(objectxmatrix *a, MatrixIdx_t arow, objectxmatrix *b, MatrixIdx_t brow) { + for (MatrixIdx_t i=0; incols; i++) + for (int k=0; knvals; k++) + b->elements[b->nvals*(i*b->nrows+brow)+k]=a->elements[a->nvals*(i*a->nrows+arow)+k]; +} + +/** Rolls a list by a number of elements along a given axis; stores the result in b */ +linalgError_t xmatrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatrix *b) { + if (!(a->nrows==b->nrows && a->ncols==b->ncols && a->nvals==b->nvals)) return LINALGERR_INCOMPATIBLE_DIM; + + switch(axis) { + case 0: + for (int i=0; inrows; i++) { + int j = (i+nplaces); + while (j<0) j+=a->nrows; + _copyrow(a, i, b, j % a->nrows); + } + break; + case 1: _rollflat(a, b, nplaces*a->nrows); break; + default: return LINALGERR_NOT_SUPPORTED; + } + + return LINALGERR_OK; +} + /* ********************************************************************** * Interface definition * ********************************************************************** */ @@ -733,7 +779,7 @@ value XMatrix_transpose(vm *v, int nargs, value *args) { return out; } -bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { +static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { value ev[n]; for (int i=0; i Date: Wed, 24 Dec 2025 10:57:48 -0500 Subject: [PATCH 136/473] Use memcpy for speed --- src/xmatrix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index cd8dcb2ee..3405b55f5 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -423,8 +423,7 @@ static void _rollflat(objectxmatrix *a, objectxmatrix *b, int nplaces) { /** Copies a arow from matrix a into brow for matrix b */ static void _copyrow(objectxmatrix *a, MatrixIdx_t arow, objectxmatrix *b, MatrixIdx_t brow) { for (MatrixIdx_t i=0; incols; i++) - for (int k=0; knvals; k++) - b->elements[b->nvals*(i*b->nrows+brow)+k]=a->elements[a->nvals*(i*a->nrows+arow)+k]; + memcpy(b->elements+b->nvals*(i*b->nrows+brow), a->elements+a->nvals*(i*a->nrows+arow), sizeof(double)*a->nvals); } /** Rolls a list by a number of elements along a given axis; stores the result in b */ From dd74b9950672397b3fa9b505b91494e98a9a7d99 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 12:34:28 -0500 Subject: [PATCH 137/473] Matrix sum --- src/xcomplexmatrix.c | 3 +- src/xmatrix.c | 45 +++++++++++++++++++++------ src/xmatrix.h | 1 + test/methods/complexmatrix_sum.morpho | 13 ++++++++ test/methods/matrix_sum.morpho | 13 ++++++++ 5 files changed, 64 insertions(+), 11 deletions(-) create mode 100644 test/methods/complexmatrix_sum.morpho create mode 100644 test/methods/matrix_sum.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index da019f1fe..cef4407bb 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -277,9 +277,10 @@ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div_ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", XMatrix_sum, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 3405b55f5..57b18e3d3 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -291,6 +291,21 @@ double xmatrix_linfnorm(objectxmatrix *a) { return a->elements[imax]; } +/** Computes the sum of all elements in a matrix */ +void xmatrix_sum(objectxmatrix *a, double *sum) { + double c[a->nvals], y, t; + for (int i=0; invals; i++) { sum[i]=0; c[i]=0; } + + for (MatrixCount_t i=0; inels; i+=a->nvals) { + for (int k=0; knvals; k++) { + y=a->elements[i+k]-c[k]; + t=sum[k]+y; + c[k]=(t-sum[k])-y; + sum[k]=t; + } + } +} + /** Calculate the trace of a matrix */ linalgError_t xmatrix_trace(objectxmatrix *a, double *out) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; @@ -742,6 +757,15 @@ value XMatrix_norm(vm *v, int nargs, value *args) { return MORPHO_FLOAT(xmatrix_norm(a)); } +/** Sums all matrix values */ +value XMatrix_sum(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + double sum[a->nvals]; + + xmatrix_sum(a, sum); + return xmatrix_getinterface(a)->getelfn(v, sum); +} + /** Computes the trace */ value XMatrix_trace(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -751,29 +775,29 @@ value XMatrix_trace(vm *v, int nargs, value *args) { } /** Inverts a matrix */ -value XMatrix_inverse(vm *v, int nargs, value *args) { +value XMatrix_transpose(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value out=MORPHO_NIL; objectxmatrix *new = xmatrix_clone(a); + if (new) { + new->ncols=a->nrows; + new->nrows=a->ncols; + LINALG_ERRCHECKVM(xmatrix_transpose(a, new)); + } out = morpho_wrapandbind(v, (object *) new); - if (new) LINALG_ERRCHECKVM(xmatrix_inverse(new)); return out; } /** Inverts a matrix */ -value XMatrix_transpose(vm *v, int nargs, value *args) { +value XMatrix_inverse(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value out=MORPHO_NIL; objectxmatrix *new = xmatrix_clone(a); - if (new) { - new->ncols=a->nrows; - new->nrows=a->ncols; - LINALG_ERRCHECKVM(xmatrix_transpose(a, new)); - } out = morpho_wrapandbind(v, (object *) new); + if (new) LINALG_ERRCHECKVM(xmatrix_inverse(new)); return out; } @@ -968,12 +992,13 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__floa MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "XMatrix ()", XMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "XMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 3da60b466..01f757c64 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -137,6 +137,7 @@ IMPLEMENTATIONFN(XMatrix_div__float); IMPLEMENTATIONFN(XMatrix_div__xmatrix); IMPLEMENTATIONFN(XMatrix_acc__x_xmatrix); +IMPLEMENTATIONFN(XMatrix_sum); IMPLEMENTATIONFN(XMatrix_transpose); IMPLEMENTATIONFN(XMatrix_eigenvalues); IMPLEMENTATIONFN(XMatrix_eigensystem); diff --git a/test/methods/complexmatrix_sum.morpho b/test/methods/complexmatrix_sum.morpho new file mode 100644 index 000000000..3354d422b --- /dev/null +++ b/test/methods/complexmatrix_sum.morpho @@ -0,0 +1,13 @@ +// Sum +import newlinalg + +var A = ComplexMatrix(3,2) +A[0,0]=1+im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im +A[2,0]=5+5im +A[2,1]=6+6im + +print A.sum() +// expect: 21 + 21im diff --git a/test/methods/matrix_sum.morpho b/test/methods/matrix_sum.morpho new file mode 100644 index 000000000..68294074f --- /dev/null +++ b/test/methods/matrix_sum.morpho @@ -0,0 +1,13 @@ +// Sum +import newlinalg + +var A = XMatrix(3,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 +A[2,0]=5 +A[2,1]=6 + +print A.sum() +// expect: 21 From c1ad48b47071c8c831b89900d307b2aec8196162 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 13:56:11 -0500 Subject: [PATCH 138/473] Formatted output --- src/xcomplexmatrix.c | 36 ++++++++----- src/xmatrix.c | 68 +++++++++++++++++++----- src/xmatrix.h | 9 ++++ test/methods/complexmatrix_format.morpho | 13 +++++ test/methods/matrix_format.morpho | 13 +++++ 5 files changed, 114 insertions(+), 25 deletions(-) create mode 100644 test/methods/complexmatrix_format.morpho create mode 100644 test/methods/matrix_format.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index cef4407bb..1ba9659bb 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -12,6 +12,7 @@ #include "newlinalg.h" #include "xmatrix.h" #include "xcomplexmatrix.h" +#include "format.h" objecttype objectcomplexmatrixtype; #define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype @@ -31,6 +32,15 @@ static void _printelfn(vm *v, double *el) { complex_print(v, &cmplx); } +static bool _printeltobufffn(varray_char *out, char *format, double *el) { // TODO: format should support complex numbers + if (!format_printtobuffer(MORPHO_FLOAT(el[0]), format, out)) return false; + varray_charadd(out, " ", 1); + varray_charadd(out, (el[1]<0 ? "-" : "+"), 1); + if (!format_printtobuffer(MORPHO_FLOAT(fabs(el[1])), format, out)) return false; + varray_charadd(out, "im", 2); + return true; +} + static value _getelfn(vm *v, double *el) { objectcomplex *new = object_newcomplex(el[0], el[1]); return morpho_wrapandbind(v, (object *) new); @@ -73,6 +83,19 @@ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } +/* ---------------------- + * Interface definition + * ---------------------- */ + +matrixinterfacedefn complexmatrixdefn = { + .printelfn = _printelfn, + .printeltobufffn = _printeltobufffn, + .getelfn = _getelfn, + .setelfn = _setelfn, + .solvefn = _solve, + .eigenfn = _eigen +}; + /* ---------------------- * Constructor * ---------------------- */ @@ -163,18 +186,6 @@ linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } -/* ********************************************************************** - * Interface definition - * ********************************************************************** */ - -matrixinterfacedefn complexmatrixdefn = { - .printelfn = _printelfn, - .getelfn = _getelfn, - .setelfn = _setelfn, - .solvefn = _solve, - .eigenfn = _eigen -}; - /* ********************************************************************** * ComplexMatrix constructors * ********************************************************************** */ @@ -253,6 +264,7 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 57b18e3d3..601f7bb2c 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -8,6 +8,7 @@ #define MORPHO_INCLUDE_LINALG #include "newlinalg.h" +#include "format.h" /* ********************************************************************** * Matrix interface definitions @@ -62,7 +63,7 @@ objecttypedefn objectxmatrixdefn = { * ********************************************************************** */ /* ---------------------- - * XMatrix callbacks + * XMatrix interface * ---------------------- */ static void _printelfn(vm *v, double *el) { @@ -70,6 +71,10 @@ static void _printelfn(vm *v, double *el) { morpho_printf(v, "%g", (fabs(val)0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } +/* ---------------------- + * Interface definition + * ---------------------- */ + +matrixinterfacedefn xmatrixdefn = { + .printelfn = _printelfn, + .printeltobufffn = _printeltobufffn, + .getelfn = _getelfn, + .setelfn = _setelfn, + .solvefn = _solve, + .eigenfn = _eigen +}; + /* ---------------------- * Constructors * ---------------------- */ @@ -415,6 +433,24 @@ void xmatrix_print(vm *v, objectxmatrix *m) { } } +/** Prints a matrix to a buffer */ +bool xmatrix_printtobuffer(objectxmatrix *m, char *format, varray_char *out) { + matrixinterfacedefn *interface=xmatrix_getinterface(m); + double *elptr; + for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m + varray_charadd(out, "[ ", 2); + + for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k + xmatrix_getelementptr(m, i, j, &elptr); + if (!(*interface->printeltobufffn) (out, format, elptr)) return false; + varray_charadd(out, " ", 1); + } + varray_charadd(out, "]", 1); + if (inrows-1) varray_charadd(out, "\n", 1); + } + return true; +} + /* ---------------------- * Roll * ---------------------- */ @@ -460,18 +496,6 @@ linalgError_t xmatrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatri return LINALGERR_OK; } -/* ********************************************************************** - * Interface definition - * ********************************************************************** */ - -matrixinterfacedefn xmatrixdefn = { - .printelfn = _printelfn, - .getelfn = _getelfn, - .setelfn = _setelfn, - .solvefn = _solve, - .eigenfn = _eigen -}; - /* ********************************************************************** * XMatrix constructors * ********************************************************************** */ @@ -518,6 +542,23 @@ value XMatrix_print(vm *v, int nargs, value *args) { return MORPHO_NIL; } +/** Formatted conversion to a string */ +value XMatrix_format(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + varray_char str; + varray_charinit(&str); + + if (xmatrix_printtobuffer(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), + &str)) { + out = object_stringfromvarraychar(&str); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + + varray_charclear(&str); + return out; +} + /** Copies the contents of one matrix into another */ value XMatrix_assign(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -969,6 +1010,7 @@ value XMatrix_dimensions(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 01f757c64..b05446a09 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -58,6 +58,13 @@ typedef struct { /** Function that prints a single matrix element */ typedef void (*xmatrix_printelfn_t) (vm *, double *); +/** Function that prints a single matrix element to a text buffer + * @param[in] out - buffer to write to + * @param[in] format - format string + * @param[in] el - pointer to matrix element data + * @returns true on success */ +typedef bool (*xmatrix_printeltobufffn_t) (varray_char *out, char *format, double *el); + /** Function that materializes a value from a pointer to an element */ typedef value (*xmatrix_getelfn_t) (vm *, double *); @@ -80,6 +87,7 @@ typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, typedef struct { xmatrix_printelfn_t printelfn; + xmatrix_printeltobufffn_t printeltobufffn; xmatrix_getelfn_t getelfn; xmatrix_setelfn_t setelfn; xmatrix_solvefn_t solvefn; @@ -115,6 +123,7 @@ void xmatrix_initialize(void); #define IMPLEMENTATIONFN(fn) value fn (vm *v, int nargs, value *args) IMPLEMENTATIONFN(XMatrix_print); +IMPLEMENTATIONFN(XMatrix_format); IMPLEMENTATIONFN(XMatrix_assign); IMPLEMENTATIONFN(XMatrix_clone); diff --git a/test/methods/complexmatrix_format.morpho b/test/methods/complexmatrix_format.morpho new file mode 100644 index 000000000..d5f830dde --- /dev/null +++ b/test/methods/complexmatrix_format.morpho @@ -0,0 +1,13 @@ +// Format +import newlinalg +import constants + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=exp(im*Pi/4) +A[1,0]=exp(-im*Pi/4) +A[1,1]=-1.5*(1+1im) + +print A.format("%5.2f") +// expect: [ 1.00 + 1.00im 0.71 + 0.71im ] +// expect: [ 0.71 - 0.71im -1.50 - 1.50im ] diff --git a/test/methods/matrix_format.morpho b/test/methods/matrix_format.morpho new file mode 100644 index 000000000..591c6c76d --- /dev/null +++ b/test/methods/matrix_format.morpho @@ -0,0 +1,13 @@ +// Format +import newlinalg +import constants + +var A = XMatrix(2,2) +A[0,0]=1 +A[0,1]=Pi/2 +A[1,0]=Pi/2 +A[1,1]=-1.5 + +print A.format("%5.2f") +// expect: [ 1.00 1.57 ] +// expect: [ 1.57 -1.50 ] From 553f59fa3bdc0912ab22545ca6e5a1ca70521f69 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 16:33:39 -0500 Subject: [PATCH 139/473] Add test script --- .gitignore | 1 + src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 20 ++-- test/test.py | 212 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 225 insertions(+), 10 deletions(-) create mode 100755 test/test.py diff --git a/.gitignore b/.gitignore index e4e9d09ee..a11109e10 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ *.DS_Store build/* build-xcode/* +test/FailedTests.txt diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 1ba9659bb..279ec48a5 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -299,7 +299,7 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BU MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/xmatrix.c b/src/xmatrix.c index 601f7bb2c..e77a1ccdc 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -613,12 +613,14 @@ static void _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, val value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); + return MORPHO_NIL; } value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); + return MORPHO_NIL; } /* --------- @@ -1013,8 +1015,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSE MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), @@ -1035,19 +1037,19 @@ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xma MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "XMatrix ()", XMatrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "XMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/test/test.py b/test/test.py new file mode 100755 index 000000000..7fdaad273 --- /dev/null +++ b/test/test.py @@ -0,0 +1,212 @@ +#!/usr/bin/env python3 +# Simple automated testing +# T J Atherton Sept 2020 +# +# Each input file is supplied to a test command, the results +# are piped to a file and the output is compared with expectations +# extracted from the input file. +# Expectations are coded into comments in the input file as follows: + +# import necessary modules +import os, glob, sys +import regex as rx +from functools import reduce +import operator +import colored +from colored import stylize + +# define what command to use to invoke the interpreter +command = 'morpho6' + +# define the file extension to test +ext = 'morpho' + +# We reduce any errors to this value +err = '@error' + +# We reduce any stacktrace lines to this values +stk = '@stacktrace' + +# Removes control characters +def remove_control_characters(str): + return rx.sub(r'\x1b[^m]*m', '', str.rstrip()) + +# Simplify error reports +def simplify_errors(str): + # this monster regex extraxts NAME from error messages of the form error ... 'NAME' + return rx.sub('.*[E|e]rror[ :]*\'([A-z;a-z]*)\'.*', err+'[\\1]', str.rstrip()) + +# Simplify stacktrace +def simplify_stacktrace(str): + return rx.sub(r'.*at line.*', stk, str.rstrip()) + +# Find an expected value +def findvalue(str): + return rx.findall(r'// expect: ?(.*)', str) + +# Find an expected error +def finderror(str): + #return rx.findall(r'\/\/ expect ?(.*) error', str) + return rx.findall(r'.*[E|e]rror[ :].*?(.*)', str) + +# Find an expected error +def iserror(str): + #return rx.findall(r'\/\/ expect ?(.*) error', str) + test=rx.findall(r'@error.*', str) + return len(test)>0 + +# Find an expected error +def isin(str): + #return rx.findall(r'\/\/ expect ?(.*) error', str) + test=rx.findall(r'.*in .*', str) + return len(test)>0 + +# Remove elements from a list +def remove(list, remove_list): + test_list = list + for i in remove_list: + try: + test_list.remove(i) + except ValueError: + pass + return test_list + +# Find what is expected +def findexpected(str): + out = finderror(str) # is it an error? + if (out!=[]): + out = [simplify_errors(str)] # if so, simplify it + else: + out = findvalue(str) # or something else? + return out + +# Works out what we expect from the input file +def getexpect(filepath): + # Load the file + file_object = open(filepath, 'r', encoding="utf8") + lines = file_object.readlines() + file_object.close() + #Find any expected values over all lines + if (lines != []): + out = list(map(findexpected, lines)) + out = reduce(operator.concat, out) + else: + out = [] + return out + +# Gets the output generated +def getoutput(filepath): + # Load the file + file_object = open(filepath, 'r', encoding="utf8") + lines = file_object.readlines() + file_object.close() + # remove all control characters + lines = list(map(remove_control_characters, lines)) + # Convert errors to our universal error code + lines = list(map(simplify_errors, lines)) + # Identify stack trace lines + lines = list(map(simplify_stacktrace, lines)) + for i in range(len(lines)-1): + if (iserror(lines[i])): + if (isin(lines[i+1])): + lines[i+1]=stk + # and remove them + return list(filter(lambda x: x!=stk, lines)) + +# Test a file +def test(file,testLog,CI): + ret = 0 + if not CI: + print(file+":", end=" ") + + # Create a temporary file in the same directory + tmp = file + '.out' + + #Get the expected output + expected=getexpect(file) + + # Run the test + os.system(command + ' ' +file + ' > ' + tmp) + + # If we produced output + if os.path.exists(tmp): + # Get the output + out=getoutput(tmp) + + # Was it expected? + if(expected==out): + if not CI: + print(stylize("Passed",colored.fg("green"))) + ret = 1 + else: + if not CI: + print(stylize("Failed",colored.fg("red"))) + print(" Expected: ", expected) + print(" Output: ", out) + else: + print("\n::error file = {",file,"}::{",file," Failed}") + + + #also print to the test log + print(file+":", end=" ",file = testLog) + print("Failed", file = testLog) + + if len(out) == len(expected): + failedTests = list(i for i in range(len(out)) if expected[i] != out[i]) + print("Tests " + str(failedTests) + " did not match expected results.", file = testLog) + for testNum in failedTests: + print("Test "+str(testNum), file = testLog) + print(" Expected: ", expected[testNum], file = testLog) + print(" Output: ", out[testNum], file = testLog) + else: + print(" Expected: ", expected, file = testLog) + print(" Output: ", out, file = testLog) + + + print("\n",file = testLog) + + + # Delete the temporary file + os.remove(tmp) + + return ret + +print('--Begin testing---------------------') + +# open a test log +# write failures to log +success=0 # number of successful tests +total=0 # total number of tests + +# look for a command line arguement that says +# this is being run for continous integration +CI = False +# Also look for a command line argument that says this is being run with multiple threads +MT = False +for arg in sys.argv: + if arg == '-c': # if the argument is -c, then we are running in CI mode + CI = True + if arg == '-m': # if the argument is -m, then we are running in multi-thread mode + MT = True + +failedTestsFileName = "FailedTests.txt" +if MT: + failedTestsFileName = "FailedTestsMultiThreaded.txt" + command += " -w4" + print("Running tests with 4 threads") + +files=glob.glob('**/**.'+ext, recursive=True) +with open(failedTestsFileName,'w', encoding="utf8") as testLog: + + for f in files: + # print(f) + success+=test(f,testLog,CI) + total+=1 + +# if (not CI) and (not success == total): +# os.system("emacs FailedTests.txt &") + +print('--End testing-----------------------') +print(success, 'out of', total, 'tests passed.') +if CI and success Date: Wed, 24 Dec 2025 19:12:55 -0500 Subject: [PATCH 140/473] Fixes to test suite --- src/xcomplexmatrix.c | 6 +- src/xmatrix.c | 87 +++++++++++++++++- test/arithmetic/matrix_acc.morpho | 2 + test/complexmatrix.morpho | 89 ------------------- .../matrix_array_constructor.morpho | 16 ++++ .../matrix_tuple_constructor.morpho | 16 ++++ .../complexmatrix_non_square_error.morpho | 2 +- test/methods/complexmatrix_eigensystem.morpho | 10 ++- test/methods/complexmatrix_eigenvalues.morpho | 2 - test/methods/complexmatrix_reshape.morpho | 7 +- test/methods/matrix_eigensystem.morpho | 6 +- test/methods/matrix_eigenvalues.morpho | 2 +- test/methods/matrix_enumerate.morpho | 4 +- test/methods/matrix_reshape.morpho | 7 +- test/newlinalg.morpho | 24 ----- 15 files changed, 148 insertions(+), 132 deletions(-) delete mode 100644 test/complexmatrix.morpho create mode 100644 test/constructors/matrix_array_constructor.morpho create mode 100644 test/constructors/matrix_tuple_constructor.morpho delete mode 100644 test/newlinalg.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 279ec48a5..0662dd51a 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -282,10 +282,10 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMat MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index e77a1ccdc..6875ace8a 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -508,10 +508,86 @@ value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/** Clones a matrix */ +value xmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + return morpho_wrapandbind(v, (object *) xmatrix_clone(a)); +} + +static bool _getelement(value v, int i, value *out) { + if (MORPHO_ISLIST(v)) { + return list_getelement(MORPHO_GETLIST(v), i, out); + } else if (MORPHO_ISTUPLE(v)) { + return tuple_getelement(MORPHO_GETTUPLE(v), i, out); + } + return false; +} + +static bool _length(value v, int *len) { + if (MORPHO_ISLIST(v)) { + *len = list_length(MORPHO_GETLIST(v)); return true; + } else if (MORPHO_ISTUPLE(v)) { + *len = tuple_length(MORPHO_GETTUPLE(v)); return true; + } + return false; +} + +/** Constructs a matrix from a list of lists or tuples */ value xmatrix_constructor__list(vm *v, int nargs, value *args) { - return MORPHO_NIL; + value lst = MORPHO_GETARG(args, 0); + value iel, jel; + + int nrows=0, ncols=0, rlen; + _length(lst, &nrows); + for (int i=0; incols) { + ncols=rlen; + } + } + + objectxmatrix *new=xmatrix_new(nrows, ncols, true); + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + + for (int i=0; isetelfn(v, jel, new->elements+(j*ncols + i)*new->nvals); + } + } + } + + return morpho_wrapandbind(v, (object *) new); } +/** Constructs a matrix from a list of lists or tuples */ +value xmatrix_constructor__array(vm *v, int nargs, value *args) { + objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); + + if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + + int nrows = MORPHO_GETINTEGERVALUE(a->dimensions[0]); + int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); + + objectxmatrix *new=xmatrix_new(nrows, ncols, true); + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + + for (int i=0; isetelfn(v, el, new->elements+(j*ncols + i)*new->nvals); + } + } + } + + return morpho_wrapandbind(v, (object *) new); +} + + value xmatrix_constructor__err(vm *v, int nargs, value *args) { morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); return MORPHO_NIL; @@ -1030,11 +1106,11 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xma MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "XMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (Float)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (Float)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "XMatrix ()", XMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, MORPHO_FN_PUREFN), @@ -1065,7 +1141,10 @@ void xmatrix_initialize(void) { object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (XMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Tuple)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Array)", xmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", xmatrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/test/arithmetic/matrix_acc.morpho b/test/arithmetic/matrix_acc.morpho index e1b4f0358..e6430ebd9 100644 --- a/test/arithmetic/matrix_acc.morpho +++ b/test/arithmetic/matrix_acc.morpho @@ -10,3 +10,5 @@ A[1,1]=1 A.acc(2,A) print A +// expect: [ 3 3 ] +// expect: [ 3 3 ] \ No newline at end of file diff --git a/test/complexmatrix.morpho b/test/complexmatrix.morpho deleted file mode 100644 index 84f566fe8..000000000 --- a/test/complexmatrix.morpho +++ /dev/null @@ -1,89 +0,0 @@ - -import newlinalg -import constants - -var A = XMatrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -print A - -print A.norm() -print A.norm(1) -print A.norm(Inf) - -System.exit() - -var A = ComplexMatrix(2,2) -A[0,0] = 1+im -A[1,1] = 1-im -print A - -A.reshape(4,1) -print A - -System.exit() - -var b = ComplexMatrix(2,1) -b[0,0] = Complex(0.5,0) -b[1,0] = Complex(-0.5,0) -print b - -print b/A - -var A = XMatrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -var b = XMatrix(2,1) -b[0]=1 -b[1]=2 - -print A -print b - -print b/A - -print A - -var I = IdentityXMatrix(2) -print I - -var a = XMatrix(2,2) -a[0,0]=2 -a[1,1]=2 -print a -print a.dimensions() -print a.count() - -print a.inner(a) - -print 2*a - -var a = ComplexMatrix(2,2) -print a - -print a[0] -print a[0,0] - -a[0,0] = 1+im -a[1,1] = 1-im - -print a+a - -print a*3.0 - -print a*a - -Complex b = a[0,0] -print b - -var A = ComplexMatrix(2,1) -A[0,0] = 1+im -A[1,0] = 1-im - -print A.inner(A) \ No newline at end of file diff --git a/test/constructors/matrix_array_constructor.morpho b/test/constructors/matrix_array_constructor.morpho new file mode 100644 index 000000000..db2353936 --- /dev/null +++ b/test/constructors/matrix_array_constructor.morpho @@ -0,0 +1,16 @@ +// Create a Matrix from a Tuple of Tuples + +import newlinalg + +var a[2,2] +a[0,0]=1 +a[1,0]=2 +a[0,1]=3 +a[1,1]=4 + +var A = XMatrix(a) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] + diff --git a/test/constructors/matrix_tuple_constructor.morpho b/test/constructors/matrix_tuple_constructor.morpho new file mode 100644 index 000000000..48337f3f4 --- /dev/null +++ b/test/constructors/matrix_tuple_constructor.morpho @@ -0,0 +1,16 @@ +// Create a Matrix from a Tuple of Tuples + +import newlinalg + +var A = XMatrix(((1,2),(3,4))) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] + +// Mix Tuples and Lists +var B = XMatrix(([1,2],[3,4])) + +print B +// expect: [ 1 2 ] +// expect: [ 3 4 ] diff --git a/test/errors/complexmatrix_non_square_error.morpho b/test/errors/complexmatrix_non_square_error.morpho index 16fb77df2..37fe8049d 100644 --- a/test/errors/complexmatrix_non_square_error.morpho +++ b/test/errors/complexmatrix_non_square_error.morpho @@ -1,4 +1,4 @@ -// Non-square matrix error (for operations requiring square matrices) +// Non-square matrix err. (for operations requiring square matrices) import newlinalg var A = ComplexMatrix(2,3) diff --git a/test/methods/complexmatrix_eigensystem.morpho b/test/methods/complexmatrix_eigensystem.morpho index 1cd107c45..ef8d57428 100644 --- a/test/methods/complexmatrix_eigensystem.morpho +++ b/test/methods/complexmatrix_eigensystem.morpho @@ -14,4 +14,12 @@ print es print es[0] // expect: (0 + 1im, 0 - 1im) -print es[1] +// Compare to analytical eigenvectors +var v = ComplexMatrix(2,2) +v[0,0]=sqrt(2)/2 +v[1,0]=sqrt(2)/2 +v[0,1]=sqrt(2)/2 +v[1,1]=-sqrt(2)/2 + +print abs((es[1]-v).sum()) < 1e-15 +// expect: true diff --git a/test/methods/complexmatrix_eigenvalues.morpho b/test/methods/complexmatrix_eigenvalues.morpho index d22445999..9a9adb813 100644 --- a/test/methods/complexmatrix_eigenvalues.morpho +++ b/test/methods/complexmatrix_eigenvalues.morpho @@ -7,7 +7,5 @@ A[0,1]=im A[1,0]=im A[1,1]=0+0im -print A - print A.eigenvalues() // expect: (0 + 1im, 0 - 1im) diff --git a/test/methods/complexmatrix_reshape.morpho b/test/methods/complexmatrix_reshape.morpho index e17789d9a..5f60e09a2 100644 --- a/test/methods/complexmatrix_reshape.morpho +++ b/test/methods/complexmatrix_reshape.morpho @@ -3,9 +3,12 @@ import newlinalg var A = ComplexMatrix(2,2) A[0,0]=1+1im -A[0,1]=2+2im -A[1,0]=3+3im +A[1,0]=2+2im +A[0,1]=3+3im A[1,1]=4+4im +print A +// expect: [ 1 + 1im 3 + 3im ] +// expect: [ 2 + 2im 4 + 4im ] A.reshape(4,1) print A diff --git a/test/methods/matrix_eigensystem.morpho b/test/methods/matrix_eigensystem.morpho index ea7dfd988..1651052c7 100644 --- a/test/methods/matrix_eigensystem.morpho +++ b/test/methods/matrix_eigensystem.morpho @@ -10,7 +10,11 @@ A[1,1]=0 var es=A.eigensystem() print es +// expect: ((1, -1), ) print es[0] +// expect: (1, -1) -print es[1] +print es[1].format("%.2g") +// expect: [ 0.71 -0.71 ] +// expect: [ 0.71 0.71 ] diff --git a/test/methods/matrix_eigenvalues.morpho b/test/methods/matrix_eigenvalues.morpho index 430f25baf..00141abce 100644 --- a/test/methods/matrix_eigenvalues.morpho +++ b/test/methods/matrix_eigenvalues.morpho @@ -8,4 +8,4 @@ A[1,0]=1 A[1,1]=0 print A.eigenvalues() -// expect: (-1, 1) +// expect: (1, -1) diff --git a/test/methods/matrix_enumerate.morpho b/test/methods/matrix_enumerate.morpho index 8d2eabe2a..ac2478cf8 100644 --- a/test/methods/matrix_enumerate.morpho +++ b/test/methods/matrix_enumerate.morpho @@ -4,8 +4,8 @@ import newlinalg var A = XMatrix(2,2) A[0,0] = 1 -A[0,1] = 2 -A[1,0] = 3 +A[1,0] = 2 +A[0,1] = 3 A[1,1] = 4 for (x in A) print x diff --git a/test/methods/matrix_reshape.morpho b/test/methods/matrix_reshape.morpho index d6722d243..553550855 100644 --- a/test/methods/matrix_reshape.morpho +++ b/test/methods/matrix_reshape.morpho @@ -3,9 +3,12 @@ import newlinalg var A = XMatrix(2,2) A[0,0]=1 -A[0,1]=2 -A[1,0]=3 +A[1,0]=2 +A[0,1]=3 A[1,1]=4 +print A +// expect: [ 1 3 ] +// expect: [ 2 4 ] A.reshape(4,1) print A diff --git a/test/newlinalg.morpho b/test/newlinalg.morpho deleted file mode 100644 index 3e9176e22..000000000 --- a/test/newlinalg.morpho +++ /dev/null @@ -1,24 +0,0 @@ - -import newlinalg - -var a = XMatrix(2,1) -a[0]=1 -print a - -var b = XMatrix(2,2) -b[0,0]=1 -b[0,1]=2 -b[1,0]=3 -b[1,1]=4 - -print b -print b[0] -print b[0,0] - -print b+b - -print b-b - -var c = b.clone() - -print b+c From 9989535ba7b26a95968a14ee8454f7d86a56380c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 19:31:50 -0500 Subject: [PATCH 141/473] Correct remaining test suite items --- src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 19 +++++-------------- .../complexmatrix_div_matrix.morpho | 13 ++++++------- .../complexmatrix_mul_matrix.morpho | 12 ++++++------ .../matrix_array_constructor.morpho | 4 ++-- test/index/complexmatrix_getindex.morpho | 8 ++++---- test/index/matrix_getindex.morpho | 8 ++++---- test/methods/complexmatrix_inner.morpho | 11 +++++------ 8 files changed, 33 insertions(+), 44 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 0662dd51a..335900290 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -267,7 +267,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSE MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_index__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 6875ace8a..2e4443b09 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -655,7 +655,10 @@ value XMatrix_clone(vm *v, int nargs, value *args) { * index() * --------- */ -static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { +value XMatrix_index__int_int(vm *v, int nargs, value *args) { + objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); value out=MORPHO_NIL; double *elptr=NULL; @@ -665,17 +668,6 @@ static value _getindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j) { return out; } -value XMatrix_index__int(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0); -} - -value XMatrix_index__int_int(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _getindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j); -} - /* --------- * setindex() * --------- */ @@ -1085,13 +1077,12 @@ value XMatrix_dimensions(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } - MORPHO_BEGINCLASS(XMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_index__int, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_enumerate, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), diff --git a/test/arithmetic/complexmatrix_div_matrix.morpho b/test/arithmetic/complexmatrix_div_matrix.morpho index a41a8967b..0ca098a5a 100644 --- a/test/arithmetic/complexmatrix_div_matrix.morpho +++ b/test/arithmetic/complexmatrix_div_matrix.morpho @@ -2,16 +2,15 @@ import newlinalg var A = ComplexMatrix(2,2) -A[0,0]=1+0im -A[0,1]=0+1im -A[1,0]=1+0im +A[0,0]=1 +A[0,1]=1-im +A[1,0]=1 A[1,1]=1+1im var b = ComplexMatrix(2,1) b[0,0]=1+1im -b[1,0]=2+0im +b[1,0]=2 print b / A -// expect: [ 1 + 0im ] -// expect: [ 1 + 1im ] - +// expect: [ 2 + 1im ] +// expect: [ -0.5 - 0.5im ] diff --git a/test/arithmetic/complexmatrix_mul_matrix.morpho b/test/arithmetic/complexmatrix_mul_matrix.morpho index 15fb9b0dd..00f78a9ff 100644 --- a/test/arithmetic/complexmatrix_mul_matrix.morpho +++ b/test/arithmetic/complexmatrix_mul_matrix.morpho @@ -8,12 +8,12 @@ A[1,0]=3+3im A[1,1]=4+4im var B = ComplexMatrix(2,2) -B[0,0]=1+0im -B[0,1]=0+1im -B[1,0]=1+0im -B[1,1]=0+1im +B[0,0]=1 +B[0,1]=1im +B[1,0]=-1im +B[1,1]=1 print A * B -// expect: [ 3 + 1im 2 + 3im ] -// expect: [ 7 + 3im 4 + 7im ] +// expect: [ 3 - 1im 1 + 3im ] +// expect: [ 7 - 1im 1 + 7im ] diff --git a/test/constructors/matrix_array_constructor.morpho b/test/constructors/matrix_array_constructor.morpho index db2353936..b73ca7f1b 100644 --- a/test/constructors/matrix_array_constructor.morpho +++ b/test/constructors/matrix_array_constructor.morpho @@ -4,8 +4,8 @@ import newlinalg var a[2,2] a[0,0]=1 -a[1,0]=2 -a[0,1]=3 +a[1,0]=3 +a[0,1]=2 a[1,1]=4 var A = XMatrix(a) diff --git a/test/index/complexmatrix_getindex.morpho b/test/index/complexmatrix_getindex.morpho index e833722f7..344d5e6d3 100644 --- a/test/index/complexmatrix_getindex.morpho +++ b/test/index/complexmatrix_getindex.morpho @@ -4,14 +4,14 @@ import newlinalg var A = ComplexMatrix(2,2) A[0,0] = 1+1im -A[0,1] = 2+2im -A[1,0] = 3+3im +A[1,0] = 2+2im +A[0,1] = 3+3im A[1,1] = 4+4im // Array-like access print A[0,0] // expect: 1 + 1im -print A[0,1] // expect: 2 + 2im -print A[1,0] // expect: 3 + 3im +print A[1,0] // expect: 2 + 2im +print A[0,1] // expect: 3 + 3im print A[1,1] // expect: 4 + 4im // Vector-like access diff --git a/test/index/matrix_getindex.morpho b/test/index/matrix_getindex.morpho index 7d8c16b8f..90af1fd85 100644 --- a/test/index/matrix_getindex.morpho +++ b/test/index/matrix_getindex.morpho @@ -4,14 +4,14 @@ import newlinalg var A = XMatrix(2,2) A[0,0] = 1 -A[0,1] = 2 -A[1,0] = 3 +A[1,0] = 2 +A[0,1] = 3 A[1,1] = 4 // Array-like access print A[0,0] // expect: 1 -print A[0,1] // expect: 2 -print A[1,0] // expect: 3 +print A[1,0] // expect: 2 +print A[0,1] // expect: 3 print A[1,1] // expect: 4 // Vector-like access diff --git a/test/methods/complexmatrix_inner.morpho b/test/methods/complexmatrix_inner.morpho index f747e5a46..a9d6a7fe1 100644 --- a/test/methods/complexmatrix_inner.morpho +++ b/test/methods/complexmatrix_inner.morpho @@ -8,11 +8,10 @@ A[1,0]=3+3im A[1,1]=4+4im var B = ComplexMatrix(2,2) -B[0,0]=1+0im -B[0,1]=0+1im -B[1,0]=1+0im -B[1,1]=0+1im +B[0,0]=1 +B[0,1]=1im +B[1,0]=-1im +B[1,1]=1 print A.inner(B) -// expect: 10 - 10im - +// expect: 4 - 6im From cd2d932e9261cceb0e6ab91b5c0d2aa5b07831f7 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 24 Dec 2025 19:33:42 -0500 Subject: [PATCH 142/473] Remove extraneous TODO --- src/xcomplexmatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 335900290..0856c1e42 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -32,7 +32,7 @@ static void _printelfn(vm *v, double *el) { complex_print(v, &cmplx); } -static bool _printeltobufffn(varray_char *out, char *format, double *el) { // TODO: format should support complex numbers +static bool _printeltobufffn(varray_char *out, char *format, double *el) { if (!format_printtobuffer(MORPHO_FLOAT(el[0]), format, out)) return false; varray_charadd(out, " ", 1); varray_charadd(out, (el[1]<0 ? "-" : "+"), 1); From c8ddcbe898d08940a9be1ab5c6241fa7b1d6dffa Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 25 Dec 2025 09:50:12 -0500 Subject: [PATCH 143/473] ComplexMatrix constructors --- src/xcomplexmatrix.c | 19 +++ src/xmatrix.c | 132 ++++++++++-------- src/xmatrix.h | 4 + .../complexmatrix_array_constructor.morpho | 15 ++ .../complexmatrix_list_constructor.morpho | 9 ++ .../complexmatrix_tuple_constructor.morpho | 9 ++ .../matrix_array_constructor.morpho | 2 +- 7 files changed, 127 insertions(+), 63 deletions(-) create mode 100644 test/constructors/complexmatrix_array_constructor.morpho create mode 100644 test/constructors/complexmatrix_list_constructor.morpho create mode 100644 test/constructors/complexmatrix_tuple_constructor.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 0856c1e42..6763e7527 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -198,6 +198,21 @@ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/** Constructs a complexmatrix from a list of lists or tuples */ +value complexmatrix_constructor__list(vm *v, int nargs, value *args) { + objectxmatrix *new = xmatrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); + return morpho_wrapandbind(v, (object *) new); +} + +/** Constructs a matrix from an array */ +value complexmatrix_constructor__array(vm *v, int nargs, value *args) { + objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); + if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + + objectxmatrix *new = xmatrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); + return morpho_wrapandbind(v, (object *) new); +} + /* ********************************************************************** * ComplexMatrix veneer class * ********************************************************************** */ @@ -315,4 +330,8 @@ void complexmatrix_initialize(void) { object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); } diff --git a/src/xmatrix.c b/src/xmatrix.c index 2e4443b09..f73cf9f39 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -159,6 +159,73 @@ objectxmatrix *xmatrix_clone(objectxmatrix *in) { return new; } +static bool _getelement(value v, int i, value *out) { + if (MORPHO_ISLIST(v)) { + return list_getelement(MORPHO_GETLIST(v), i, out); + } else if (MORPHO_ISTUPLE(v)) { + return tuple_getelement(MORPHO_GETTUPLE(v), i, out); + } + return false; +} + +static bool _length(value v, int *len) { + if (MORPHO_ISLIST(v)) { + *len = list_length(MORPHO_GETLIST(v)); return true; + } else if (MORPHO_ISTUPLE(v)) { + *len = tuple_length(MORPHO_GETTUPLE(v)); return true; + } + return false; +} + +/** Create a matrix from a list of lists (or tuples) */ +objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals) { + value iel, jel; + + int nrows=0, ncols=0, rlen; + _length(lst, &nrows); + for (int i=0; incols) { + ncols=rlen; + } + } + + objectxmatrix *new=xmatrix_newwithtype(type, nrows, ncols, nvals, true); + if (!new) return NULL; + + for (int i=0; isetelfn(v, jel, new->elements+(j*ncols + i)*new->nvals); + } + } + } + + return new; +} + +/** Construct a matrix from an array */ +objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals) { + int nrows = MORPHO_GETINTEGERVALUE(a->dimensions[0]); + int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); + + objectxmatrix *new=xmatrix_newwithtype(type, nrows, ncols, nvals, true); + if (!new) return NULL; + + for (int i=0; isetelfn(v, el, new->elements+(j*ncols + i)*new->nvals); + } + } + } + return new; +} + /* ---------------------- * Accessing elements * ---------------------- */ @@ -514,80 +581,21 @@ value xmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) xmatrix_clone(a)); } -static bool _getelement(value v, int i, value *out) { - if (MORPHO_ISLIST(v)) { - return list_getelement(MORPHO_GETLIST(v), i, out); - } else if (MORPHO_ISTUPLE(v)) { - return tuple_getelement(MORPHO_GETTUPLE(v), i, out); - } - return false; -} - -static bool _length(value v, int *len) { - if (MORPHO_ISLIST(v)) { - *len = list_length(MORPHO_GETLIST(v)); return true; - } else if (MORPHO_ISTUPLE(v)) { - *len = tuple_length(MORPHO_GETTUPLE(v)); return true; - } - return false; -} - /** Constructs a matrix from a list of lists or tuples */ value xmatrix_constructor__list(vm *v, int nargs, value *args) { - value lst = MORPHO_GETARG(args, 0); - value iel, jel; - - int nrows=0, ncols=0, rlen; - _length(lst, &nrows); - for (int i=0; incols) { - ncols=rlen; - } - } - - objectxmatrix *new=xmatrix_new(nrows, ncols, true); - if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - - for (int i=0; isetelfn(v, jel, new->elements+(j*ncols + i)*new->nvals); - } - } - } - + objectxmatrix *new = xmatrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_XMATRIX, 1); return morpho_wrapandbind(v, (object *) new); } -/** Constructs a matrix from a list of lists or tuples */ +/** Constructs a matrix from an array */ value xmatrix_constructor__array(vm *v, int nargs, value *args) { objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); - if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - int nrows = MORPHO_GETINTEGERVALUE(a->dimensions[0]); - int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); - - objectxmatrix *new=xmatrix_new(nrows, ncols, true); - if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - - for (int i=0; isetelfn(v, el, new->elements+(j*ncols + i)*new->nvals); - } - } - } - + objectxmatrix *new = xmatrix_arrayconstructor(v, a, OBJECT_XMATRIX, 1); return morpho_wrapandbind(v, (object *) new); } - value xmatrix_constructor__err(vm *v, int nargs, value *args) { morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); return MORPHO_NIL; diff --git a/src/xmatrix.h b/src/xmatrix.h index b05446a09..207591e99 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -122,6 +122,8 @@ void xmatrix_initialize(void); #define IMPLEMENTATIONFN(fn) value fn (vm *v, int nargs, value *args) +IMPLEMENTATIONFN(xmatrix_constructor__xmatrix); + IMPLEMENTATIONFN(XMatrix_print); IMPLEMENTATIONFN(XMatrix_format); IMPLEMENTATIONFN(XMatrix_assign); @@ -165,6 +167,8 @@ IMPLEMENTATIONFN(XMatrix_dimensions); objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); objectxmatrix *xmatrix_clone(objectxmatrix *in); +objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals); +objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals); linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); diff --git a/test/constructors/complexmatrix_array_constructor.morpho b/test/constructors/complexmatrix_array_constructor.morpho new file mode 100644 index 000000000..68f67b944 --- /dev/null +++ b/test/constructors/complexmatrix_array_constructor.morpho @@ -0,0 +1,15 @@ +// Create a Matrix from an Array + +import newlinalg + +var a[2,2] +a[0,0]=1+im +a[1,0]=2-2im +a[0,1]=3+3im +a[1,1]=4+4im + +var A = ComplexMatrix(a) + +print A +// expect: [ 1 + 1im 3 + 3im ] +// expect: [ 2 - 2im 4 + 4im ] diff --git a/test/constructors/complexmatrix_list_constructor.morpho b/test/constructors/complexmatrix_list_constructor.morpho new file mode 100644 index 000000000..8f39b5f04 --- /dev/null +++ b/test/constructors/complexmatrix_list_constructor.morpho @@ -0,0 +1,9 @@ +// Create a ComplexMatrix from a List of Lists + +import newlinalg + +var A = ComplexMatrix([[1+im,2-2im],[3+3im,4-4im]]) + +print A +// expect: [ 1 + 1im 2 - 2im ] +// expect: [ 3 + 3im 4 - 4im ] \ No newline at end of file diff --git a/test/constructors/complexmatrix_tuple_constructor.morpho b/test/constructors/complexmatrix_tuple_constructor.morpho new file mode 100644 index 000000000..fb895cd8c --- /dev/null +++ b/test/constructors/complexmatrix_tuple_constructor.morpho @@ -0,0 +1,9 @@ +// Create a ComplexMatrix from a List of Lists + +import newlinalg + +var A = ComplexMatrix(((1+im,2-2im),(3+3im,4-4im))) + +print A +// expect: [ 1 + 1im 2 - 2im ] +// expect: [ 3 + 3im 4 - 4im ] \ No newline at end of file diff --git a/test/constructors/matrix_array_constructor.morpho b/test/constructors/matrix_array_constructor.morpho index b73ca7f1b..7bc168e4b 100644 --- a/test/constructors/matrix_array_constructor.morpho +++ b/test/constructors/matrix_array_constructor.morpho @@ -1,4 +1,4 @@ -// Create a Matrix from a Tuple of Tuples +// Create a Matrix from an Array import newlinalg From 33676a43974c0c5488c3b8d12815714ca5dbd242 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 25 Dec 2025 11:59:41 -0500 Subject: [PATCH 144/473] Correct norms --- src/newlinalg.c | 1 + src/newlinalg.h | 3 + src/xcomplexmatrix.c | 16 ++++++ src/xmatrix.c | 79 ++++++++++++-------------- src/xmatrix.h | 16 ++++++ test/methods/complexmatrix_norm.morpho | 21 +++++++ test/methods/matrix_norm.morpho | 23 +++++--- 7 files changed, 110 insertions(+), 49 deletions(-) create mode 100644 test/methods/complexmatrix_norm.morpho diff --git a/src/newlinalg.c b/src/newlinalg.c index c8b072d11..4dbdfabc6 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -44,6 +44,7 @@ void newlinalg_initialize(void) { morpho_defineerror(LINALG_NOTSUPPORTED, ERROR_HALT, LINALG_NOTSUPPORTED_MSG); morpho_defineerror(LINALG_INVLDARGS, ERROR_HALT, LINALG_INVLDARGS_MSG); morpho_defineerror(LINALG_NNNMRCL_ARG, ERROR_HALT, LINALG_NNNMRCL_ARG_MSG); + morpho_defineerror(LINALG_NORMARGS, ERROR_HALT, LINALG_NORMARGS_MSG); } void newlinalg_finalize(void) { diff --git a/src/newlinalg.h b/src/newlinalg.h index 670f9bf11..6156599ec 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -59,6 +59,9 @@ typedef enum { #define LINALG_NNNMRCL_ARG "LnAlgMtrxNnNmrclArg" #define LINALG_NNNMRCL_ARG_MSG "Matrix method requires numerical arguments." +#define LINALG_NORMARGS "LnAlgMtrxNrmArgs" +#define LINALG_NORMARGS_MSG "Method 'norm' requires a supported argument: 1 or inf." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 6763e7527..5378e87aa 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -55,6 +55,19 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { return LINALGERR_OK; } +/** Evaluate norms */ +static double _normfn(objectxmatrix *a, xmatrix_norm_t nrm) { + char cnrm = xmatrix_normtolapack(nrm); + int nrows=a->nrows, ncols=a->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + return LAPACKE_zlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); +#else + double work[a->nrows]; + return zlange_(&cnrm, &nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, work); +#endif +} + /** Low level linear solve */ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -92,6 +105,7 @@ matrixinterfacedefn complexmatrixdefn = { .printeltobufffn = _printeltobufffn, .getelfn = _getelfn, .setelfn = _setelfn, + .normfn = _normfn, .solvefn = _solve, .eigenfn = _eigen }; @@ -304,6 +318,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", XMatrix_div__flo MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", XMatrix_sum, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index f73cf9f39..a6d3d09ff 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -84,6 +84,30 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { return LINALGERR_OK; } +/** Convert xmatrix_norm_t to a character for use with lapack routines */ +char xmatrix_normtolapack(xmatrix_norm_t norm) { + switch (norm) { + case XMATRIX_NORM_MAX: return 'M'; + case XMATRIX_NORM_L1: return '1'; + case XMATRIX_NORM_INF: return 'I'; + case XMATRIX_NORM_FROBENIUS: return 'F'; + } + return '\0'; +} + +/** Evaluate norms */ +static double _normfn(objectxmatrix *a, xmatrix_norm_t nrm) { + char cnrm = xmatrix_normtolapack(nrm); + int nrows=a->nrows, ncols=a->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + return LAPACKE_dlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); +#else + double work[a->nrows]; + return dlange_(&cnrm, &nrows, &ncols, a->elements, &nrows, work); +#endif +} + /** Low level linear solve */ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; @@ -121,6 +145,7 @@ matrixinterfacedefn xmatrixdefn = { .printeltobufffn = _printeltobufffn, .getelfn = _getelfn, .setelfn = _setelfn, + .normfn = _normfn, .solvefn = _solve, .eigenfn = _eigen }; @@ -345,35 +370,9 @@ linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y) { * Unary operations * ---------------------- */ -// TODO: Fix with correct norms! - -/** Computes the Frobenius norm of a matrix */ -double xmatrix_norm(objectxmatrix *a) { - return cblas_dnrm2((__LAPACK_int) a->nels, a->elements, 1); -} - -/** Computes the L1 norm of a matrix */ -double xmatrix_l1norm(objectxmatrix *a) { - return cblas_dasum((__LAPACK_int) a->nels, a->elements, 1); -} - -/** Computes the Ln norm of a matrix */ -double xmatrix_lnnorm(objectxmatrix *a, double n) { - double sum=0.0, c=0.0, y,t; - - for (MatrixCount_t i=0; inels; i++) { - y=pow(a->elements[i],n)-c; // Kahan summation - t=sum+y; - c=(t-sum)-y; - sum=t; - } - return pow(sum,1.0/n); -} - -/** Computes the infinity norm of a matrix */ -double xmatrix_linfnorm(objectxmatrix *a) { - int imax=cblas_idamax((__LAPACK_int) a->nels, a->elements, 1); - return a->elements[imax]; +/** Computes various matrix norms */ +double xmatrix_norm(objectxmatrix *a, xmatrix_norm_t norm) { + return xmatrix_getinterface(a)->normfn(a, norm); } /** Computes the sum of all elements in a matrix */ @@ -853,27 +852,23 @@ value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args) { /** Matrix norm */ value XMatrix_norm__x(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - value out = MORPHO_NIL; double n; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { if (fabs(n-1.0) Date: Thu, 25 Dec 2025 13:04:22 -0500 Subject: [PATCH 145/473] Create complexmatrix_roll_negative.morpho --- test/methods/complexmatrix_roll_negative.morpho | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/methods/complexmatrix_roll_negative.morpho diff --git a/test/methods/complexmatrix_roll_negative.morpho b/test/methods/complexmatrix_roll_negative.morpho new file mode 100644 index 000000000..3310c4eb9 --- /dev/null +++ b/test/methods/complexmatrix_roll_negative.morpho @@ -0,0 +1,14 @@ +// Negative roll values for ComplexMatrix + +import newlinalg + +var A = ComplexMatrix(3,1) +A[0,0]=1+1im +A[1,0]=2+2im +A[2,0]=3+3im + +print A.roll(-1) +// expect: [ 2 + 2im ] +// expect: [ 3 + 3im ] +// expect: [ 1 + 1im ] + From b6e39e1e00a1f3c62ed09c0edfda3738b8e94168 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 25 Dec 2025 15:15:40 -0500 Subject: [PATCH 146/473] Fix matrix-matrix subtraction --- src/xmatrix.c | 8 ++++---- test/arithmetic/matrix_add_matrix.morpho | 12 ++++++++++++ test/arithmetic/matrix_mul_matrix.morpho | 17 +++++++++++++++++ test/arithmetic/matrix_sub_matrix.morpho | 14 ++++++++++++++ 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 test/arithmetic/matrix_add_matrix.morpho create mode 100644 test/arithmetic/matrix_sub_matrix.morpho diff --git a/src/xmatrix.c b/src/xmatrix.c index a6d3d09ff..31a319fa2 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -729,14 +729,14 @@ value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { /** Add a vector */ static value _axpy(vm *v, int nargs, value *args, double alpha) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Receiver is left hand operand + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // Argument is right hand operand objectxmatrix *new = NULL; value out=MORPHO_NIL; if (a->ncols==b->ncols && a->nrows==b->nrows) { - new=xmatrix_clone(b); - if (new) xmatrix_axpy(alpha, a, new); // TODO: Error check + new=xmatrix_clone(a); + if (new) xmatrix_axpy(alpha, b, new); // TODO: Error check out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); diff --git a/test/arithmetic/matrix_add_matrix.morpho b/test/arithmetic/matrix_add_matrix.morpho new file mode 100644 index 000000000..076f6451f --- /dev/null +++ b/test/arithmetic/matrix_add_matrix.morpho @@ -0,0 +1,12 @@ +// Matrix arithmetic + +import newlinalg + +var a = XMatrix([[1, 2], [3, 4]]) +var b = XMatrix([[0, 1], [1, 0]]) + +print "A+B:" +print a+b +// expect: A+B: +// expect: [ 1 3 ] +// expect: [ 4 4 ] diff --git a/test/arithmetic/matrix_mul_matrix.morpho b/test/arithmetic/matrix_mul_matrix.morpho index 01ec46ed9..ca0811e18 100644 --- a/test/arithmetic/matrix_mul_matrix.morpho +++ b/test/arithmetic/matrix_mul_matrix.morpho @@ -17,3 +17,20 @@ print A * B // expect: [ 1 2 ] // expect: [ 3 4 ] +var a = XMatrix([[1, 2], [3, 4]]) +var b = XMatrix([[0, 1], [1, 0]]) + +print "A*B:" +print a*b +// expect: A*B: +// expect: [ 2 1 ] +// expect: [ 4 3 ] + +var c = Matrix([[1,2,3], [4,5,6]]) +var d = Matrix([[1,2], [3,4], [5,6]]) + +print "C*D:" +print c*d +// expect: C*D: +// expect: [ 22 28 ] +// expect: [ 49 64 ] \ No newline at end of file diff --git a/test/arithmetic/matrix_sub_matrix.morpho b/test/arithmetic/matrix_sub_matrix.morpho new file mode 100644 index 000000000..800d14400 --- /dev/null +++ b/test/arithmetic/matrix_sub_matrix.morpho @@ -0,0 +1,14 @@ +// Matrix arithmetic + +import newlinalg + +var a = XMatrix([[1, 2], [3, 4]]) +var b = XMatrix([[0, 1], [1, 0]]) + + +print "A-B:" +print a-b +// expect: A-B: +// expect: [ 1 1 ] +// expect: [ 2 4 ] + From 761c661fcd7a018b2237f1ffda415faa5877e492 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 25 Dec 2025 15:53:28 -0500 Subject: [PATCH 147/473] ComplexMatrix constructor from Matrix --- src/xcomplexmatrix.c | 17 +++++++++++++++++ src/xmatrix.c | 2 +- src/xmatrix.h | 8 ++++++++ test/arithmetic/matrix_negate.morpho | 9 +++++++++ test/assign/matrix_assign.morpho | 6 +++++- .../complexmatrix_matrix_constructor.morpho | 11 +++++++++++ test/methods/matrix_dimensions.morpho | 5 +++-- 7 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 test/arithmetic/matrix_negate.morpho create mode 100644 test/constructors/complexmatrix_matrix_constructor.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 5378e87aa..1811b3a3f 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -142,6 +142,14 @@ linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t return LINALGERR_OK; } +/** Copies a real matrix x into a complex matrix y */ +linalgError_t complexmatrix_promote(objectxmatrix *x, objectcomplexmatrix *y) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 2); + return LINALGERR_OK; +} + /* ---------------------- * Complex arithmetic * ---------------------- */ @@ -212,6 +220,14 @@ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +value complexmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + + objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); + if (new) complexmatrix_promote(a, new); + return morpho_wrapandbind(v, (object *) new); +} + /** Constructs a complexmatrix from a list of lists or tuples */ value complexmatrix_constructor__list(vm *v, int nargs, value *args) { objectxmatrix *new = xmatrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); @@ -347,6 +363,7 @@ void complexmatrix_initialize(void) { morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complexmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/xmatrix.c b/src/xmatrix.c index 31a319fa2..a7d325ed1 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -312,7 +312,7 @@ linalgError_t xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { return LINALGERR_OK; } -/** Copies a matrix y <- a */ +/** Copies a matrix y <- x */ linalgError_t xmatrix_copy(objectxmatrix *x, objectxmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; diff --git a/src/xmatrix.h b/src/xmatrix.h index b4f1f1876..40914a0aa 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -186,6 +186,14 @@ objectxmatrix *xmatrix_clone(objectxmatrix *in); objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals); objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals); +linalgError_t xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y); +linalgError_t xmatrix_copy(objectxmatrix *x, objectxmatrix *y); +void xmatrix_scale(objectxmatrix *x, double scale); +linalgError_t xmatrix_identity(objectxmatrix *x); +linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z); +linalgError_t xmatrix_addscalar(objectxmatrix *x, double alpha, double beta); +linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y); + linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); diff --git a/test/arithmetic/matrix_negate.morpho b/test/arithmetic/matrix_negate.morpho new file mode 100644 index 000000000..c5f01d065 --- /dev/null +++ b/test/arithmetic/matrix_negate.morpho @@ -0,0 +1,9 @@ +// Negate + +import newlinalg + +var a = XMatrix([[1,2], [3,4]]) + +print -a +// expect: [ -1 -2 ] +// expect: [ -3 -4 ] diff --git a/test/assign/matrix_assign.morpho b/test/assign/matrix_assign.morpho index 7d2e7c8f1..70e19dad0 100644 --- a/test/assign/matrix_assign.morpho +++ b/test/assign/matrix_assign.morpho @@ -13,4 +13,8 @@ B.assign(A) print B // expect: [ 1 2 ] -// expect: [ 3 4 ] \ No newline at end of file +// expect: [ 3 4 ] + +var C = Matrix(1,2) +B.assign(C) +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/constructors/complexmatrix_matrix_constructor.morpho b/test/constructors/complexmatrix_matrix_constructor.morpho new file mode 100644 index 000000000..fdd36cd97 --- /dev/null +++ b/test/constructors/complexmatrix_matrix_constructor.morpho @@ -0,0 +1,11 @@ +// Create a Matrix from an Array + +import newlinalg + +var A = XMatrix(((1,2), (3,4))) + +var B = ComplexMatrix(A) + +print B +// expect: [ 1 + 0im 2 + 0im ] +// expect: [ 3 + 0im 4 + 0im ] diff --git a/test/methods/matrix_dimensions.morpho b/test/methods/matrix_dimensions.morpho index ba8eabc1f..4c72b37f1 100644 --- a/test/methods/matrix_dimensions.morpho +++ b/test/methods/matrix_dimensions.morpho @@ -2,8 +2,9 @@ import newlinalg var A = XMatrix(2,3) -A[0,0]=1 - print A.dimensions() // expect: (2, 3) +var a = XMatrix([[0.8, -0.4], [0.4, 0.8]]) +print a.dimensions() +// expect: (2, 2) From 143a7c714f3ba8c7298807ddf1da2719057bc5a6 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 25 Dec 2025 16:22:42 -0500 Subject: [PATCH 148/473] Vector constructors --- src/xcomplexmatrix.c | 8 ++++++++ src/xmatrix.c | 8 ++++++++ .../constructors/complexmatrix_vector_constructor.morpho | 9 +++++++++ test/constructors/matrix_vector_constructor.morpho | 9 +++++++++ 4 files changed, 34 insertions(+) create mode 100644 test/constructors/complexmatrix_vector_constructor.morpho create mode 100644 test/constructors/matrix_vector_constructor.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 1811b3a3f..35863642f 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -220,6 +220,13 @@ value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +value complexmatrix_constructor__int(vm *v, int nargs, value *args) { + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + objectcomplexmatrix *new=complexmatrix_new(nrows, 1, true); + return morpho_wrapandbind(v, (object *) new); +} + value complexmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -362,6 +369,7 @@ void complexmatrix_initialize(void) { object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int)", complexmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complexmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/xmatrix.c b/src/xmatrix.c index a7d325ed1..2772c3545 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -574,6 +574,13 @@ value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +value xmatrix_constructor__int(vm *v, int nargs, value *args) { + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + objectxmatrix *new=xmatrix_new(nrows, 1, true); + return morpho_wrapandbind(v, (object *) new); +} + /** Clones a matrix */ value xmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -1135,6 +1142,7 @@ void xmatrix_initialize(void) { object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int)", xmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (XMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Tuple)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/test/constructors/complexmatrix_vector_constructor.morpho b/test/constructors/complexmatrix_vector_constructor.morpho new file mode 100644 index 000000000..55e32e485 --- /dev/null +++ b/test/constructors/complexmatrix_vector_constructor.morpho @@ -0,0 +1,9 @@ +// Create a ComplexMatrix column vector + +import newlinalg + +var A = ComplexMatrix(2) + +print A +// expect: [ 0 + 0im ] +// expect: [ 0 + 0im ] diff --git a/test/constructors/matrix_vector_constructor.morpho b/test/constructors/matrix_vector_constructor.morpho new file mode 100644 index 000000000..1eb18c22a --- /dev/null +++ b/test/constructors/matrix_vector_constructor.morpho @@ -0,0 +1,9 @@ +// Create a Matrix + +import newlinalg + +var A = XMatrix(2) + +print A +// expect: [ 0 ] +// expect: [ 0 ] From 3915aca04f3b70ced7e1523415e5bc003f70b6cf Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 25 Dec 2025 16:46:23 -0500 Subject: [PATCH 149/473] Label meaning of function flags --- src/builtin/builtin.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index 1f381ff23..c5d0dd496 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -26,10 +26,10 @@ typedef unsigned int builtinfunctionflags; #define BUILTIN_FLAGSEMPTY 0 #define MORPHO_FN_FLAGSEMPTY (0) -#define MORPHO_FN_PUREFN (1<<1) -#define MORPHO_FN_CONSTRUCTOR (1<<2) -#define MORPHO_FN_REENTRANT (1<<3) -#define MORPHO_FN_OPTARGS (1<<4) +#define MORPHO_FN_PUREFN (1<<1) // Pure function: no side effects +#define MORPHO_FN_CONSTRUCTOR (1<<2) // Constructor function +#define MORPHO_FN_REENTRANT (1<<3) // Function that re-enters the vm, e.g. but using morph_call +#define MORPHO_FN_OPTARGS (1<<4) // Function that has optional arguments /** Type of C function that implements a built in Morpho function */ typedef value (*builtinfunction) (vm *v, int nargs, value *args); From 5be55fcb0501ceb1084326d15042b12c4e2cbd43 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 26 Dec 2025 17:36:15 -0500 Subject: [PATCH 150/473] ComplexMatrix_add__xmatrix --- src/xcomplexmatrix.c | 20 ++++++++++++++++++- src/xmatrix.c | 8 ++++++++ src/xmatrix.h | 2 ++ .../complexmatrix_add_matrix.morpho | 9 +++++++++ .../complexmatrix_addr_matrix.morpho | 9 +++++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/arithmetic/complexmatrix_add_matrix.morpho create mode 100644 test/arithmetic/complexmatrix_addr_matrix.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 35863642f..8b51b15e5 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -258,6 +258,22 @@ value complexmatrix_constructor__array(vm *v, int nargs, value *args) { * Arithmetic * ---------------------- */ +value ComplexMatrix_add__xmatrix(vm *v, int nargs, value *args) { + objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (a->ncols==b->ncols && a->nrows==b->nrows) { + objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); + if (new) { + complexmatrix_promote(b, new); + xmatrix_axpy(1.0, a, new); + } + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); + return out; +} + value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -270,7 +286,7 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { complexmatrix_mmul(alpha, a, b, beta, new); } out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } @@ -328,8 +344,10 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatri MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 2772c3545..3e0af23f5 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -31,6 +31,13 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a) { return NULL; } +/** Checks if a value is a known kind of matrix. */ +bool xmatrix_isamatrix(value val) { + if (!MORPHO_ISOBJECT(val)) return false; + int iindx=MORPHO_GETOBJECT(val)->type-OBJECT_XMATRIX; + return iindx>=0 && iindx Date: Fri, 26 Dec 2025 18:04:32 -0500 Subject: [PATCH 151/473] ComplexMatrix sub matrix --- src/xcomplexmatrix.c | 27 +++++++++++++++---- src/xmatrix.c | 1 + .../complexmatrix_add_complexmatrix.morpho | 8 ++++++ .../complexmatrix_sub_complexmatrix.morpho | 9 +++++++ .../complexmatrix_sub_matrix.morpho | 9 +++++++ .../complexmatrix_subr_matrix.morpho | 9 +++++++ 6 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 test/arithmetic/complexmatrix_add_complexmatrix.morpho create mode 100644 test/arithmetic/complexmatrix_sub_complexmatrix.morpho create mode 100644 test/arithmetic/complexmatrix_sub_matrix.morpho create mode 100644 test/arithmetic/complexmatrix_subr_matrix.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 8b51b15e5..77ceb75c5 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -258,7 +258,8 @@ value complexmatrix_constructor__array(vm *v, int nargs, value *args) { * Arithmetic * ---------------------- */ -value ComplexMatrix_add__xmatrix(vm *v, int nargs, value *args) { +/** Add a vector */ +static value _axpy(vm *v, int nargs, value *args, double alpha) { objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; @@ -267,13 +268,27 @@ value ComplexMatrix_add__xmatrix(vm *v, int nargs, value *args) { objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); if (new) { complexmatrix_promote(b, new); - xmatrix_axpy(1.0, a, new); + xmatrix_axpy(alpha, a, new); } out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } +value ComplexMatrix_add__xmatrix(vm *v, int nargs, value *args) { + return _axpy(v, nargs, args, 1.0); +} + +value ComplexMatrix_sub__xmatrix(vm *v, int nargs, value *args) { + value out = _axpy(v, nargs, args, -1.0); + if (xmatrix_isamatrix(out)) xmatrix_scale(MORPHO_GETXMATRIX(out), -1.0); // -(-A + B) + return out; +} + +value ComplexMatrix_subr__xmatrix(vm *v, int nargs, value *args) { + return _axpy(v, nargs, args, -1.0); +} + value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -342,16 +357,18 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex_ MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_subr__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 3e0af23f5..5dbc56f33 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -790,6 +790,7 @@ value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { } value XMatrix_sub__x(vm *v, int nargs, value *args) { + if (xmatrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr return _xpa(v,nargs,args,1.0,-1.0); } diff --git a/test/arithmetic/complexmatrix_add_complexmatrix.morpho b/test/arithmetic/complexmatrix_add_complexmatrix.morpho new file mode 100644 index 000000000..6417bca8b --- /dev/null +++ b/test/arithmetic/complexmatrix_add_complexmatrix.morpho @@ -0,0 +1,8 @@ +// Add a complexmatrix to a complexmatrix +import newlinalg + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) + +print A + A +// expect: [ 2 + 2im 4 + 4im ] +// expect: [ 6 + 6im 8 + 8im ] diff --git a/test/arithmetic/complexmatrix_sub_complexmatrix.morpho b/test/arithmetic/complexmatrix_sub_complexmatrix.morpho new file mode 100644 index 000000000..c6bb639da --- /dev/null +++ b/test/arithmetic/complexmatrix_sub_complexmatrix.morpho @@ -0,0 +1,9 @@ +// Subtract a complexmatrix from a complexmatrix +import newlinalg + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = ComplexMatrix(((4+4im, 3+3im), (2+2im, 1+1im))) + +print A - B +// expect: [ -3 - 3im -1 - 1im ] +// expect: [ 1 + 1im 3 + 3im ] diff --git a/test/arithmetic/complexmatrix_sub_matrix.morpho b/test/arithmetic/complexmatrix_sub_matrix.morpho new file mode 100644 index 000000000..1b0afe9e7 --- /dev/null +++ b/test/arithmetic/complexmatrix_sub_matrix.morpho @@ -0,0 +1,9 @@ +// Subtract a matrix from a complexmatrix +import newlinalg + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = XMatrix(((4, 3), (2, 1))) + +print A - B +// expect: [ -3 + 1im -1 + 2im ] +// expect: [ 1 + 3im 3 + 4im ] diff --git a/test/arithmetic/complexmatrix_subr_matrix.morpho b/test/arithmetic/complexmatrix_subr_matrix.morpho new file mode 100644 index 000000000..03e9bbf04 --- /dev/null +++ b/test/arithmetic/complexmatrix_subr_matrix.morpho @@ -0,0 +1,9 @@ +// Subtract a matrix from a complexmatrix +import newlinalg + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = XMatrix(((4, 3), (2, 1))) + +print B - A +// expect: [ 3 - 1im 1 - 2im ] +// expect: [ -1 - 3im -3 - 4im ] From 364a15c116ea770d9cfb7eba6b0c2d64da5e28a7 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 05:32:55 -0500 Subject: [PATCH 152/473] Multiply by a complex number --- src/newlinalg.h | 3 ++ src/xcomplexmatrix.c | 15 +++++++++ src/xmatrix.c | 32 +++++++------------ .../complexmatrix_mul_complex.morpho | 8 +++++ .../complexmatrix_mulr_complex.xmorpho | 8 +++++ 5 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 test/arithmetic/complexmatrix_mul_complex.morpho create mode 100644 test/arithmetic/complexmatrix_mulr_complex.xmorpho diff --git a/src/newlinalg.h b/src/newlinalg.h index 6156599ec..415ad80de 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -73,6 +73,9 @@ void linalg_raiseerror(vm *v, linalgError_t err); - if an error occurred, raises the corresponding error in a vm called v */ #define LINALG_ERRCHECKVM(f) { linalgError_t err = f; if (err!=LINALGERR_OK) linalg_raiseerror(v, err); } +/** As for LINALG_ERRCHECKVM but additionally jumps to a given label */ +#define LINALG_ERRCHECKVMGOTO(f, label) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto label; }} + /* ------------------------------------------------------- * Include the rest of the library * ------------------------------------------------------- */ diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 77ceb75c5..c171e7187 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -166,6 +166,11 @@ linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxm return LINALGERR_OK; } +/** Scales a matrix x <- scale * x >*/ +void complexmatrix_scale(objectxmatrix *a, MorphoComplex scale) { + cblas_zscal(a->nrows * a->ncols, (__LAPACK_double_complex *) &scale, (__LAPACK_double_complex *) a->elements, 1); +} + /** Finds the Frobenius inner product of two complex matrices (a, b) = \sum_{i,j} conj(a)_ij * b_ij */ linalgError_t complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { if (!(a->ncols==b->ncols && a->nrows==b->nrows)) return LINALGERR_INCOMPATIBLE_DIM; @@ -289,6 +294,14 @@ value ComplexMatrix_subr__xmatrix(vm *v, int nargs, value *args) { return _axpy(v, nargs, args, -1.0); } +value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + + objectxmatrix *new = xmatrix_clone(a); + if (new) complexmatrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); + return morpho_wrapandbind(v, (object *) new); +} + value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -370,7 +383,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", XMatrix_sub__x, MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_subr__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 5dbc56f33..4cbe7ff5e 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -750,7 +750,7 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { if (a->ncols==b->ncols && a->nrows==b->nrows) { new=xmatrix_clone(a); - if (new) xmatrix_axpy(alpha, b, new); // TODO: Error check + if (new) LINALG_ERRCHECKVM(xmatrix_axpy(alpha, b, new)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); @@ -760,12 +760,13 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { /** Add a scalar */ static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *new=NULL; value out=MORPHO_NIL; double beta; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &beta)) { - objectxmatrix *new = xmatrix_clone(a); - if (new) xmatrix_addscalar(new, sgna, beta*sgnb); + new = xmatrix_clone(a); + if (new) LINALG_ERRCHECKVM(xmatrix_addscalar(new, sgna, beta*sgnb)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INVLDARGS); @@ -817,7 +818,7 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { if (a->ncols==b->nrows) { objectxmatrix *new = xmatrix_new(a->nrows, b->ncols, false); - if (new) xmatrix_mmul(1.0, a, b, 0.0, new); + if (new) LINALG_ERRCHECKVM(xmatrix_mmul(1.0, a, b, 0.0, new)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; @@ -840,13 +841,11 @@ value XMatrix_div__float(vm *v, int nargs, value *args) { value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument - value out=MORPHO_NIL; objectxmatrix *sol = xmatrix_clone(b); - out = morpho_wrapandbind(v, (object *) sol); if (sol) LINALG_ERRCHECKVM(xmatrix_solve(a, sol)); - return out; + return morpho_wrapandbind(v, (object *) sol); } /** Accumulate in place */ @@ -855,7 +854,7 @@ value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)); double alpha=1.0; - if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) morpho_runtimeerror(v, MATRIX_ARITHARGS); + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, MATRIX_ARITHARGS); return MORPHO_NIL; } LINALG_ERRCHECKVM(xmatrix_axpy(alpha, b, a)); return MORPHO_NIL; @@ -907,29 +906,22 @@ value XMatrix_trace(vm *v, int nargs, value *args) { /** Inverts a matrix */ value XMatrix_transpose(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - objectxmatrix *new = xmatrix_clone(a); if (new) { new->ncols=a->nrows; new->nrows=a->ncols; LINALG_ERRCHECKVM(xmatrix_transpose(a, new)); } - out = morpho_wrapandbind(v, (object *) new); - - return out; + return morpho_wrapandbind(v, (object *) new); } /** Inverts a matrix */ value XMatrix_inverse(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - objectxmatrix *new = xmatrix_clone(a); - out = morpho_wrapandbind(v, (object *) new); if (new) LINALG_ERRCHECKVM(xmatrix_inverse(new)); - return out; + return morpho_wrapandbind(v, (object *) new); } static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { @@ -966,7 +958,7 @@ value XMatrix_eigenvalues(vm *v, int nargs, value *args) { linalgError_t err=xmatrix_eigen(a, w, NULL); if (err==LINALGERR_OK) { if (_processeigenvalues(v, n, w, &out)) { - morpho_bindobjects(v, 1, &out); // TODO: Correctly bind subsidiary values + morpho_bindobjects(v, 1, &out); } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); } else linalg_raiseerror(v, err); @@ -998,12 +990,12 @@ value XMatrix_eigensystem(vm *v, int nargs, value *args) { otuple = object_newtuple(2, outtuple); _CHK(otuple); - return morpho_wrapandbind(v, (object *) otuple); // TODO: Correctly bind subsidiary values + return morpho_wrapandbind(v, (object *) otuple); _eigensystem_cleanup: if (evec) object_free((object *) evec); if (otuple) object_free((object *) otuple); - morpho_freeobject(ev); // TODO: Free contents? + morpho_freeobject(ev); // TODO: Free contents? return MORPHO_NIL; } diff --git a/test/arithmetic/complexmatrix_mul_complex.morpho b/test/arithmetic/complexmatrix_mul_complex.morpho new file mode 100644 index 000000000..c84044590 --- /dev/null +++ b/test/arithmetic/complexmatrix_mul_complex.morpho @@ -0,0 +1,8 @@ +// Multiply ComplexMatrix by scalar +import newlinalg + +var A = ComplexMatrix(((1,2),(3,4))) + +print A * (1+im) +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] \ No newline at end of file diff --git a/test/arithmetic/complexmatrix_mulr_complex.xmorpho b/test/arithmetic/complexmatrix_mulr_complex.xmorpho new file mode 100644 index 000000000..ab5cf79db --- /dev/null +++ b/test/arithmetic/complexmatrix_mulr_complex.xmorpho @@ -0,0 +1,8 @@ +// Multiply ComplexMatrix by scalar +import newlinalg + +var A = ComplexMatrix(((1,2),(3,4))) + +print (1+im) * A +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] \ No newline at end of file From da97bef9d2ec9a720be360b39196eb011e13800f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 09:18:13 -0500 Subject: [PATCH 153/473] Fix unchecked error in compiler_findmethodreturntype --- src/core/compile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/compile.c b/src/core/compile.c index 241cc3d8f..f1499f5a5 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -2346,8 +2346,7 @@ bool compiler_findmethodreturntype(value klass, char *label, value *type) { value method = MORPHO_NIL; if (dictionary_get(&MORPHO_GETCLASS(klass)->methods, MORPHO_OBJECT(&selector), &method)) { signature *s = metafunction_getsignature(method); - *type = signature_getreturntype(s); - return true; + if (s) { *type = signature_getreturntype(s); return true; } } return false; From d34dd2b1e81ebb5fd802e5b5fd309241662403ab Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 09:33:59 -0500 Subject: [PATCH 154/473] Complexmatrix-Matrix multiplication --- src/xcomplexmatrix.c | 44 +++++++++++++++++++ src/xmatrix.c | 2 +- .../complexmatrix_mul_complex.morpho | 2 +- .../complexmatrix_mul_complexmatrix.morpho | 19 ++++++++ .../complexmatrix_mul_matrix.morpho | 18 ++------ .../complexmatrix_mulr_matrix.morpho | 9 ++++ 6 files changed, 78 insertions(+), 16 deletions(-) create mode 100644 test/arithmetic/complexmatrix_mul_complexmatrix.morpho create mode 100644 test/arithmetic/complexmatrix_mulr_matrix.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index c171e7187..7c32666bf 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -318,6 +318,48 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { return out; } +value ComplexMatrix_mul__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (a->ncols==b->nrows) { + objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, true); + objectcomplexmatrix *btemp=complexmatrix_new(b->nrows, b->ncols, true); + + if (new && btemp) { + MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); + complexmatrix_promote(b, btemp); + complexmatrix_mmul(alpha, a, btemp, beta, new); + } + if (btemp) object_free((object *) btemp); + + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); + return out; +} + +value ComplexMatrix_mulr__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (a->ncols==b->nrows) { + objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, true); + objectcomplexmatrix *btemp=complexmatrix_new(b->nrows, b->ncols, true); + + if (new && btemp) { + MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); + complexmatrix_promote(b, btemp); + complexmatrix_mmul(alpha, btemp, a, beta, new); + } + if (btemp) object_free((object *) btemp); + + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); + return out; +} + /** Computes the trace */ value ComplexMatrix_trace(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -385,6 +427,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (XMatrix)", ComplexMa MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mulr__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 4cbe7ff5e..177b92f51 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -804,7 +804,7 @@ value XMatrix_mul__float(vm *v, int nargs, value *args) { value out=MORPHO_NIL; double scale; - morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; objectxmatrix *new = xmatrix_clone(a); if (new) xmatrix_scale(new, scale); diff --git a/test/arithmetic/complexmatrix_mul_complex.morpho b/test/arithmetic/complexmatrix_mul_complex.morpho index c84044590..7c2d7b756 100644 --- a/test/arithmetic/complexmatrix_mul_complex.morpho +++ b/test/arithmetic/complexmatrix_mul_complex.morpho @@ -5,4 +5,4 @@ var A = ComplexMatrix(((1,2),(3,4))) print A * (1+im) // expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] \ No newline at end of file +// expect: [ 3 + 3im 4 + 4im ] diff --git a/test/arithmetic/complexmatrix_mul_complexmatrix.morpho b/test/arithmetic/complexmatrix_mul_complexmatrix.morpho new file mode 100644 index 000000000..00f78a9ff --- /dev/null +++ b/test/arithmetic/complexmatrix_mul_complexmatrix.morpho @@ -0,0 +1,19 @@ +// Multiply two ComplexMatrices +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = ComplexMatrix(2,2) +B[0,0]=1 +B[0,1]=1im +B[1,0]=-1im +B[1,1]=1 + +print A * B +// expect: [ 3 - 1im 1 + 3im ] +// expect: [ 7 - 1im 1 + 7im ] + diff --git a/test/arithmetic/complexmatrix_mul_matrix.morpho b/test/arithmetic/complexmatrix_mul_matrix.morpho index 00f78a9ff..18e7419c0 100644 --- a/test/arithmetic/complexmatrix_mul_matrix.morpho +++ b/test/arithmetic/complexmatrix_mul_matrix.morpho @@ -1,19 +1,9 @@ // Multiply two ComplexMatrices import newlinalg -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[0,1]=2+2im -A[1,0]=3+3im -A[1,1]=4+4im - -var B = ComplexMatrix(2,2) -B[0,0]=1 -B[0,1]=1im -B[1,0]=-1im -B[1,1]=1 +var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) +var B = XMatrix(((4,3),(2,1))) print A * B -// expect: [ 3 - 1im 1 + 3im ] -// expect: [ 7 - 1im 1 + 7im ] - +// expect: [ 8 + 8im 5 + 5im ] +// expect: [ 20 + 20im 13 + 13im ] \ No newline at end of file diff --git a/test/arithmetic/complexmatrix_mulr_matrix.morpho b/test/arithmetic/complexmatrix_mulr_matrix.morpho new file mode 100644 index 000000000..5f1c6bc54 --- /dev/null +++ b/test/arithmetic/complexmatrix_mulr_matrix.morpho @@ -0,0 +1,9 @@ +// Multiply two ComplexMatrices +import newlinalg + +var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) +var B = XMatrix(((4,3),(2,1))) + +print B * A +// expect: [ 13 + 13im 20 + 20im ] +// expect: [ 5 + 5im 8 + 8im ] \ No newline at end of file From 6512fed762cfd791528f56890b1e229caf46e4f5 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 10:30:02 -0500 Subject: [PATCH 155/473] Refactor of complexmatrix-matrix multiply --- src/xcomplexmatrix.c | 71 ++++++++----------- .../complexmatrix_mulr_matrix.morpho | 8 ++- ...lexmatrix_tuple_column_constructor.xmorpho | 9 +++ 3 files changed, 45 insertions(+), 43 deletions(-) create mode 100644 test/constructors/complexmatrix_tuple_column_constructor.xmorpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 7c32666bf..e2e8ea53b 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -302,62 +302,49 @@ value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +static objectxmatrix *_mul(objectxmatrix *a, objectxmatrix *b) { + objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); + if (new) { + MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); + complexmatrix_mmul(alpha, a, b, beta, new); + } + return new; +} + value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; + if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - if (a->ncols==b->nrows) { - objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); - if (new) { - MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); - complexmatrix_mmul(alpha, a, b, beta, new); - } - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - return out; + return morpho_wrapandbind(v, (object *) _mul(a,b)); } value ComplexMatrix_mul__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; + if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - if (a->ncols==b->nrows) { - objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, true); - objectcomplexmatrix *btemp=complexmatrix_new(b->nrows, b->ncols, true); - - if (new && btemp) { - MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); - complexmatrix_promote(b, btemp); - complexmatrix_mmul(alpha, a, btemp, beta, new); - } - if (btemp) object_free((object *) btemp); - - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - return out; + objectcomplexmatrix *btemp=complexmatrix_new(b->nrows, b->ncols, true); + if (btemp) complexmatrix_promote(b, btemp); + else { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + + objectcomplexmatrix *new =_mul(a,btemp); + if (btemp) object_free((object *) btemp); + return morpho_wrapandbind(v, (object *) new); } value ComplexMatrix_mulr__xmatrix(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - if (a->ncols==b->nrows) { - objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, true); - objectcomplexmatrix *btemp=complexmatrix_new(b->nrows, b->ncols, true); - - if (new && btemp) { - MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); - complexmatrix_promote(b, btemp); - complexmatrix_mmul(alpha, btemp, a, beta, new); - } - if (btemp) object_free((object *) btemp); - - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - return out; + objectcomplexmatrix *atemp=complexmatrix_new(a->nrows, a->ncols, true); + if (atemp) { complexmatrix_promote(a, atemp); } + else { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + + objectcomplexmatrix *new =_mul(atemp,b); + if (atemp) object_free((object *) atemp); + return morpho_wrapandbind(v, (object *) new); } /** Computes the trace */ diff --git a/test/arithmetic/complexmatrix_mulr_matrix.morpho b/test/arithmetic/complexmatrix_mulr_matrix.morpho index 5f1c6bc54..7cba06d6d 100644 --- a/test/arithmetic/complexmatrix_mulr_matrix.morpho +++ b/test/arithmetic/complexmatrix_mulr_matrix.morpho @@ -6,4 +6,10 @@ var B = XMatrix(((4,3),(2,1))) print B * A // expect: [ 13 + 13im 20 + 20im ] -// expect: [ 5 + 5im 8 + 8im ] \ No newline at end of file +// expect: [ 5 + 5im 8 + 8im ] + +var C = ComplexMatrix([[1+1im],[3+3im]]) + +print B * C +// expect: [ 13 + 13im ] +// expect: [ 5 + 5im ] diff --git a/test/constructors/complexmatrix_tuple_column_constructor.xmorpho b/test/constructors/complexmatrix_tuple_column_constructor.xmorpho new file mode 100644 index 000000000..ac7140443 --- /dev/null +++ b/test/constructors/complexmatrix_tuple_column_constructor.xmorpho @@ -0,0 +1,9 @@ +// Create a column vector from a list of tuples + +import newlinalg + +var C = ComplexMatrix(((1+1im),(3+3im))) + +print C +// expect: [ 1 + 1im ] +// expect: [ 3 + 3im ] From e61439b4a57b5477f92f14ddbad0045c769f93e0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 13:43:40 -0500 Subject: [PATCH 156/473] Shorten and make common functions --- src/xcomplexmatrix.c | 56 ++++++++++++++++++-------------------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index e2e8ea53b..2607f778f 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -302,49 +302,39 @@ value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -static objectxmatrix *_mul(objectxmatrix *a, objectxmatrix *b) { +/** Multiplication by a complexmatrix or a regular matrix */ +static bool _promote(vm *v, objectxmatrix *b, objectxmatrix **bp) { // Promotes b to a complexmatrix + *bp=complexmatrix_new(b->nrows, b->ncols, true); + if (!bp) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } + return complexmatrix_promote(b, *bp)==LINALGERR_OK; +} + +static value _cmmul(vm *v, objectxmatrix *a, objectxmatrix *b) { + if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); - if (new) { - MorphoComplex alpha = MCBuild(1.0, 0.0), beta = MCBuild(0.0, 0.0); - complexmatrix_mmul(alpha, a, b, beta, new); - } - return new; + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + complexmatrix_mmul(MCBuild(1.0, 0.0), a, b, MCBuild(0.0, 0.0), new); + return morpho_wrapandbind(v, (object *) new); +} + +static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { + objectxmatrix *A=MORPHO_GETXMATRIX(a), *B=MORPHO_GETXMATRIX(b), *bp=NULL; + if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } + value out = (swap ? _cmmul(v, B, A) : _cmmul(v, A, B)); // Multiply, swapping arguments if requested + if (bp) object_free((object *) bp); + return out; } value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - - return morpho_wrapandbind(v, (object *) _mul(a,b)); + return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), false, false); } value ComplexMatrix_mul__xmatrix(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - - objectcomplexmatrix *btemp=complexmatrix_new(b->nrows, b->ncols, true); - if (btemp) complexmatrix_promote(b, btemp); - else { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - - objectcomplexmatrix *new =_mul(a,btemp); - if (btemp) object_free((object *) btemp); - return morpho_wrapandbind(v, (object *) new); + return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, false); } value ComplexMatrix_mulr__xmatrix(vm *v, int nargs, value *args) { - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - - objectcomplexmatrix *atemp=complexmatrix_new(a->nrows, a->ncols, true); - if (atemp) { complexmatrix_promote(a, atemp); } - else { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - - objectcomplexmatrix *new =_mul(atemp,b); - if (atemp) object_free((object *) atemp); - return morpho_wrapandbind(v, (object *) new); + return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, true); } /** Computes the trace */ From 4437ef3feb5d7eaef122163c84dc40b7a4149b9f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 13:54:55 -0500 Subject: [PATCH 157/473] Fix incorrect check --- src/xcomplexmatrix.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 2607f778f..a092520aa 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -305,11 +305,11 @@ value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { /** Multiplication by a complexmatrix or a regular matrix */ static bool _promote(vm *v, objectxmatrix *b, objectxmatrix **bp) { // Promotes b to a complexmatrix *bp=complexmatrix_new(b->nrows, b->ncols, true); - if (!bp) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } + if (!*bp) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } return complexmatrix_promote(b, *bp)==LINALGERR_OK; } -static value _cmmul(vm *v, objectxmatrix *a, objectxmatrix *b) { +static value _cmmul(vm *v, objectxmatrix *a, objectxmatrix *b) { // Performs a*b returning a wrapped value if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } @@ -317,9 +317,9 @@ static value _cmmul(vm *v, objectxmatrix *a, objectxmatrix *b) { return morpho_wrapandbind(v, (object *) new); } -static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { +static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { // Driver routine for a*b objectxmatrix *A=MORPHO_GETXMATRIX(a), *B=MORPHO_GETXMATRIX(b), *bp=NULL; - if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } + if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } // Promote b if requested value out = (swap ? _cmmul(v, B, A) : _cmmul(v, A, B)); // Multiply, swapping arguments if requested if (bp) object_free((object *) bp); return out; From f2c2ac9687911f3a8f7c5a3c830c9cabd9e3ad86 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 14:00:20 -0500 Subject: [PATCH 158/473] Minor fix for consistency --- src/xcomplexmatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index a092520aa..566228fbf 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -137,7 +137,7 @@ linalgError_t complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - MatrixCount_t ix = 2*(col*matrix->nrows+row); + MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); if (value) *value=MCBuild(matrix->elements[ix],matrix->elements[ix+1]); return LINALGERR_OK; } From 9a2874771561ee30c5297e179658ade9c7dc7338 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 16:31:33 -0500 Subject: [PATCH 159/473] Vector-like constructors --- src/xmatrix.c | 4 ++++ ...omplexmatrix_list_vector_constructor.morpho | 18 ++++++++++++++++++ ...plexmatrix_tuple_column_constructor.morpho} | 0 .../matrix_list_vector_constructor.morpho | 9 +++++++++ 4 files changed, 31 insertions(+) create mode 100644 test/constructors/complexmatrix_list_vector_constructor.morpho rename test/constructors/{complexmatrix_tuple_column_constructor.xmorpho => complexmatrix_tuple_column_constructor.morpho} (100%) create mode 100644 test/constructors/matrix_list_vector_constructor.morpho diff --git a/src/xmatrix.c b/src/xmatrix.c index 177b92f51..b804176d0 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -196,6 +196,8 @@ static bool _getelement(value v, int i, value *out) { return list_getelement(MORPHO_GETLIST(v), i, out); } else if (MORPHO_ISTUPLE(v)) { return tuple_getelement(MORPHO_GETTUPLE(v), i, out); + } else if (MORPHO_ISNUMBER(v) || MORPHO_ISCOMPLEX(v)) { + if (i==0) { *out = v; return true; } } return false; } @@ -205,6 +207,8 @@ static bool _length(value v, int *len) { *len = list_length(MORPHO_GETLIST(v)); return true; } else if (MORPHO_ISTUPLE(v)) { *len = tuple_length(MORPHO_GETTUPLE(v)); return true; + } else if (MORPHO_ISNUMBER(v) || MORPHO_ISCOMPLEX(v)) { + *len = 1; return true; } return false; } diff --git a/test/constructors/complexmatrix_list_vector_constructor.morpho b/test/constructors/complexmatrix_list_vector_constructor.morpho new file mode 100644 index 000000000..3915d5be8 --- /dev/null +++ b/test/constructors/complexmatrix_list_vector_constructor.morpho @@ -0,0 +1,18 @@ +// Create a ComplexMatrix from a List of Values + +import newlinalg + +var A = ComplexMatrix([1+im, 2-2im, 3+3im, 4-4im]) + +print A +// expect: [ 1 + 1im ] +// expect: [ 2 - 2im ] +// expect: [ 3 + 3im ] +// expect: [ 4 - 4im ] + +var B = ComplexMatrix(((1+im), (2), (3), (4-4im))) +print B +// expect: [ 1 + 1im ] +// expect: [ 2 + 0im ] +// expect: [ 3 + 0im ] +// expect: [ 4 - 4im ] diff --git a/test/constructors/complexmatrix_tuple_column_constructor.xmorpho b/test/constructors/complexmatrix_tuple_column_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_tuple_column_constructor.xmorpho rename to test/constructors/complexmatrix_tuple_column_constructor.morpho diff --git a/test/constructors/matrix_list_vector_constructor.morpho b/test/constructors/matrix_list_vector_constructor.morpho new file mode 100644 index 000000000..4e34f4aca --- /dev/null +++ b/test/constructors/matrix_list_vector_constructor.morpho @@ -0,0 +1,9 @@ +// Create a column vector from a list of tuples + +import newlinalg + +var C = XMatrix(((1),(2))) + +print C +// expect: [ 1 ] +// expect: [ 2 ] From 9ddec573993c948bae6f140dcc4f22b54df9908d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 16:58:24 -0500 Subject: [PATCH 160/473] ComplexMatrix real() and imag() --- src/xcomplexmatrix.c | 37 +++++++++++++++++++++++--- src/xmatrix.h | 1 + test/methods/complexmatrix_imag.morpho | 12 +++++++++ test/methods/complexmatrix_real.morpho | 12 +++++++++ 4 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 test/methods/complexmatrix_imag.morpho create mode 100644 test/methods/complexmatrix_real.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 566228fbf..0719cebd7 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -13,6 +13,7 @@ #include "xmatrix.h" #include "xcomplexmatrix.h" #include "format.h" +#include "cmplx.h" objecttype objectcomplexmatrixtype; #define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype @@ -143,13 +144,22 @@ linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t } /** Copies a real matrix x into a complex matrix y */ -linalgError_t complexmatrix_promote(objectxmatrix *x, objectcomplexmatrix *y) { +static linalgError_t _stridedcopy(objectxmatrix *x, objectxmatrix *y, int offset) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 2); + cblas_dcopy((__LAPACK_int) x->ncols*x->nrows, x->elements+offset, x->nvals, y->elements, y->nvals); return LINALGERR_OK; } +linalgError_t complexmatrix_promote(objectxmatrix *x, objectcomplexmatrix *y) { + return _stridedcopy(x, y, 0); +} + +/** Copies the real part of a complex matrix y into */ +linalgError_t complexmatrix_demote(objectcomplexmatrix *x, objectxmatrix *y, bool imag) { + return _stridedcopy(x, y, (imag?1:0)); +} + /* ---------------------- * Complex arithmetic * ---------------------- */ @@ -309,7 +319,7 @@ static bool _promote(vm *v, objectxmatrix *b, objectxmatrix **bp) { // Promotes return complexmatrix_promote(b, *bp)==LINALGERR_OK; } -static value _cmmul(vm *v, objectxmatrix *a, objectxmatrix *b) { // Performs a*b returning a wrapped value +static value _axb(vm *v, objectxmatrix *a, objectxmatrix *b) { // Performs a*b returning a wrapped value if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } @@ -320,7 +330,7 @@ static value _cmmul(vm *v, objectxmatrix *a, objectxmatrix *b) { // Performs a*b static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { // Driver routine for a*b objectxmatrix *A=MORPHO_GETXMATRIX(a), *B=MORPHO_GETXMATRIX(b), *bp=NULL; if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } // Promote b if requested - value out = (swap ? _cmmul(v, B, A) : _cmmul(v, A, B)); // Multiply, swapping arguments if requested + value out = (swap ? _axb(v, B, A) : _axb(v, A, B)); // Multiply, swapping arguments if requested if (bp) object_free((object *) bp); return out; } @@ -358,6 +368,23 @@ value ComplexMatrix_inverse(vm *v, int nargs, value *args) { return out; } +static value _realimag(vm *v, int nargs, value *args, bool imag) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *new=xmatrix_new(a->nrows, a->ncols, false); + if (new) complexmatrix_demote(a, new, imag); + return morpho_wrapandbind(v, (object *) new); +} + +/** Extract real part */ +value ComplexMatrix_real(vm *v, int nargs, value *args) { + return _realimag(v, nargs, args, false); +} + +/** Extract imaginary part */ +value ComplexMatrix_imag(vm *v, int nargs, value *args) { + return _realimag(v, nargs, args, true); +} + /* --------- * Products * --------- */ @@ -417,6 +444,8 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, MORPHO_FN MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", XMatrix_sum, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "XMatrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "XMatrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 6b01aa4d2..e91db6885 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -184,6 +184,7 @@ IMPLEMENTATIONFN(XMatrix_dimensions); bool xmatrix_isamatrix(value val); objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); +objectxmatrix *xmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero); objectxmatrix *xmatrix_clone(objectxmatrix *in); objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals); objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals); diff --git a/test/methods/complexmatrix_imag.morpho b/test/methods/complexmatrix_imag.morpho new file mode 100644 index 000000000..05324513e --- /dev/null +++ b/test/methods/complexmatrix_imag.morpho @@ -0,0 +1,12 @@ +// Inner product of ComplexMatrices (Frobenius inner product with conjugation) +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.imag() +// expect: [ 4 3 ] +// expect: [ 2 1 ] diff --git a/test/methods/complexmatrix_real.morpho b/test/methods/complexmatrix_real.morpho new file mode 100644 index 000000000..8fc318adb --- /dev/null +++ b/test/methods/complexmatrix_real.morpho @@ -0,0 +1,12 @@ +// Inner product of ComplexMatrices (Frobenius inner product with conjugation) +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.real() +// expect: [ 1 2 ] +// expect: [ 3 4 ] From dc274aea40e48b967c1c80b75a921e1608d2b85e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 17:30:56 -0500 Subject: [PATCH 161/473] conj() and conjTranspose() --- src/xcomplexmatrix.c | 24 ++++++++++++++++++- src/xcomplexmatrix.h | 2 ++ test/methods/complexmatrix_conj.morpho | 12 ++++++++++ .../complexmatrix_conjTranspose.morpho | 22 +++++++++++++++++ test/methods/complexmatrix_real.morpho | 2 +- 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 test/methods/complexmatrix_conj.morpho create mode 100644 test/methods/complexmatrix_conjTranspose.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 0719cebd7..8a9226616 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -59,7 +59,7 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { /** Evaluate norms */ static double _normfn(objectxmatrix *a, xmatrix_norm_t nrm) { char cnrm = xmatrix_normtolapack(nrm); - int nrows=a->nrows, ncols=a->ncols, info; + int nrows=a->nrows, ncols=a->ncols; #ifdef MORPHO_LINALG_USE_LAPACKE return LAPACKE_zlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); @@ -385,6 +385,26 @@ value ComplexMatrix_imag(vm *v, int nargs, value *args) { return _realimag(v, nargs, args, true); } +static value _conj(vm *v, int nargs, value *args, bool trans) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *new=xmatrix_clone(a); + if (new) { + if (trans) xmatrix_transpose(a, new); + cblas_dscal(a->nrows*a->ncols, -1.0, new->elements+1, new->nvals); + } + return morpho_wrapandbind(v, (object *) new); +} + +/** Extract imaginary part */ +value ComplexMatrix_conj(vm *v, int nargs, value *args) { + return _conj(v, nargs, args, false); +} + +/** Return conjugate transpose */ +value ComplexMatrix_conjTranspose(vm *v, int nargs, value *args) { + return _conj(v, nargs, args, true); +} + /* --------- * Products * --------- */ @@ -446,6 +466,8 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "XMatrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "XMatrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), diff --git a/src/xcomplexmatrix.h b/src/xcomplexmatrix.h index 4331a06a4..a048eda9f 100644 --- a/src/xcomplexmatrix.h +++ b/src/xcomplexmatrix.h @@ -13,6 +13,8 @@ #define COMPLEXMATRIX_CLASSNAME "ComplexMatrix" +#define COMPLEXMATRIX_CONJTRANSPOSE_METHOD "conjTranspose" + void complexmatrix_initialize(void); #endif diff --git a/test/methods/complexmatrix_conj.morpho b/test/methods/complexmatrix_conj.morpho new file mode 100644 index 000000000..a55c44739 --- /dev/null +++ b/test/methods/complexmatrix_conj.morpho @@ -0,0 +1,12 @@ +// Conjugate of a ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.conj() +// expect: [ 1 - 4im 2 - 3im ] +// expect: [ 3 - 2im 4 - 1im ] diff --git a/test/methods/complexmatrix_conjTranspose.morpho b/test/methods/complexmatrix_conjTranspose.morpho new file mode 100644 index 000000000..b616fc73d --- /dev/null +++ b/test/methods/complexmatrix_conjTranspose.morpho @@ -0,0 +1,22 @@ +// Conjugate of a ComplexMatrix +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +var B=A.conjTranspose() +print B +// expect: [ 1 - 4im 3 - 2im ] +// expect: [ 2 - 3im 4 - 1im ] + +for (ev in A.eigenvalues()) print isnumber(ev) +// expect: false +// expect: false + +var C=A+B // create a hermitian matrix +for (ev in C.eigenvalues()) print isnumber(ev) +// expect: true +// expect: true diff --git a/test/methods/complexmatrix_real.morpho b/test/methods/complexmatrix_real.morpho index 8fc318adb..1c508280e 100644 --- a/test/methods/complexmatrix_real.morpho +++ b/test/methods/complexmatrix_real.morpho @@ -1,4 +1,4 @@ -// Inner product of ComplexMatrices (Frobenius inner product with conjugation) +// Real part of a ComplexMatrix import newlinalg var A = ComplexMatrix(2,2) From 5ad57f5f25fbb164084e62bb773869e5fb12b934 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 17:46:02 -0500 Subject: [PATCH 162/473] Free partially allocated objects --- src/xmatrix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index b804176d0..6412b20c9 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -999,7 +999,12 @@ value XMatrix_eigensystem(vm *v, int nargs, value *args) { _eigensystem_cleanup: if (evec) object_free((object *) evec); if (otuple) object_free((object *) otuple); - morpho_freeobject(ev); // TODO: Free contents? + if (MORPHO_ISOBJECT(ev)) { + value evx; + objecttuple *t = MORPHO_GETTUPLE(ev); + for (int i=0; i Date: Sat, 27 Dec 2025 18:13:44 -0500 Subject: [PATCH 163/473] ComplexMatrix_div__xmatrix and divr --- src/xcomplexmatrix.c | 15 ++++++++++++++ src/xmatrix.c | 3 +-- src/xmatrix.h | 2 ++ .../complexmatrix_div_complexmatrix.morpho | 20 +++++++++++++++++++ .../complexmatrix_div_matrix.morpho | 20 +++++++++---------- .../complexmatrix_divr_matrix.morpho | 10 ++++++++++ 6 files changed, 57 insertions(+), 13 deletions(-) create mode 100644 test/arithmetic/complexmatrix_div_complexmatrix.morpho create mode 100644 test/arithmetic/complexmatrix_divr_matrix.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 8a9226616..8481e4ef3 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -347,6 +347,19 @@ value ComplexMatrix_mulr__xmatrix(vm *v, int nargs, value *args) { return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, true); } +value ComplexMatrix_div__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; + objectxmatrix *new=xmatrix_clone(b); + if (new && _promote(v, A, &ap)) xmatrix_solve(ap, new); + return morpho_wrapandbind(v, (object *) new); +} + +value ComplexMatrix_divr__xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *A=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; + if (_promote(v, b, &bp)) xmatrix_solve(A, bp); // Promote the matrix that will contain the solution anyway + return morpho_wrapandbind(v, (object *) bp); +} + /** Computes the trace */ value ComplexMatrix_trace(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -456,7 +469,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (XMatrix)", ComplexMa MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_divr__xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, MORPHO_FN_PUREFN), diff --git a/src/xmatrix.c b/src/xmatrix.c index 6412b20c9..ba8e996c6 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -830,10 +830,9 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { value XMatrix_div__float(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; double scale; - morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale); + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; scale = 1.0/scale; if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); diff --git a/src/xmatrix.h b/src/xmatrix.h index e91db6885..0da021836 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -197,6 +197,8 @@ linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, dou linalgError_t xmatrix_addscalar(objectxmatrix *x, double alpha, double beta); linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y); +linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b); + linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); diff --git a/test/arithmetic/complexmatrix_div_complexmatrix.morpho b/test/arithmetic/complexmatrix_div_complexmatrix.morpho new file mode 100644 index 000000000..ac0fbcfa5 --- /dev/null +++ b/test/arithmetic/complexmatrix_div_complexmatrix.morpho @@ -0,0 +1,20 @@ +// Divide ComplexMatrix by ComplexMatrix (solve linear system) +import newlinalg + +var A = ComplexMatrix(2,2) +A[0,0]=1 +A[0,1]=1-im +A[1,0]=1 +A[1,1]=1+1im + +var b = ComplexMatrix(2,1) +b[0,0]=1+1im +b[1,0]=2 + +print b / A +// expect: [ 2 + 1im ] +// expect: [ -0.5 - 0.5im ] + +print b +// expect: [ 1 + 1im ] +// expect: [ 2 + 0im ] \ No newline at end of file diff --git a/test/arithmetic/complexmatrix_div_matrix.morpho b/test/arithmetic/complexmatrix_div_matrix.morpho index 0ca098a5a..f2660d092 100644 --- a/test/arithmetic/complexmatrix_div_matrix.morpho +++ b/test/arithmetic/complexmatrix_div_matrix.morpho @@ -1,16 +1,14 @@ -// Divide ComplexMatrix by ComplexMatrix (solve linear system) +// Divide ComplexMatrix by XMatrix (solve linear system) import newlinalg -var A = ComplexMatrix(2,2) -A[0,0]=1 -A[0,1]=1-im -A[1,0]=1 -A[1,1]=1+1im +var A = XMatrix(((1,2),(-2,1))) -var b = ComplexMatrix(2,1) -b[0,0]=1+1im -b[1,0]=2 +var b = ComplexMatrix((1+im, 2)) print b / A -// expect: [ 2 + 1im ] -// expect: [ -0.5 - 0.5im ] +// expect: [ -0.6 + 0.2im ] +// expect: [ 0.8 + 0.4im ] + +print b +// expect: [ 1 + 1im ] +// expect: [ 2 + 0im ] \ No newline at end of file diff --git a/test/arithmetic/complexmatrix_divr_matrix.morpho b/test/arithmetic/complexmatrix_divr_matrix.morpho new file mode 100644 index 000000000..7c9afe069 --- /dev/null +++ b/test/arithmetic/complexmatrix_divr_matrix.morpho @@ -0,0 +1,10 @@ +// Divide XMatrix by ComplexMatrix (solve linear system) +import newlinalg + +var A = ComplexMatrix(((1,2+im),(2-im,1))) + +var b = XMatrix((1, 2)) + +print b / A +// expect: [ 0.75 + 0.5im ] +// expect: [ 0 - 0.25im ] From a7767aed03f88968e72f62e48ceb37f710fc2f31 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 27 Dec 2025 18:15:24 -0500 Subject: [PATCH 164/473] Add line ending to a test --- test/arithmetic/complexmatrix_div_matrix.morpho | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/arithmetic/complexmatrix_div_matrix.morpho b/test/arithmetic/complexmatrix_div_matrix.morpho index f2660d092..1d3214a74 100644 --- a/test/arithmetic/complexmatrix_div_matrix.morpho +++ b/test/arithmetic/complexmatrix_div_matrix.morpho @@ -11,4 +11,4 @@ print b / A print b // expect: [ 1 + 1im ] -// expect: [ 2 + 0im ] \ No newline at end of file +// expect: [ 2 + 0im ] From 7adbef074b6c8d928402cec35e91b609e38b60cf Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 2 Jan 2026 14:46:52 -0800 Subject: [PATCH 165/473] Windows compatible Show --- modules/graphics.morpho | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/modules/graphics.morpho b/modules/graphics.morpho index c7edd7b58..7033f6534 100644 --- a/modules/graphics.morpho +++ b/modules/graphics.morpho @@ -1,4 +1,9 @@ -/* Graphics */ +/* Graphics + * + * History: + * 1/7/25 Redirect error output to /dev/null to suppress errors on macOS + * 1/2/26 Windows compatibility + */ import constants import meshtools @@ -589,22 +594,28 @@ class Graphics { **************************************** */ class Show { - init(g) { + var isWindows = System.platform()=="windows" + self.uidinit() self.spheres = Dictionary() self.fonts = [] self.colors = Dictionary() - var tempfolder = "/tmp" + var tempfolder = (isWindows ? "C:/Users/timot/AppData/local/Temp" : "/tmp") var fname = self._randomalphanumstring(10) var out = File("${tempfolder}/morpho${fname}.draw", "w") self.write(g, out) out.close() - // 1/7/25 Redirect error output to /dev/null to suppress annoying errors on macOS - system("morphoview -t ${tempfolder}/morpho${fname}.draw > /dev/null 2>&1 &") + + if (isWindows) { + system("powershell -Command \"Start-Process 'morphoview' -ArgumentList '-t', '${tempfolder}/morpho${fname}.draw' -WindowStyle Hidden\"") + } else { + // 1/7/25 Redirect error output to /dev/null + system("morphoview -t ${tempfolder}/morpho${fname}.draw > /dev/null 2>&1 &") + } } /** Generate a random name */ @@ -719,6 +730,8 @@ class Show { var platform = System.platform() if (platform=="macos") { return ["/System/Library/Fonts"] + } else if (platform=="windows") { + return ["C:/Windows/Fonts"] } else return ["/usr/share/fonts","/usr/local/share/fonts"] } @@ -755,6 +768,8 @@ class Show { var platform = System.platform() if (platform=="macos") { return "Helvetica" + } else if (platform=="windows") { + return "arial" // Note case sensitive } else return "FreeSans" } From 47dfb9da55ce170ab7cb10493f851ba4aed94393 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 2 Jan 2026 15:17:29 -0800 Subject: [PATCH 166/473] Use System to extract home folder Also make sure Folder has Object as a parent --- modules/graphics.morpho | 2 +- src/classes/file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/graphics.morpho b/modules/graphics.morpho index 7033f6534..bd8d84876 100644 --- a/modules/graphics.morpho +++ b/modules/graphics.morpho @@ -602,7 +602,7 @@ class Show { self.fonts = [] self.colors = Dictionary() - var tempfolder = (isWindows ? "C:/Users/timot/AppData/local/Temp" : "/tmp") + var tempfolder = (isWindows ? "${System.homefolder()}\\AppData\\local\\Temp" : "/tmp") var fname = self._randomalphanumstring(10) var out = File("${tempfolder}/morpho${fname}.draw", "w") diff --git a/src/classes/file.c b/src/classes/file.c index 552d8cc59..1e9148383 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -458,7 +458,7 @@ void file_initialize(void) { value fileclass=builtin_addclass(FILE_CLASSNAME, MORPHO_GETCLASSDEFINITION(File), objclass); object_setveneerclass(OBJECT_FILE, fileclass); - builtin_addclass(FOLDER_CLASSNAME, MORPHO_GETCLASSDEFINITION(Folder), MORPHO_NIL); + builtin_addclass(FOLDER_CLASSNAME, MORPHO_GETCLASSDEFINITION(Folder), objclass); morpho_defineerror(FILE_OPENFAILED, ERROR_HALT, FILE_OPENFAILED_MSG); morpho_defineerror(FILE_NEEDSFILENAME, ERROR_HALT, FILE_NEEDSFILENAME_MSG); From 70e9aa1a57b5ebfae1e1c618e8c8e98b35a6cefd Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 3 Jan 2026 13:45:11 -0500 Subject: [PATCH 167/473] Outer product --- src/xmatrix.c | 21 +++++++++++++++++++++ src/xmatrix.h | 1 + test/methods/matrix_outer.morpho | 10 ++++++++++ 3 files changed, 32 insertions(+) create mode 100644 test/methods/matrix_outer.morpho diff --git a/src/xmatrix.c b/src/xmatrix.c index ba8e996c6..3cf18ebf1 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -422,6 +422,15 @@ linalgError_t xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { return LINALGERR_OK; } +/** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ +linalgError_t xmatrix_r1update(double alpha, objectxmatrix *a, objectxmatrix *b, objectxmatrix *c) { + MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; + if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dger(CblasColMajor, m, n, alpha, a->elements, 1, b->elements, 1, c->elements, c->nrows); + return LINALGERR_OK; +} + /** Solve the linear system a.x = b using stack allocated memory for temporary */ linalgError_t xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { int pivot[a->nrows]; @@ -1024,6 +1033,17 @@ value XMatrix_inner(vm *v, int nargs, value *args) { return MORPHO_FLOAT(prod); } +/** Outer product */ +value XMatrix_outer(vm *v, int nargs, value *args) { + objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + + objectxmatrix *new=xmatrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); + if (new) LINALG_ERRCHECKVM(xmatrix_r1update(1.0, a, b, new)); + + return morpho_wrapandbind(v, (object *) new); +} + /* --------- * Metadata * --------- */ @@ -1129,6 +1149,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, MORPHO_FN_PU MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "XMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "XMatrix ()", XMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 0da021836..af101c57d 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -124,6 +124,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_INNER_METHOD "inner" #define XMATRIX_INVERSE_METHOD "inverse" #define XMATRIX_NORM_METHOD "norm" +#define XMATRIX_OUTER_METHOD "outer" #define XMATRIX_RESHAPE_METHOD "reshape" #define XMATRIX_ROLL_METHOD "roll" #define XMATRIX_SETCOLUMN_METHOD "setColumn" diff --git a/test/methods/matrix_outer.morpho b/test/methods/matrix_outer.morpho new file mode 100644 index 000000000..0e49615e5 --- /dev/null +++ b/test/methods/matrix_outer.morpho @@ -0,0 +1,10 @@ +// Outer product of two vectors +import newlinalg + +var A = XMatrix((1,2,3)) +var B = XMatrix((4,5)) + +print A.outer(B) +// expect: [ 4 5 ] +// expect: [ 8 10 ] +// expect: [ 12 15 ] From 7a29aea2cacbf81e268017bbc9f166da88f92203 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 3 Jan 2026 20:34:20 -0800 Subject: [PATCH 168/473] Folder_normalizepath implemented --- src/classes/file.c | 13 +++++++ src/classes/file.h | 5 +-- src/support/platform.c | 80 ++++++++++++++++++++++++++++++++++++++---- src/support/platform.h | 4 ++- 4 files changed, 92 insertions(+), 10 deletions(-) diff --git a/src/classes/file.c b/src/classes/file.c index 1e9148383..5823586e4 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -398,6 +398,18 @@ value Folder_isfolder(vm *v, int nargs, value *args) { return ret; } +/** Normalizes a given path, replacing folder separators with the correct ones for the platform */ +value Folder_normalizepath(vm *v, int nargs, value *args) { + size_t n = platform_maxpathsize(); + char buffer[n]; + if (!platform_normalizepath(MORPHO_GETCSTRING(MORPHO_GETARG(args,0)), n, buffer)) return MORPHO_NIL; + + value out=object_stringfromcstring(buffer, strlen(buffer)); + if (MORPHO_ISSTRING(out)) morpho_bindobjects(v, 1, &out); + else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return out; +} + /** Return the contents of a folder */ value Folder_contents(vm *v, int nargs, value *args) { value ret = MORPHO_NIL; @@ -439,6 +451,7 @@ value Folder_contents(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Folder) MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (_)", Folder_isfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_NORMALIZEPATH, "String (String)", Folder_normalizepath, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (_)", Folder_contents, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/file.h b/src/classes/file.h index 36fd42245..eac14a6b1 100644 --- a/src/classes/file.h +++ b/src/classes/file.h @@ -56,8 +56,9 @@ typedef struct { #define FOLDER_CLASSNAME "Folder" -#define FOLDER_ISFOLDER "isfolder" -#define FOLDER_CONTENTS "contents" +#define FOLDER_ISFOLDER "isfolder" +#define FOLDER_CONTENTS "contents" +#define FOLDER_NORMALIZEPATH "normalizePath" /* ------------------------------------------------------- * File error messages diff --git a/src/support/platform.c b/src/support/platform.c index 78ea46530..229f320fc 100644 --- a/src/support/platform.c +++ b/src/support/platform.c @@ -111,7 +111,16 @@ bool MCEq(MorphoComplex a, MorphoComplex b) { * File system functions * ********************************************************************** */ -/* Tells if an object at path corresponds to a directory */ +/** Returns the maximum size of a file path */ +size_t platform_maxpathsize(void) { +#ifdef _WIN32 + return (size_t) MAX_PATH*4; +#else + return pathconf("/", _PC_PATH_MAX); +#endif +} + +/** Tests if an object at path corresponds to a directory */ bool platform_isdirectory(const char *path) { #ifdef _WIN32 DWORD attributes = GetFileAttributes(path); @@ -125,15 +134,72 @@ bool platform_isdirectory(const char *path) { #endif } -/** Returns the maximum size of a file path */ -size_t platform_maxpathsize(void) { -#ifdef _WIN32 - return (size_t) MAX_PATH; -#else - return pathconf("/", _PC_PATH_MAX); +/** Normalizes a filepath for the current platform */ +bool platform_normalizepath(const char *path, size_t n, char *out) { + for (size_t i = 0; i < n; i++) { +#ifdef _WIN32 + if (path[i] == '/') out[i] = '\\'; +#else + if (path[i] == '\\') out[i] = '/'; +#endif + else out[i]=path[i]; + + if (path[i]=='\0') return true; + } + return false; +} + +/** Helper function to make a single directory */ +static bool _makedir(const char *path) { +#ifdef _WIN32 + return CreateDirectoryA(path, NULL) || + GetLastError() == ERROR_ALREADY_EXISTS; +#else + return mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) == 0 || + errno == EEXIST; #endif } +/** Creates a directory, optionally recursively creating folders */ +bool platform_makedirectory(const char *path, bool recurse) { + size_t n=platform_maxpathsize(); + char buffer[n]; + if (!platform_normalizepath(path, n, buffer)) return false; + + if (!recurse) return _makedir(buffer); + + size_t i=0, len=strlen(buffer); + if (len==0) return false; + + // Strip trailing separators + while (len > 1 && (buffer[len-1] == '\\' || buffer[len-1] == '/')) buffer[--len] = '\0'; + +#ifdef _WIN32 + if (len >= 3 && buffer[1] == ':' && buffer[2] == '\\') i = 3; // Skip drive letter + else if (len >= 5 && buffer[0] == '\\' && buffer[1] == '\\') { // Skip UNC prefix: \\server\share\... + int nSlashes = 0; + for (i = 2; i < len; i++) { + if (buffer[i] == '\\' && ++nSlashes == 2) { + i++; + break; + } + } + } +#endif + + // Walk the path and create intermediate directories + for (; i < len; i++) { + if (buffer[i] == '\\' || buffer[i] == '/') { + char swp = buffer[i]; + buffer[i] = '\0'; + if (!_makedir(buffer)) return false; + buffer[i] = swp; + } + } + + return _makedir(buffer); +} + /** Sets the current working directory to path */ bool platform_setcurrentdirectory(const char *path) { #ifdef _WIN32 diff --git a/src/support/platform.h b/src/support/platform.h index b1fc56682..2d07d90c9 100644 --- a/src/support/platform.h +++ b/src/support/platform.h @@ -75,10 +75,12 @@ bool MCEq(MorphoComplex a, MorphoComplex b); * ------------------------------------------------------- */ size_t platform_maxpathsize(void); +bool platform_isdirectory(const char *path); +bool platform_normalizepath(const char *path, size_t n, char *out); +bool platform_makedirectory(const char *path, bool recurse); bool platform_setcurrentdirectory(const char *path); bool platform_getcurrentdirectory(char *buffer, size_t size); bool platform_gethomedirectory(char *buffer, size_t size); -bool platform_isdirectory(const char *path); typedef struct { #ifdef _WIN32 From 204d0ea214436bfe491ff496b8047d0969ed0073 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 3 Jan 2026 21:48:20 -0800 Subject: [PATCH 169/473] Folder.create() and createRecursive() implemented --- src/classes/file.c | 23 +++++++++++++++++++++-- src/classes/file.h | 8 +++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/classes/file.c b/src/classes/file.c index 5823586e4..d21fce8e1 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -414,7 +414,7 @@ value Folder_normalizepath(vm *v, int nargs, value *args) { value Folder_contents(vm *v, int nargs, value *args) { value ret = MORPHO_NIL; if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - varray_char name; + varray_char name; varray_charinit(&name); file_relativepath(MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &name); @@ -449,10 +449,28 @@ value Folder_contents(vm *v, int nargs, value *args) { return ret; } +/** Create a new folder; regular and recursive versions */ +static value _create(vm *v, int nargs, value *args, bool recurse) { + const char *path = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); + if (!platform_makedirectory(path, recurse)) morpho_runtimeerror(v, FOLDER_CREATEFAILED, path); + return MORPHO_NIL; +} + +value Folder_create(vm *v, int nargs, value *args) { + return _create(v, nargs, args, false); +} + +value Folder_createrecursive(vm *v, int nargs, value *args) { + return _create(v, nargs, args, true); +} + MORPHO_BEGINCLASS(Folder) MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (_)", Folder_isfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER_DEPRECATED, "Bool (_)", Folder_isfolder, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(FOLDER_NORMALIZEPATH, "String (String)", Folder_normalizepath, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (_)", Folder_contents, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (_)", Folder_contents, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_CREATE, "(String)", Folder_create, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_CREATERECURSIVE, "(String)", Folder_createrecursive, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** @@ -482,6 +500,7 @@ void file_initialize(void) { morpho_defineerror(FOLDER_EXPCTPATH, ERROR_HALT, FOLDER_EXPCTPATH_MSG); morpho_defineerror(FOLDER_NTFLDR, ERROR_HALT, FOLDER_NTFLDR_MSG); + morpho_defineerror(FOLDER_CREATEFAILED, ERROR_HALT, FOLDER_CREATEFAILED_MSG); morpho_addfinalizefn(file_finalize); } diff --git a/src/classes/file.h b/src/classes/file.h index eac14a6b1..21a319869 100644 --- a/src/classes/file.h +++ b/src/classes/file.h @@ -56,9 +56,12 @@ typedef struct { #define FOLDER_CLASSNAME "Folder" -#define FOLDER_ISFOLDER "isfolder" +#define FOLDER_ISFOLDER_DEPRECATED "isfolder" +#define FOLDER_ISFOLDER "isFolder" #define FOLDER_CONTENTS "contents" #define FOLDER_NORMALIZEPATH "normalizePath" +#define FOLDER_CREATE "create" +#define FOLDER_CREATERECURSIVE "createRecursive" /* ------------------------------------------------------- * File error messages @@ -88,6 +91,9 @@ typedef struct { #define FOLDER_NTFLDR "NtFldr" #define FOLDER_NTFLDR_MSG "Not a folder." +#define FOLDER_CREATEFAILED "FldrCrtFld" +#define FOLDER_CREATEFAILED_MSG "Couldn't create folder '%s'." + /* ------------------------------------------------------- * File interface * ------------------------------------------------------- */ From e2520a761b35f0b59577837d8da4c402de2d6a70 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 4 Jan 2026 18:02:06 -0800 Subject: [PATCH 170/473] Delete unused variable --- src/core/compile.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/compile.c b/src/core/compile.c index f1499f5a5..3c5ef4564 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -865,7 +865,6 @@ bool compiler_regcheckandsetcurrenttype(compiler *c, syntaxtreenode *node, regis /** Performs a type check on register reg against a given type. Codeinfo is updated if a typecheck instruction needs to be generated */ bool compiler_regtypecheck(compiler *c, syntaxtreenode *node, registerindx reg, value type, value symbol, codeinfo *info) { bool success=false; - functionstate *f = compiler_currentfunctionstate(c); value rtype=MORPHO_NIL; // Get the current type held in register reg compiler_regcurrenttype(c, reg, &rtype); From 5ceb32adca24a38ca5d2c938d512e28d135b7afc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 5 Jan 2026 11:12:00 -0500 Subject: [PATCH 171/473] complexmatrix_r1update --- src/xcomplexmatrix.c | 27 +++++++++++++++++++++++-- src/xmatrix.c | 6 ++---- test/methods/complexmatrix_outer.morpho | 10 +++++++++ 3 files changed, 37 insertions(+), 6 deletions(-) create mode 100644 test/methods/complexmatrix_outer.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 8481e4ef3..1bc1603bf 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -191,6 +191,17 @@ linalgError_t complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b return LINALGERR_OK; } +/** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ +linalgError_t complexmatrix_r1update(MorphoComplex alpha, objectcomplexmatrix *a, objectcomplexmatrix *b, objectcomplexmatrix *c) { + MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; + if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_zgeru(CblasColMajor, m, n, (__LAPACK_double_complex *) &alpha, (__LAPACK_double_complex *) a->elements, 1, + (__LAPACK_double_complex *) b->elements, 1, + (__LAPACK_double_complex *) c->elements, c->nrows); + return LINALGERR_OK; +} + /** Calculate the trace of a matrix */ linalgError_t complexmatrix_trace(objectcomplexmatrix *a, MorphoComplex *out) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; @@ -424,8 +435,8 @@ value ComplexMatrix_conjTranspose(vm *v, int nargs, value *args) { /** Frobenius inner product */ value ComplexMatrix_inner(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); MorphoComplex prod=MCBuild(0.0, 0.0); value out = MORPHO_NIL; @@ -437,6 +448,17 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { return out; } +/** Outer product */ +value ComplexMatrix_outer(vm *v, int nargs, value *args) { + objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + + objectcomplexmatrix *new=complexmatrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); + if (new) LINALG_ERRCHECKVM(complexmatrix_r1update(MCBuild(1.0,0.0), a, b, new)); + + return morpho_wrapandbind(v, (object *) new); +} + MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), @@ -484,6 +506,7 @@ MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "XMatrix ()", ComplexMatrix_imag, B MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 3cf18ebf1..c38d614d3 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -105,7 +105,7 @@ char xmatrix_normtolapack(xmatrix_norm_t norm) { /** Evaluate norms */ static double _normfn(objectxmatrix *a, xmatrix_norm_t nrm) { char cnrm = xmatrix_normtolapack(nrm); - int nrows=a->nrows, ncols=a->ncols, info; + int nrows=a->nrows, ncols=a->ncols; #ifdef MORPHO_LINALG_USE_LAPACKE return LAPACKE_dlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); @@ -679,7 +679,6 @@ value XMatrix_assign(vm *v, int nargs, value *args) { /** Clones a matrix */ value XMatrix_clone(vm *v, int nargs, value *args) { - value out=MORPHO_NIL; objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *new=xmatrix_clone(a); return morpho_wrapandbind(v, (object *) new); @@ -814,7 +813,6 @@ value XMatrix_subr__x(vm *v, int nargs, value *args) { value XMatrix_mul__float(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; double scale; if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; @@ -1149,7 +1147,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, MORPHO_FN_PU MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "XMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "XMatrix ()", XMatrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "XMatrix (XMatrix)", XMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), diff --git a/test/methods/complexmatrix_outer.morpho b/test/methods/complexmatrix_outer.morpho new file mode 100644 index 000000000..2999f4e36 --- /dev/null +++ b/test/methods/complexmatrix_outer.morpho @@ -0,0 +1,10 @@ +// Outer product of two vectors +import newlinalg + +var A = ComplexMatrix((1+1im,2-2im,3+3im)) +var B = ComplexMatrix((4+4im,5-5im)) + +print A.outer(B) +// expect: [ 0 + 8im 10 + 0im ] +// expect: [ 16 + 0im 0 - 20im ] +// expect: [ 0 + 24im 30 + 0im ] From ba438324bdbd982b651dee7c53d3310af08faa99 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 5 Jan 2026 18:56:45 -0500 Subject: [PATCH 172/473] Matrix slices --- CMakeLists.txt | 1 + src/xcomplexmatrix.c | 1 + src/xmatrix.c | 47 +++++++++++++++++++ src/xmatrix.h | 5 +- test/index/complexmatrix_slice.morpho | 25 ++++++++++ test/index/matrix_slice.morpho | 25 ++++++++++ test/index/matrix_slice_bounds.morpho | 7 +++ test/index/matrix_slice_infinite_range.morpho | 7 +++ 8 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 test/index/complexmatrix_slice.morpho create mode 100644 test/index/matrix_slice.morpho create mode 100644 test/index/matrix_slice_bounds.morpho create mode 100644 test/index/matrix_slice_infinite_range.morpho diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b3a88019..65d6d5c57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ find_file(MORPHO_HEADER /usr/local/opt/morpho /opt/homebrew/opt/morpho /usr/local/include/morpho + "C:\\Program Files\\Morpho\\include\\" ) # Identify folder that morpho.h is located in from MORPHO_HEADER and store in MORPHO_INCLUDE diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 1bc1603bf..237202f9b 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -466,6 +466,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", XMatrix_index__x_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index c38d614d3..36ae000f4 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -701,6 +701,52 @@ value XMatrix_index__int_int(vm *v, int nargs, value *args) { return out; } +static bool _slice_count(value in, MatrixIdx_t *count) { + if (morpho_isnumber(in)) { *count=1; return true; } + else if (MORPHO_ISRANGE(in)) { *count = range_count(MORPHO_GETRANGE(in)); return true; } + return false; +} + +static bool _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { + value val=in; + if (MORPHO_ISRANGE(in)) val=range_iterate(MORPHO_GETRANGE(in), i); + + if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return true; } + else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return true; } + return false; +} + +value XMatrix_index__x_x(vm *v, int nargs, value *args) { + objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + + value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); + MatrixIdx_t icnt=0, jcnt=0; // Size of the new matrix + + if (!_slice_count(iv, &icnt) || icnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + if (!_slice_count(jv, &jcnt) || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + + objectxmatrix *new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); + + double *src, *dest; + if (new) for (MatrixIdx_t j=0; jnvals); + } + } + + return morpho_wrapandbind(v, (object *) new); + +XMatrix_index__x_x_cleanup: + object_free((object *) new); + return MORPHO_NIL; +} + /* --------- * setindex() * --------- */ @@ -1121,6 +1167,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILT MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_enumerate, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "XMatrix (_,_)", XMatrix_index__x_x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index af101c57d..a75764eb3 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -18,8 +18,8 @@ extern objecttype objectxmatrixtype; extern objecttypedefn objectxmatrixdefn; -typedef int MatrixIdx_t; -typedef size_t MatrixCount_t; +typedef int MatrixIdx_t; // Type used for matrix indices +typedef size_t MatrixCount_t; // Type used to count total number of elements /** Matrices are a purely numerical collection type oriented toward linear algebra. Elements are stored in column-major format, i.e. @@ -146,6 +146,7 @@ IMPLEMENTATIONFN(XMatrix_clone); IMPLEMENTATIONFN(XMatrix_index__int); IMPLEMENTATIONFN(XMatrix_index__int_int); +IMPLEMENTATIONFN(XMatrix_index__x_x); IMPLEMENTATIONFN(XMatrix_setindex__int_x); IMPLEMENTATIONFN(XMatrix_setindex__int_int_x); diff --git a/test/index/complexmatrix_slice.morpho b/test/index/complexmatrix_slice.morpho new file mode 100644 index 000000000..1cd98c294 --- /dev/null +++ b/test/index/complexmatrix_slice.morpho @@ -0,0 +1,25 @@ +// Slice a ComplexMatrix +import newlinalg + +var A = ComplexMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16)))*(1+1im) + +print A[0..1, 0..1] +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 5 + 5im 6 + 6im ] + +print A[0..2, 0] +// expect: [ 1 + 1im ] +// expect: [ 5 + 5im ] +// expect: [ 9 + 9im ] + +print A[2..0:-1, 0] +// expect: [ 9 + 9im ] +// expect: [ 5 + 5im ] +// expect: [ 1 + 1im ] + +print A[0..3:2, 0..3:2] +// expect: [ 1 + 1im 3 + 3im ] +// expect: [ 9 + 9im 11 + 11im ] + +print A[0..1:2, "Foo"] +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/index/matrix_slice.morpho b/test/index/matrix_slice.morpho new file mode 100644 index 000000000..e3afff95d --- /dev/null +++ b/test/index/matrix_slice.morpho @@ -0,0 +1,25 @@ +// Slice a Matrix +import newlinalg + +var A = XMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) + +print A[0..1, 0..1] +// expect: [ 1 2 ] +// expect: [ 5 6 ] + +print A[0..2, 0] +// expect: [ 1 ] +// expect: [ 5 ] +// expect: [ 9 ] + +print A[2..0:-1, 0] +// expect: [ 9 ] +// expect: [ 5 ] +// expect: [ 1 ] + +print A[0..3:2, 0..3:2] +// expect: [ 1 3 ] +// expect: [ 9 11 ] + +print A[0..1:2, "Foo"] +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/index/matrix_slice_bounds.morpho b/test/index/matrix_slice_bounds.morpho new file mode 100644 index 000000000..c56760561 --- /dev/null +++ b/test/index/matrix_slice_bounds.morpho @@ -0,0 +1,7 @@ +// Slice a Matrix out of bounds +import newlinalg + +var A = XMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) + +print A[0..5, 0..2] +// expect error 'LnAlgMtrxIndxBnds' diff --git a/test/index/matrix_slice_infinite_range.morpho b/test/index/matrix_slice_infinite_range.morpho new file mode 100644 index 000000000..b8724575e --- /dev/null +++ b/test/index/matrix_slice_infinite_range.morpho @@ -0,0 +1,7 @@ +// Slice a Matrix with a range that doesn't halt +import newlinalg + +var A = XMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) + +print A[0..3:-1, 0] +// expect error 'LnAlgMtrxInvldArg' From 8b7e722ee063fbfa23a9d6c95d6983d1fa7ebed0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 5 Jan 2026 19:17:36 -0500 Subject: [PATCH 173/473] Improvements to slice --- src/xmatrix.c | 35 +++++++++++++++------------ test/index/complexmatrix_slice.morpho | 2 +- test/index/matrix_slice.morpho | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index 36ae000f4..b35f0af8d 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -701,39 +701,42 @@ value XMatrix_index__int_int(vm *v, int nargs, value *args) { return out; } -static bool _slice_count(value in, MatrixIdx_t *count) { - if (morpho_isnumber(in)) { *count=1; return true; } - else if (MORPHO_ISRANGE(in)) { *count = range_count(MORPHO_GETRANGE(in)); return true; } - return false; +static linalgError_t _slice_count(value in, MatrixIdx_t *count) { + if (morpho_isnumber(in)) { *count=1; return LINALGERR_OK; } + else if (MORPHO_ISRANGE(in)) { *count = range_count(MORPHO_GETRANGE(in)); return LINALGERR_OK; } + return LINALGERR_NON_NUMERICAL; } -static bool _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { +static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { value val=in; if (MORPHO_ISRANGE(in)) val=range_iterate(MORPHO_GETRANGE(in), i); - if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return true; } - else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return true; } - return false; + if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return LINALGERR_OK; } + else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return LINALGERR_OK; } + return LINALGERR_OP_FAILED; } value XMatrix_index__x_x(vm *v, int nargs, value *args) { - objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)), *new=NULL; value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); MatrixIdx_t icnt=0, jcnt=0; // Size of the new matrix - if (!_slice_count(iv, &icnt) || icnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - if (!_slice_count(jv, &jcnt) || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + LINALG_ERRCHECKVMGOTO(_slice_count(iv, &icnt), XMatrix_index__x_x_cleanup); + LINALG_ERRCHECKVMGOTO(_slice_count(jv, &jcnt), XMatrix_index__x_x_cleanup); + + if (icnt<1 || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - objectxmatrix *new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); + new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } double *src, *dest; - if (new) for (MatrixIdx_t j=0; jnvals); @@ -743,7 +746,7 @@ value XMatrix_index__x_x(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); XMatrix_index__x_x_cleanup: - object_free((object *) new); + if (new) object_free((object *) new); return MORPHO_NIL; } diff --git a/test/index/complexmatrix_slice.morpho b/test/index/complexmatrix_slice.morpho index 1cd98c294..0690a8e1f 100644 --- a/test/index/complexmatrix_slice.morpho +++ b/test/index/complexmatrix_slice.morpho @@ -22,4 +22,4 @@ print A[0..3:2, 0..3:2] // expect: [ 9 + 9im 11 + 11im ] print A[0..1:2, "Foo"] -// expect error 'LnAlgMtrxInvldArg' +// expect error 'LnAlgMtrxNnNmrclArg' diff --git a/test/index/matrix_slice.morpho b/test/index/matrix_slice.morpho index e3afff95d..0a8387b4e 100644 --- a/test/index/matrix_slice.morpho +++ b/test/index/matrix_slice.morpho @@ -22,4 +22,4 @@ print A[0..3:2, 0..3:2] // expect: [ 9 11 ] print A[0..1:2, "Foo"] -// expect error 'LnAlgMtrxInvldArg' +// expect error 'LnAlgMtrxNnNmrclArg' From b07203e33cc3b8699b89b29f8f32b9b5df5bf4d4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 5 Jan 2026 20:58:55 -0500 Subject: [PATCH 174/473] Matrix_setindex uses slices --- src/newlinalg.h | 3 ++ src/xmatrix.c | 34 ++++++++++++++++++--- test/index/matrix_setslice.morpho | 49 +++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 test/index/matrix_setslice.morpho diff --git a/src/newlinalg.h b/src/newlinalg.h index 415ad80de..80e754bd2 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -76,6 +76,9 @@ void linalg_raiseerror(vm *v, linalgError_t err); /** As for LINALG_ERRCHECKVM but additionally jumps to a given label */ #define LINALG_ERRCHECKVMGOTO(f, label) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto label; }} +/** As for LINALG_ERRCHECKVM but additionally returnsl */ +#define LINALG_ERRCHECKVMRETURN(f, ret) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); return ret; }} + /* ------------------------------------------------------- * Include the rest of the library * ------------------------------------------------------- */ diff --git a/src/xmatrix.c b/src/xmatrix.c index b35f0af8d..22f625bee 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -720,11 +720,10 @@ value XMatrix_index__x_x(vm *v, int nargs, value *args) { objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)), *new=NULL; value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); - MatrixIdx_t icnt=0, jcnt=0; // Size of the new matrix - - LINALG_ERRCHECKVMGOTO(_slice_count(iv, &icnt), XMatrix_index__x_x_cleanup); - LINALG_ERRCHECKVMGOTO(_slice_count(jv, &jcnt), XMatrix_index__x_x_cleanup); + MatrixIdx_t icnt=0, jcnt=0; // Size of the new matrix + LINALG_ERRCHECKVMRETURN(_slice_count(iv, &icnt), MORPHO_NIL); + LINALG_ERRCHECKVMRETURN(_slice_count(jv, &jcnt), MORPHO_NIL); if (icnt<1 || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); @@ -773,6 +772,32 @@ value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { return MORPHO_NIL; } +value XMatrix_setindex__x_x_xmatrix(vm *v, int nargs, value *args) { + objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectxmatrix *msrc = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 2)); + value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); + + MatrixIdx_t icnt=0, jcnt=0; + LINALG_ERRCHECKVMRETURN(_slice_count(iv, &icnt), MORPHO_NIL); + LINALG_ERRCHECKVMRETURN(_slice_count(jv, &jcnt), MORPHO_NIL); + if (icnt<1 || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + + double *src, *dest; + for (MatrixIdx_t j=0; jnvals); + } + } + + return MORPHO_NIL; +} + /* --------- * column * --------- */ @@ -1173,6 +1198,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_inde MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "XMatrix (_,_)", XMatrix_index__x_x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,XMatrix)", XMatrix_setindex__x_x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), diff --git a/test/index/matrix_setslice.morpho b/test/index/matrix_setslice.morpho new file mode 100644 index 000000000..093a84466 --- /dev/null +++ b/test/index/matrix_setslice.morpho @@ -0,0 +1,49 @@ +// Copy elements of a Matrix using slices +import newlinalg + +var A = XMatrix(((1,2),(3,4))) + +var B = XMatrix(4,4) + +B[0..1, 0..1] = A +print B +// expect: [ 1 2 0 0 ] +// expect: [ 3 4 0 0 ] +// expect: [ 0 0 0 0 ] +// expect: [ 0 0 0 0 ] + +var C = XMatrix(4,4) +C[0..2:2, 0..2:2] = A +print C +// expect: [ 1 0 2 0 ] +// expect: [ 0 0 0 0 ] +// expect: [ 3 0 4 0 ] +// expect: [ 0 0 0 0 ] + +var D = XMatrix(4,4) +D[1..2, 1..2] = A +print D +// expect: [ 0 0 0 0 ] +// expect: [ 0 1 2 0 ] +// expect: [ 0 3 4 0 ] +// expect: [ 0 0 0 0 ] + +var E = XMatrix(4,4) +E[1..3:2, 1..3:2] = A +print E +// expect: [ 0 0 0 0 ] +// expect: [ 0 1 0 2 ] +// expect: [ 0 0 0 0 ] +// expect: [ 0 3 0 4 ] + +var F = XMatrix(4,4) +F[0..1, 0] = A[0..1, 1] +print F +// expect: [ 2 0 0 0 ] +// expect: [ 4 0 0 0 ] +// expect: [ 0 0 0 0 ] +// expect: [ 0 0 0 0 ] + +B[0..5, 0..5] = A +print B +// expect error 'LnAlgMtrxIndxBnds' \ No newline at end of file From f9b2027cc68b7be311dceaaa2c4c3d5325260ce0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 5 Jan 2026 21:18:04 -0500 Subject: [PATCH 175/473] Merge validation --- src/xmatrix.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index 22f625bee..241fc6997 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -716,15 +716,20 @@ static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { return LINALGERR_OP_FAILED; } +static bool _slice_validate(vm *v, value iv, value jv, MatrixIdx_t *icnt, MatrixIdx_t *jcnt) { + LINALG_ERRCHECKVMRETURN(_slice_count(iv, icnt), false); + LINALG_ERRCHECKVMRETURN(_slice_count(jv, jcnt), false); + if (*icnt<1 || *jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return false; } + return true; +} + value XMatrix_index__x_x(vm *v, int nargs, value *args) { objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)), *new=NULL; value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); - MatrixIdx_t icnt=0, jcnt=0; // Size of the new matrix - LINALG_ERRCHECKVMRETURN(_slice_count(iv, &icnt), MORPHO_NIL); - LINALG_ERRCHECKVMRETURN(_slice_count(jv, &jcnt), MORPHO_NIL); - if (icnt<1 || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix + if (!_slice_validate(v, iv, jv, &icnt, &jcnt)) return MORPHO_NIL; new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } @@ -778,9 +783,7 @@ value XMatrix_setindex__x_x_xmatrix(vm *v, int nargs, value *args) { value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); MatrixIdx_t icnt=0, jcnt=0; - LINALG_ERRCHECKVMRETURN(_slice_count(iv, &icnt), MORPHO_NIL); - LINALG_ERRCHECKVMRETURN(_slice_count(jv, &jcnt), MORPHO_NIL); - if (icnt<1 || jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + if (!_slice_validate(v, iv, jv, &icnt, &jcnt)) return MORPHO_NIL; double *src, *dest; for (MatrixIdx_t j=0; j Date: Tue, 6 Jan 2026 00:09:20 -0500 Subject: [PATCH 176/473] Change interface to _slice_validate --- src/newlinalg.c | 1 + src/newlinalg.h | 6 +++++- src/xmatrix.c | 14 +++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/newlinalg.c b/src/newlinalg.c index 4dbdfabc6..4caadffb6 100644 --- a/src/newlinalg.c +++ b/src/newlinalg.c @@ -24,6 +24,7 @@ void linalg_raiseerror(vm *v, linalgError_t err) { case LINALGERR_OP_FAILED: morpho_runtimeerror(v, LINALG_OPFAILED); break; case LINALGERR_NOT_SUPPORTED: morpho_runtimeerror(v, LINALG_NOTSUPPORTED); break; case LINALGERR_NON_NUMERICAL: morpho_runtimeerror(v, LINALG_NNNMRCL_ARG); break; + case LINALGERR_INVLD_ARG: morpho_runtimeerror(v, LINALG_INVLDARGS); break; case LINALGERR_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; } } diff --git a/src/newlinalg.h b/src/newlinalg.h index 80e754bd2..70d3f2372 100644 --- a/src/newlinalg.h +++ b/src/newlinalg.h @@ -25,6 +25,7 @@ typedef enum { LINALGERR_OP_FAILED, // Matrix operation failed LINALGERR_NOT_SUPPORTED, // Operation not supported for this matrix type LINALGERR_NON_NUMERICAL, // Non numerical args supplied + LINALGERR_INVLD_ARG, // Invalid argument supplied LINALGERR_ALLOC // Memory allocation failed } linalgError_t; @@ -68,7 +69,7 @@ typedef enum { void linalg_raiseerror(vm *v, linalgError_t err); -/** Macro to simplify error checking: +/** Macros to simplify error checking: - evaluates expression f that returns linalgError_t; - if an error occurred, raises the corresponding error in a vm called v */ #define LINALG_ERRCHECKVM(f) { linalgError_t err = f; if (err!=LINALGERR_OK) linalg_raiseerror(v, err); } @@ -79,6 +80,9 @@ void linalg_raiseerror(vm *v, linalgError_t err); /** As for LINALG_ERRCHECKVM but additionally returnsl */ #define LINALG_ERRCHECKVMRETURN(f, ret) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); return ret; }} +/** Similar to the above, except returns the error rather than raising it */ +#define LINALG_ERRCHECKRETURN(f) { linalgError_t err = f; if (err!=LINALGERR_OK) return err; } + /* ------------------------------------------------------- * Include the rest of the library * ------------------------------------------------------- */ diff --git a/src/xmatrix.c b/src/xmatrix.c index 241fc6997..b3bf1e4aa 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -716,11 +716,11 @@ static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { return LINALGERR_OP_FAILED; } -static bool _slice_validate(vm *v, value iv, value jv, MatrixIdx_t *icnt, MatrixIdx_t *jcnt) { - LINALG_ERRCHECKVMRETURN(_slice_count(iv, icnt), false); - LINALG_ERRCHECKVMRETURN(_slice_count(jv, jcnt), false); - if (*icnt<1 || *jcnt<1) { morpho_runtimeerror(v, LINALG_INVLDARGS); return false; } - return true; +static linalgError_t _slice_validate(value iv, value jv, MatrixIdx_t *icnt, MatrixIdx_t *jcnt) { + LINALG_ERRCHECKRETURN(_slice_count(iv, icnt)); + LINALG_ERRCHECKRETURN(_slice_count(jv, jcnt)); + if (*icnt<1 || *jcnt<1) return LINALGERR_INVLD_ARG; + return LINALGERR_OK; } value XMatrix_index__x_x(vm *v, int nargs, value *args) { @@ -729,7 +729,7 @@ value XMatrix_index__x_x(vm *v, int nargs, value *args) { value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix - if (!_slice_validate(v, iv, jv, &icnt, &jcnt)) return MORPHO_NIL; + LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } @@ -783,7 +783,7 @@ value XMatrix_setindex__x_x_xmatrix(vm *v, int nargs, value *args) { value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); MatrixIdx_t icnt=0, jcnt=0; - if (!_slice_validate(v, iv, jv, &icnt, &jcnt)) return MORPHO_NIL; + LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); double *src, *dest; for (MatrixIdx_t j=0; j Date: Tue, 6 Jan 2026 00:22:03 -0500 Subject: [PATCH 177/473] Consolidate copy loop into _slice_copy --- src/xmatrix.c | 55 ++++++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 31 deletions(-) diff --git a/src/xmatrix.c b/src/xmatrix.c index b3bf1e4aa..7a9814e23 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -723,10 +723,27 @@ static linalgError_t _slice_validate(value iv, value jv, MatrixIdx_t *icnt, Matr return LINALGERR_OK; } +static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx_t jcnt, objectxmatrix *a, objectxmatrix *b, bool swap) { + double *ael, *bel; + for (MatrixIdx_t j=0; jnvals); + else memcpy(bel, ael, sizeof(double)*a->nvals); + } + } + return LINALGERR_OK; +} + value XMatrix_index__x_x(vm *v, int nargs, value *args) { objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)), *new=NULL; - value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); + value out=MORPHO_NIL; MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); @@ -734,24 +751,11 @@ value XMatrix_index__x_x(vm *v, int nargs, value *args) { new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - double *src, *dest; - for (MatrixIdx_t j=0; jnvals); - } - } - - return morpho_wrapandbind(v, (object *) new); + linalgError_t err=_slice_copy(iv, jv, icnt, jcnt, m, new, false); + if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); object_free((object *) new); } + else out = morpho_wrapandbind(v, (object *) new); -XMatrix_index__x_x_cleanup: - if (new) object_free((object *) new); - return MORPHO_NIL; + return out; } /* --------- @@ -785,19 +789,8 @@ value XMatrix_setindex__x_x_xmatrix(vm *v, int nargs, value *args) { MatrixIdx_t icnt=0, jcnt=0; LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); - double *src, *dest; - for (MatrixIdx_t j=0; jnvals); - } - } - + LINALG_ERRCHECKVM(_slice_copy(iv, jv, icnt, jcnt, m, msrc, true)); + return MORPHO_NIL; } From ca0cb9b21a7a916c118420f28f1ffafbf67e3d15 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 6 Jan 2026 00:28:31 -0500 Subject: [PATCH 178/473] complexmatrix_setslice --- src/xcomplexmatrix.c | 1 + src/xmatrix.c | 2 +- src/xmatrix.h | 1 + test/index/complexmatrix_setslice.morpho | 50 ++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 test/index/complexmatrix_setslice.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 237202f9b..453a7b026 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -469,6 +469,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_in MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", XMatrix_index__x_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", XMatrix_setindex__x_x_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 7a9814e23..3d9b1cbf5 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -734,7 +734,7 @@ static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx LINALG_ERRCHECKRETURN(xmatrix_getelementptr(a, ix, jx, &ael)); LINALG_ERRCHECKRETURN(xmatrix_getelementptr(b, i, j, &bel)); if (swap) memcpy(ael, bel, sizeof(double)*a->nvals); - else memcpy(bel, ael, sizeof(double)*a->nvals); + else memcpy(bel, ael, sizeof(double)*b->nvals); } } return LINALGERR_OK; diff --git a/src/xmatrix.h b/src/xmatrix.h index a75764eb3..78dd312e4 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -149,6 +149,7 @@ IMPLEMENTATIONFN(XMatrix_index__int_int); IMPLEMENTATIONFN(XMatrix_index__x_x); IMPLEMENTATIONFN(XMatrix_setindex__int_x); IMPLEMENTATIONFN(XMatrix_setindex__int_int_x); +IMPLEMENTATIONFN(XMatrix_setindex__x_x_xmatrix); IMPLEMENTATIONFN(XMatrix_getcolumn__int); IMPLEMENTATIONFN(XMatrix_setcolumn__int_xmatrix); diff --git a/test/index/complexmatrix_setslice.morpho b/test/index/complexmatrix_setslice.morpho new file mode 100644 index 000000000..57f187eaf --- /dev/null +++ b/test/index/complexmatrix_setslice.morpho @@ -0,0 +1,50 @@ +// Copy elements of a ComplexMatrix using slices +import newlinalg + +var A = ComplexMatrix(((1+1im,2+2im),(3+3im,4+4im))) + +var B = ComplexMatrix(4,4) + +B[0..1, 0..1] = A +print B +// expect: [ 1 + 1im 2 + 2im 0 + 0im 0 + 0im ] +// expect: [ 3 + 3im 4 + 4im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +var C = ComplexMatrix(4,4) +C[0..2:2, 0..2:2] = A +print C +// expect: [ 1 + 1im 0 + 0im 2 + 2im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 3 + 3im 0 + 0im 4 + 4im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +var D = ComplexMatrix(4,4) +D[1..2, 1..2] = A +print D +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 1 + 1im 2 + 2im 0 + 0im ] +// expect: [ 0 + 0im 3 + 3im 4 + 4im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +var E = ComplexMatrix(4,4) +E[1..3:2, 1..3:2] = A +print E +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 1 + 1im 0 + 0im 2 + 2im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 3 + 3im 0 + 0im 4 + 4im ] + +var F = ComplexMatrix(4,4) +F[0..1, 0] = A[0..1, 1] +print F +// expect: [ 2 + 2im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 4 + 4im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +B[0..5, 0..5] = A +print B +// expect error 'LnAlgMtrxIndxBnds' + From 444efe95caf0fa41ade486fb53336bcbf485a412 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 7 Jan 2026 10:24:37 -0500 Subject: [PATCH 179/473] Singular value decomposition for real matrices --- src/xmatrix.c | 122 +++++++++++++++++++++++++++++++++ src/xmatrix.h | 4 ++ test/methods/matrix_svd.morpho | 53 ++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 test/methods/matrix_svd.morpho diff --git a/src/xmatrix.c b/src/xmatrix.c index 3d9b1cbf5..c461441b7 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -1004,6 +1004,10 @@ value XMatrix_inverse(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/* ---------------- + * Eigensystem + * ---------------- */ + static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { value ev[n]; for (int i=0; inrows, n=a->ncols; + int minmn = (m < n) ? m : n; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, + (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U + (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT + m, n, + a->elements, m, // input matrix A (overwritten) + s, // singular values (min(m,n)) + (u ? u->elements : NULL), m, // U matrix (m×m) + (vt ? vt->elements : NULL), n // VT matrix (n×n) + ); +#else + int lwork = -1; + double work_query; + // Query optimal work size + dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, + (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, + &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork = (int)work_query; + double work[lwork]; + dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, + (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, + work, &lwork, &info); +#endif + + return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + +/** Interface to SVD */ +linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { + if (u && ((a->nrows != u->nrows) || (a->nrows != u->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + if (vt && ((a->ncols != vt->nrows) || (a->ncols != vt->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + + objectxmatrix *temp = xmatrix_clone(a); + if (!temp) return LINALGERR_ALLOC; + + linalgError_t err = _svd(temp, s, u, vt); + object_free((object *) temp); + return err; +} + +/** Processes singular values into a tuple */ +static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) { + value sv[n]; + for (int i = 0; i < n; i++) sv[i] = MORPHO_NIL; + for (int i = 0; i < n; i++) { + sv[i] = MORPHO_FLOAT(s[i]); + } + + objecttuple *new = object_newtuple(n, sv); + if (!new) { + for (int i = 0; i < n; i++) morpho_freeobject(sv[i]); + return false; + } + + *out = MORPHO_OBJECT(new); + return true; +} + +#define _CHK_SVD(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _svd_cleanup; } + +/** Singular Value Decomposition */ +value XMatrix_svd(vm *v, int nargs, value *args) { + objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + + value s = MORPHO_NIL; // Will hold singular values + objectxmatrix *u = NULL; // Left singular vectors + objectxmatrix *vt = NULL; // Right singular vectors (transposed) + objecttuple *otuple = NULL; // Tuple to return everything + + MatrixIdx_t m = a->nrows, n = a->ncols; + MatrixIdx_t minmn = (m < n) ? m : n; + double singular_values[minmn]; + + // Allocate U (m×m) and VT (n×n) matrices + u = xmatrix_new(m, m, false); + _CHK_SVD(u); + + vt = xmatrix_new(n, n, false); + _CHK_SVD(vt); + + linalgError_t err = xmatrix_svd(a, singular_values, u, vt); + if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _svd_cleanup; } + + _CHK_SVD(_processsingularvalues(v, minmn, singular_values, &s)); + + value outtuple[3] = { MORPHO_OBJECT(u), s, MORPHO_OBJECT(vt) }; + otuple = object_newtuple(3, outtuple); + _CHK_SVD(otuple); + + return morpho_wrapandbind(v, (object *) otuple); + +_svd_cleanup: + if (u) object_free((object *) u); + if (vt) object_free((object *) vt); + if (otuple) object_free((object *) otuple); + if (MORPHO_ISOBJECT(s)) { + value svx; + objecttuple *t = MORPHO_GETTUPLE(s); + for (int i = 0; i < tuple_length(t); i++) if (tuple_getelement(t, i, &svx)) morpho_freeobject(svx); + } + morpho_freeobject(s); + + return MORPHO_NIL; +} +#undef _CHK_SVD + /* --------- * Products * --------- */ @@ -1222,6 +1343,7 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "XMatrix (XMatrix)", XMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_SVD_METHOD, "Tuple ()", XMatrix_svd, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index 78dd312e4..a4ef35c2d 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -121,6 +121,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_DIMENSIONS_METHOD "dimensions" #define XMATRIX_EIGENVALUES_METHOD "eigenvalues" #define XMATRIX_EIGENSYSTEM_METHOD "eigensystem" +#define XMATRIX_SVD_METHOD "svd" #define XMATRIX_INNER_METHOD "inner" #define XMATRIX_INVERSE_METHOD "inverse" #define XMATRIX_NORM_METHOD "norm" @@ -171,6 +172,7 @@ IMPLEMENTATIONFN(XMatrix_sum); IMPLEMENTATIONFN(XMatrix_transpose); IMPLEMENTATIONFN(XMatrix_eigenvalues); IMPLEMENTATIONFN(XMatrix_eigensystem); +IMPLEMENTATIONFN(XMatrix_svd); IMPLEMENTATIONFN(XMatrix_reshape); IMPLEMENTATIONFN(XMatrix_roll__int); IMPLEMENTATIONFN(XMatrix_roll__int_int); @@ -202,6 +204,8 @@ linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y); linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b); +linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); + linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); diff --git a/test/methods/matrix_svd.morpho b/test/methods/matrix_svd.morpho new file mode 100644 index 000000000..4a4e20b17 --- /dev/null +++ b/test/methods/matrix_svd.morpho @@ -0,0 +1,53 @@ +// Singular Value Decomposition +import newlinalg + +var A = XMatrix(((1,0),(0,2))) + +var svd = A.svd() + +print svd +// expect: (, (2, 1), ) + +print (svd[0] - XMatrix(((0,1),(1,0)))).norm() < 1e-10 +// expect: true + +print svd[1] +// expect: (2, 1) + +print (svd[2] - XMatrix(((0,1),(1,0)))).norm() < 1e-10 + +// Test reconstruction: U * S * V^T should approximately equal A +var U = svd[0] +var S = svd[1] +var V = svd[2] + +// Create diagonal matrix from singular values +var Sdiag = XMatrix(2,2) +Sdiag[0,0] = S[0] +Sdiag[1,1] = S[1] + +var VT = V.transpose() +var reconstructed = U * Sdiag * VT + +print (reconstructed - A).norm() < 1e-10 +// expect: true + +// Test with a non-square matrix +var B = XMatrix(3,2) +B[0,0]=1 +B[0,1]=0 +B[1,0]=0 +B[1,1]=2 +B[2,0]=0 +B[2,1]=0 + +var svd2 = B.svd() + +print svd2[0].dimensions() +// expect: (3, 3) + +print svd2[1] +// expect: (2, 1) + +print svd2[2].dimensions() +// expect: (2, 2) From 62a2fc0370be6dbc04944eb6b8bb2544c0c29142 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 7 Jan 2026 11:07:52 -0500 Subject: [PATCH 180/473] Complex SVD --- src/xcomplexmatrix.c | 45 ++++++++++++- src/xmatrix.c | 93 ++++++++++++--------------- src/xmatrix.h | 11 +++- test/methods/complexmatrix_svd.morpho | 22 +++++++ 4 files changed, 117 insertions(+), 54 deletions(-) create mode 100644 test/methods/complexmatrix_svd.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index 453a7b026..bdb63e006 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -97,6 +97,47 @@ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Low level SVD */ +static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_zgesvd(LAPACK_COL_MAJOR, + (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U + (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT + m, n, + (__LAPACK_double_complex *) a->elements, m, // input matrix A (overwritten) + s, // singular values (min(m,n)) + (__LAPACK_double_complex *) (u ? u->elements : NULL), m, // U matrix (m×m) + (__LAPACK_double_complex *) (vt ? vt->elements : NULL), n // VT matrix (n×n) + ); +#else + int lwork = -1; + __LAPACK_double_complex work_query; + double rwork[5 * minmn]; // rwork needs at least 5*min(m,n) for zgesvd + + // Query optimal work size + zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, + (__LAPACK_double_complex *) a->elements, &m, s, + (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, + (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, + &work_query, &lwork, rwork, &info); + + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork = (int)creal(work_query); + __LAPACK_double_complex work[lwork]; + zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, + (__LAPACK_double_complex *) a->elements, &m, s, + (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, + (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, + work, &lwork, rwork, &info); +#endif + + return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Interface definition * ---------------------- */ @@ -108,7 +149,8 @@ matrixinterfacedefn complexmatrixdefn = { .setelfn = _setelfn, .normfn = _normfn, .solvefn = _solve, - .eigenfn = _eigen + .eigenfn = _eigen, + .svdfn = _svd }; /* ---------------------- @@ -511,6 +553,7 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_SVD_METHOD, "Tuple ()", XMatrix_svd, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index c461441b7..960869fb7 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -143,6 +143,40 @@ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Low level SVD */ +static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, + (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U + (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT + m, n, + a->elements, m, // input matrix A (overwritten) + s, // singular values (min(m,n)) + (u ? u->elements : NULL), m, // U matrix (m×m) + (vt ? vt->elements : NULL), n // VT matrix (n×n) + ); +#else + int lwork = -1; + double work_query; + // Query optimal work size + dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, + (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, + &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork = (int)work_query; + double work[lwork]; + dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, + (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, + work, &lwork, &info); +#endif + + return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + /* ---------------------- * Interface definition * ---------------------- */ @@ -154,7 +188,8 @@ matrixinterfacedefn xmatrixdefn = { .setelfn = _setelfn, .normfn = _normfn, .solvefn = _solve, - .eigenfn = _eigen + .eigenfn = _eigen, + .svdfn = _svd }; /* ---------------------- @@ -1094,40 +1129,6 @@ value XMatrix_eigensystem(vm *v, int nargs, value *args) { * SVD * ---------------- */ -/** Low level SVD */ -static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { - int info, m=a->nrows, n=a->ncols; - int minmn = (m < n) ? m : n; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, - (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U - (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT - m, n, - a->elements, m, // input matrix A (overwritten) - s, // singular values (min(m,n)) - (u ? u->elements : NULL), m, // U matrix (m×m) - (vt ? vt->elements : NULL), n // VT matrix (n×n) - ); -#else - int lwork = -1; - double work_query; - // Query optimal work size - dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, - (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, - &work_query, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - - lwork = (int)work_query; - double work[lwork]; - dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, - (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, - work, &lwork, &info); -#endif - - return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); -} - /** Interface to SVD */ linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { if (u && ((a->nrows != u->nrows) || (a->nrows != u->ncols))) return LINALGERR_INCOMPATIBLE_DIM; @@ -1136,7 +1137,7 @@ linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx objectxmatrix *temp = xmatrix_clone(a); if (!temp) return LINALGERR_ALLOC; - linalgError_t err = _svd(temp, s, u, vt); + linalgError_t err = xmatrix_getinterface(a)->svdfn (temp, s, u, vt); object_free((object *) temp); return err; } @@ -1144,23 +1145,16 @@ linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx /** Processes singular values into a tuple */ static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) { value sv[n]; - for (int i = 0; i < n; i++) sv[i] = MORPHO_NIL; - for (int i = 0; i < n; i++) { - sv[i] = MORPHO_FLOAT(s[i]); - } + for (int i = 0; i < n; i++) sv[i] = MORPHO_FLOAT(s[i]); objecttuple *new = object_newtuple(n, sv); - if (!new) { - for (int i = 0; i < n; i++) morpho_freeobject(sv[i]); - return false; - } + if (!new) return false; *out = MORPHO_OBJECT(new); return true; } #define _CHK_SVD(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _svd_cleanup; } - /** Singular Value Decomposition */ value XMatrix_svd(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); @@ -1175,10 +1169,10 @@ value XMatrix_svd(vm *v, int nargs, value *args) { double singular_values[minmn]; // Allocate U (m×m) and VT (n×n) matrices - u = xmatrix_new(m, m, false); + u = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); _CHK_SVD(u); - vt = xmatrix_new(n, n, false); + vt = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), n, n, a->nvals, false); _CHK_SVD(vt); linalgError_t err = xmatrix_svd(a, singular_values, u, vt); @@ -1196,11 +1190,6 @@ value XMatrix_svd(vm *v, int nargs, value *args) { if (u) object_free((object *) u); if (vt) object_free((object *) vt); if (otuple) object_free((object *) otuple); - if (MORPHO_ISOBJECT(s)) { - value svx; - objecttuple *t = MORPHO_GETTUPLE(s); - for (int i = 0; i < tuple_length(t); i++) if (tuple_getelement(t, i, &svx)) morpho_freeobject(svx); - } morpho_freeobject(s); return MORPHO_NIL; diff --git a/src/xmatrix.h b/src/xmatrix.h index a4ef35c2d..a3b40cf1d 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -92,12 +92,20 @@ typedef double (*xmatrix_normfn_t) (objectxmatrix *a, xmatrix_norm_t nrm); typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *a, objectxmatrix *b, int *pivot); /** Function that finds the eigenvalues of a matrix - * @param[in|out] a - lhs; overwritten + * @param[in|out] a - matrix to diagonalize; overwritten * @param[out] w - eigenvalues; dimension N * @param[out] vec - right eigenvectors. Can be NULL if only eigenvalues requested * @returns a matrix error code */ typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec); +/** Function that finds the svd of a matrix + * @param[in|out] a - overwritten + * @param[out] s - singular values + * @param[out] u - left singular vectors + * @param[out] v - right singular vectors (transposed so columns contain singular vectors) + * @returns a matrix error code */ +typedef linalgError_t (*xmatrix_svdfn_t) (objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); + typedef struct { xmatrix_printelfn_t printelfn; xmatrix_printeltobufffn_t printeltobufffn; @@ -106,6 +114,7 @@ typedef struct { xmatrix_normfn_t normfn; xmatrix_solvefn_t solvefn; xmatrix_eigenfn_t eigenfn; + xmatrix_svdfn_t svdfn; } matrixinterfacedefn; void xmatrix_addinterface(matrixinterfacedefn *defn); diff --git a/test/methods/complexmatrix_svd.morpho b/test/methods/complexmatrix_svd.morpho new file mode 100644 index 000000000..68aa33688 --- /dev/null +++ b/test/methods/complexmatrix_svd.morpho @@ -0,0 +1,22 @@ +// Singular Value Decomposition +import newlinalg + +var A = ComplexMatrix(((1+1im,0+0im),(0+0im,2+2im))) + +var svd = A.svd() + +// Test reconstruction: U * S * V^T should approximately equal A +var U = svd[0] +var S = svd[1] +var V = svd[2] + +// Create diagonal matrix from singular values +var Sdiag = ComplexMatrix(2,2) +Sdiag[0,0] = S[0] +Sdiag[1,1] = S[1] + +var VT = V.transpose() +var reconstructed = U * Sdiag * VT + +print (reconstructed - A).norm() < 1e-10 +// expect: true From 4aa3521833be92b65c42b768f28a898994027da8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 7 Jan 2026 11:10:38 -0500 Subject: [PATCH 181/473] Fix test case --- test/methods/matrix_svd.morpho | 1 + 1 file changed, 1 insertion(+) diff --git a/test/methods/matrix_svd.morpho b/test/methods/matrix_svd.morpho index 4a4e20b17..037c7f410 100644 --- a/test/methods/matrix_svd.morpho +++ b/test/methods/matrix_svd.morpho @@ -15,6 +15,7 @@ print svd[1] // expect: (2, 1) print (svd[2] - XMatrix(((0,1),(1,0)))).norm() < 1e-10 +// expect: true // Test reconstruction: U * S * V^T should approximately equal A var U = svd[0] From 86db518eff5a41e14a4bb0a416aba232217cd4d4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 7 Jan 2026 11:19:55 -0500 Subject: [PATCH 182/473] Matrix types now inherit from Object --- src/xcomplexmatrix.c | 5 ++++- src/xmatrix.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index bdb63e006..dbeb1889b 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -570,7 +570,10 @@ void complexmatrix_initialize(void) { objectcomplexmatrixtype=object_addtype(&objectxmatrixdefn); xmatrix_addinterface(&complexmatrixdefn); - value complexmatrixclass=builtin_addclass(COMPLEXMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexMatrix), MORPHO_NIL); + objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); + value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + + value complexmatrixclass=builtin_addclass(COMPLEXMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexMatrix), objclass); object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/xmatrix.c b/src/xmatrix.c index 960869fb7..ae7ab1c28 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -1349,7 +1349,10 @@ void xmatrix_initialize(void) { objectxmatrixtype=object_addtype(&objectxmatrixdefn); xmatrix_addinterface(&xmatrixdefn); - value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), MORPHO_NIL); + objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); + value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + + value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), objclass); object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); From 8f3a7588054a3a20424b4416ec4fa2008c7601de Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 7 Jan 2026 22:07:21 -0500 Subject: [PATCH 183/473] Missing constructor tests --- ...rray_constructor_invalid_dimensions.morpho | 12 +++++ ...omplexmatrix_constructor_edge_cases.morpho | 48 +++++++++++++++++++ ...plexmatrix_constructor_invalid_args.morpho | 6 +++ ...rray_constructor_invalid_dimensions.morpho | 12 +++++ .../matrix_constructor_edge_cases.morpho | 48 +++++++++++++++++++ .../matrix_identity_constructor.morpho | 13 +++++ 6 files changed, 139 insertions(+) create mode 100644 test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho create mode 100644 test/constructors/complexmatrix_constructor_edge_cases.morpho create mode 100644 test/constructors/complexmatrix_constructor_invalid_args.morpho create mode 100644 test/constructors/matrix_array_constructor_invalid_dimensions.morpho create mode 100644 test/constructors/matrix_constructor_edge_cases.morpho create mode 100644 test/constructors/matrix_identity_constructor.morpho diff --git a/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho b/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho new file mode 100644 index 000000000..f45fe0326 --- /dev/null +++ b/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho @@ -0,0 +1,12 @@ +// ComplexMatrix constructor from Array with invalid dimensions +import newlinalg + +// Try to construct from a 1D array (should fail - requires 2D) +var a[4] +a[0] = 1 +a[1] = 2 +a[2] = 3 +a[3] = 4 + +print ComplexMatrix(a) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/constructors/complexmatrix_constructor_edge_cases.morpho b/test/constructors/complexmatrix_constructor_edge_cases.morpho new file mode 100644 index 000000000..eae633aa6 --- /dev/null +++ b/test/constructors/complexmatrix_constructor_edge_cases.morpho @@ -0,0 +1,48 @@ +// ComplexMatrix constructor edge cases +import newlinalg + +// Zero dimension matrix (0x0) +var A = ComplexMatrix(0, 0) +print A.dimensions() +// expect: (0, 0) +print A.count() +// expect: 0 + +// Zero rows, non-zero columns +var B = ComplexMatrix(0, 3) +print B.dimensions() +// expect: (0, 3) +print B.count() +// expect: 0 + +// Non-zero rows, zero columns +var C = ComplexMatrix(3, 0) +print C.dimensions() +// expect: (3, 0) +print C.count() +// expect: 0 + +// Single element matrix (1x1) +var D = ComplexMatrix(1, 1) +D[0,0] = 42+10im +print D +// expect: [ 42 + 10im ] + +// Single row matrix (1xN) +var E = ComplexMatrix(1, 3) +E[0,0] = 1+im +E[0,1] = 2+2im +E[0,2] = 3+3im +print E +// expect: [ 1 + 1im 2 + 2im 3 + 3im ] + +// Single column matrix (Nx1) +var F = ComplexMatrix(3, 1) +F[0,0] = 1+im +F[1,0] = 2+2im +F[2,0] = 3+3im +print F +// expect: [ 1 + 1im ] +// expect: [ 2 + 2im ] +// expect: [ 3 + 3im ] + diff --git a/test/constructors/complexmatrix_constructor_invalid_args.morpho b/test/constructors/complexmatrix_constructor_invalid_args.morpho new file mode 100644 index 000000000..e95d5e169 --- /dev/null +++ b/test/constructors/complexmatrix_constructor_invalid_args.morpho @@ -0,0 +1,6 @@ +// ComplexMatrix constructor with invalid arguments +import newlinalg + +// Try to construct with invalid argument types +print ComplexMatrix("invalid") +// expect error 'MltplDsptchFld' diff --git a/test/constructors/matrix_array_constructor_invalid_dimensions.morpho b/test/constructors/matrix_array_constructor_invalid_dimensions.morpho new file mode 100644 index 000000000..a2d5160f2 --- /dev/null +++ b/test/constructors/matrix_array_constructor_invalid_dimensions.morpho @@ -0,0 +1,12 @@ +// XMatrix constructor from Array with invalid dimensions +import newlinalg + +// Try to construct from a 1D array (should fail - requires 2D) +var a[4] +a[0] = 1 +a[1] = 2 +a[2] = 3 +a[3] = 4 + +print XMatrix(a) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/constructors/matrix_constructor_edge_cases.morpho b/test/constructors/matrix_constructor_edge_cases.morpho new file mode 100644 index 000000000..509ec6234 --- /dev/null +++ b/test/constructors/matrix_constructor_edge_cases.morpho @@ -0,0 +1,48 @@ +// XMatrix constructor edge cases +import newlinalg + +// Zero dimension matrix (0x0) +var A = XMatrix(0, 0) +print A.dimensions() +// expect: (0, 0) +print A.count() +// expect: 0 + +// Zero rows, non-zero columns +var B = XMatrix(0, 3) +print B.dimensions() +// expect: (0, 3) +print B.count() +// expect: 0 + +// Non-zero rows, zero columns +var C = XMatrix(3, 0) +print C.dimensions() +// expect: (3, 0) +print C.count() +// expect: 0 + +// Single element matrix (1x1) +var D = XMatrix(1, 1) +D[0,0] = 42 +print D +// expect: [ 42 ] + +// Single row matrix (1xN) +var E = XMatrix(1, 3) +E[0,0] = 1 +E[0,1] = 2 +E[0,2] = 3 +print E +// expect: [ 1 2 3 ] + +// Single column matrix (Nx1) +var F = XMatrix(3, 1) +F[0,0] = 1 +F[1,0] = 2 +F[2,0] = 3 +print F +// expect: [ 1 ] +// expect: [ 2 ] +// expect: [ 3 ] + diff --git a/test/constructors/matrix_identity_constructor.morpho b/test/constructors/matrix_identity_constructor.morpho new file mode 100644 index 000000000..761948bb7 --- /dev/null +++ b/test/constructors/matrix_identity_constructor.morpho @@ -0,0 +1,13 @@ +// IdentityXMatrix constructor +import newlinalg + +var I = IdentityXMatrix(3) + +print I +// expect: [ 1 0 0 ] +// expect: [ 0 1 0 ] +// expect: [ 0 0 1 ] + +var I2 = IdentityXMatrix(1) +print I2 +// expect: [ 1 ] From 7839307b2a431c9dc62d143fff21d11a71ed915e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 7 Jan 2026 22:16:29 -0500 Subject: [PATCH 184/473] Minor bug fixes --- src/xcomplexmatrix.c | 2 +- src/xmatrix.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index dbeb1889b..db27c8d4e 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -51,7 +51,7 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { if (MORPHO_ISCOMPLEX(in)) { *((MorphoComplex *) el) = MORPHO_GETCOMPLEX(in)->Z; } else if (morpho_valuetofloat(in, el)) { - el[1] = 0.0; // Set real part to zero + el[1] = 0.0; // Set imaginary part to zero } else return LINALGERR_NON_NUMERICAL; return LINALGERR_OK; } diff --git a/src/xmatrix.c b/src/xmatrix.c index ae7ab1c28..95d971cb6 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -131,14 +131,15 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { /** Low level eigensolver */ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { int info, n=a->nrows; + double wr[n], wi[n]; #ifdef MORPHO_LINALG_USE_LAPACKE info=LAPACKE_dgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); #else - int lwork=4*n; double work[4*n], wr[n], wi[n]; + int lwork=4*n; double work[4*n]; dgeev_("N", (vec ? "V" : "N"), &n, a->elements, &n, wr, wi, NULL, &n, (vec ? vec->elements : NULL), &n, work, &lwork, &info); - for (int i=0; i0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } @@ -269,7 +270,7 @@ objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, Matrix _getelement(lst, i, &iel); for (int j=0; jsetelfn(v, jel, new->elements+(j*ncols + i)*new->nvals); + xmatrix_getinterface(new)->setelfn(v, jel, new->elements+(j*nrows + i)*new->nvals); } } } @@ -290,7 +291,7 @@ objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, unsigned int indx[2]={ i, j }; value el; if (array_getelement(a, 2, indx, &el)==ARRAY_OK) { - xmatrix_getinterface(new)->setelfn(v, el, new->elements+(j*ncols + i)*new->nvals); + xmatrix_getinterface(new)->setelfn(v, el, new->elements+(j*nrows + i)*new->nvals); } } } @@ -439,8 +440,10 @@ void xmatrix_sum(objectxmatrix *a, double *sum) { /** Calculate the trace of a matrix */ linalgError_t xmatrix_trace(objectxmatrix *a, double *out) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; - *out=1.0; - *out=cblas_ddot(a->nrows, a->elements, a->ncols+1, out, 0); + *out = 0.0; + for (int i = 0; i < a->nrows; i++) { + *out += a->elements[a->nvals * (i * a->nrows + i)]; + } return LINALGERR_OK; } From fe609dcbfaa441c0e8453141bd83924d08ed34d8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 9 Jan 2026 00:14:28 -0500 Subject: [PATCH 185/473] QR decomposition --- src/xcomplexmatrix.c | 65 +++++++++++- src/xmatrix.c | 118 +++++++++++++++++++++- src/xmatrix.h | 12 +++ test/methods/complexmatrix_qr.morpho | 145 +++++++++++++++++++++++++++ test/methods/matrix_qr.morpho | 135 +++++++++++++++++++++++++ 5 files changed, 473 insertions(+), 2 deletions(-) create mode 100644 test/methods/complexmatrix_qr.morpho create mode 100644 test/methods/matrix_qr.morpho diff --git a/src/xcomplexmatrix.c b/src/xcomplexmatrix.c index db27c8d4e..3a860f77c 100644 --- a/src/xcomplexmatrix.c +++ b/src/xcomplexmatrix.c @@ -138,6 +138,67 @@ static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Low level QR decomposition */ +static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + __LAPACK_double_complex tau[minmn]; + + // Compute QR factorization without pivoting: A = Q*R +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_zgeqrf(LAPACK_COL_MAJOR, m, n, (__LAPACK_double_complex *) a->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + int lwork = -1; + __LAPACK_double_complex work_query; + + // Query optimal work size for ZGEQRF, which is reused for ZUNGQR + zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + int lwork_geqrf = (int) creal(work_query); + __LAPACK_double_complex work[lwork_geqrf]; + lwork = lwork_geqrf; + + // Compute QR factorization without pivoting + zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // Extract R (upper triangle of a) into r + // Copy entire matrix first then zero out below the diagonal + xmatrix_copy(a, r); + __LAPACK_double_complex *relems = (__LAPACK_double_complex *) r->elements; + for (int j = 0; j < n && j < m - 1; j++) { + memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(__LAPACK_double_complex)); + } + + // Generate Q from reflectors + if (q) { + // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) + // ZGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns + __LAPACK_double_complex *aelems = (__LAPACK_double_complex *) a->elements; + __LAPACK_double_complex *qelems = (__LAPACK_double_complex *) q->elements; + for (int j = 0; j < n; j++) { + cblas_zcopy(m, &aelems[j * m], 1, &qelems[j * m], 1); + } + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, minmn, minmn, (__LAPACK_double_complex *) q->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + lwork = lwork_geqrf; + zungqr_(&m, &minmn, &minmn, (__LAPACK_double_complex *) q->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // If Q should be m×m, zero out remaining columns if m > minmn + if (m > minmn) memset(&q->elements[minmn * m * q->nvals], 0, (m - minmn) * m * sizeof(__LAPACK_double_complex)); + } + + return LINALGERR_OK; +} + /* ---------------------- * Interface definition * ---------------------- */ @@ -150,7 +211,8 @@ matrixinterfacedefn complexmatrixdefn = { .normfn = _normfn, .solvefn = _solve, .eigenfn = _eigen, - .svdfn = _svd + .svdfn = _svd, + .qrfn = _qr }; /* ---------------------- @@ -554,6 +616,7 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", C MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SVD_METHOD, "Tuple ()", XMatrix_svd, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_QR_METHOD, "Tuple ()", XMatrix_qr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.c b/src/xmatrix.c index 95d971cb6..b470ab7e6 100644 --- a/src/xmatrix.c +++ b/src/xmatrix.c @@ -178,6 +178,63 @@ static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } +/** Low level QR decomposition without pivoting */ +static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + double tau[minmn]; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dgeqrf(LAPACK_COL_MAJOR, m, n, a->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + int lwork = -1; + double work_query; + + // Query optimal work size for DGEQRF, which is reused for DORGQR + dgeqrf_(&m, &n, a->elements, &m, tau, &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + int lwork_geqrf = (int) work_query; + double work[lwork_geqrf]; + lwork = lwork_geqrf; + + // Compute QR factorization without pivoting + dgeqrf_(&m, &n, a->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // Extract R (upper triangle of a) into r + // Copy entire matrix first, then zero out below the diagonal + xmatrix_copy(a, r); + // Only process columns where there are rows below the diagonal (j < m - 1) + for (int j = 0; j < n && j < m - 1; j++) { + memset(&r->elements[j * m + (j + 1)], 0, (m - j - 1) * sizeof(double)); + } + + // Generate Q from reflectors + if (q) { + // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) + // DGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns + for (int j = 0; j < n; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, minmn, minmn, q->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + lwork = lwork_geqrf; + dorgqr_(&m, &minmn, &minmn, q->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // If Q should be m×m, zero out remaining columns if m > minmn + // DORGQR only generates the first minmn columns, so we zero the rest + if (m > minmn) memset(&q->elements[minmn * m], 0, (m - minmn) * m * sizeof(double)); + } + + return LINALGERR_OK; +} + /* ---------------------- * Interface definition * ---------------------- */ @@ -190,7 +247,8 @@ matrixinterfacedefn xmatrixdefn = { .normfn = _normfn, .solvefn = _solve, .eigenfn = _eigen, - .svdfn = _svd + .svdfn = _svd, + .qrfn = _qr }; /* ---------------------- @@ -1145,6 +1203,23 @@ linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx return err; } +/* ---------------- + * QR decomposition + * ---------------- */ + +/** Interface to QR decomposition */ +linalgError_t xmatrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { + if (q && ((a->nrows != q->nrows) || (a->nrows != q->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + if (r && ((a->nrows != r->nrows) || (a->ncols != r->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + + objectxmatrix *temp = xmatrix_clone(a); + if (!temp) return LINALGERR_ALLOC; + + linalgError_t err = xmatrix_getinterface(a)->qrfn (temp, q, r); + object_free((object *) temp); + return err; +} + /** Processes singular values into a tuple */ static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) { value sv[n]; @@ -1199,6 +1274,46 @@ value XMatrix_svd(vm *v, int nargs, value *args) { } #undef _CHK_SVD +/* ---------------- + * QR decomposition + * ---------------- */ + +#define _CHK_QR(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _qr_cleanup; } +/** QR Decomposition */ +value XMatrix_qr(vm *v, int nargs, value *args) { + objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + + objectxmatrix *q = NULL; // Orthogonal matrix Q + objectxmatrix *r = NULL; // Upper triangular matrix R + objecttuple *otuple = NULL; // Tuple to return everything + + MatrixIdx_t m = a->nrows, n = a->ncols; + + // Allocate Q (m×m) and R (m×n) matrices + q = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); + _CHK_QR(q); + + r = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, n, a->nvals, false); + _CHK_QR(r); + + linalgError_t err = xmatrix_qr(a, q, r); + if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _qr_cleanup; } + + value outtuple[2] = { MORPHO_OBJECT(q), MORPHO_OBJECT(r) }; + otuple = object_newtuple(2, outtuple); + _CHK_QR(otuple); + + return morpho_wrapandbind(v, (object *) otuple); + +_qr_cleanup: + if (q) object_free((object *) q); + if (r) object_free((object *) r); + if (otuple) object_free((object *) otuple); + + return MORPHO_NIL; +} +#undef _CHK_QR + /* --------- * Products * --------- */ @@ -1336,6 +1451,7 @@ MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "XMatrix (XMatrix)", XMatrix_outer MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_SVD_METHOD, "Tuple ()", XMatrix_svd, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(XMATRIX_QR_METHOD, "Tuple ()", XMatrix_qr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), diff --git a/src/xmatrix.h b/src/xmatrix.h index a3b40cf1d..dcac09311 100644 --- a/src/xmatrix.h +++ b/src/xmatrix.h @@ -106,6 +106,13 @@ typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, * @returns a matrix error code */ typedef linalgError_t (*xmatrix_svdfn_t) (objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); +/** Function that finds the QR decomposition of a matrix + * @param[in|out] a - overwritten with R in upper triangle and reflectors below + * @param[out] q - orthogonal matrix Q + * @param[out] r - upper triangular matrix R + * @returns a matrix error code */ +typedef linalgError_t (*xmatrix_qrfn_t) (objectxmatrix *a, objectxmatrix *q, objectxmatrix *r); + typedef struct { xmatrix_printelfn_t printelfn; xmatrix_printeltobufffn_t printeltobufffn; @@ -115,6 +122,7 @@ typedef struct { xmatrix_solvefn_t solvefn; xmatrix_eigenfn_t eigenfn; xmatrix_svdfn_t svdfn; + xmatrix_qrfn_t qrfn; } matrixinterfacedefn; void xmatrix_addinterface(matrixinterfacedefn *defn); @@ -131,6 +139,7 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_EIGENVALUES_METHOD "eigenvalues" #define XMATRIX_EIGENSYSTEM_METHOD "eigensystem" #define XMATRIX_SVD_METHOD "svd" +#define XMATRIX_QR_METHOD "qr" #define XMATRIX_INNER_METHOD "inner" #define XMATRIX_INVERSE_METHOD "inverse" #define XMATRIX_NORM_METHOD "norm" @@ -182,6 +191,7 @@ IMPLEMENTATIONFN(XMatrix_transpose); IMPLEMENTATIONFN(XMatrix_eigenvalues); IMPLEMENTATIONFN(XMatrix_eigensystem); IMPLEMENTATIONFN(XMatrix_svd); +IMPLEMENTATIONFN(XMatrix_qr); IMPLEMENTATIONFN(XMatrix_reshape); IMPLEMENTATIONFN(XMatrix_roll__int); IMPLEMENTATIONFN(XMatrix_roll__int_int); @@ -215,6 +225,8 @@ linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b); linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); +linalgError_t xmatrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r); + linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); diff --git a/test/methods/complexmatrix_qr.morpho b/test/methods/complexmatrix_qr.morpho new file mode 100644 index 000000000..08eae0f87 --- /dev/null +++ b/test/methods/complexmatrix_qr.morpho @@ -0,0 +1,145 @@ +// QR Decomposition for ComplexMatrix +import newlinalg + +// Test with a square complex matrix +var A = ComplexMatrix(((1.0+1.0im, 2.0+0.0im, 3.0-1.0im), + (4.0+2.0im, 5.0+1.0im, 6.0+0.0im), + (7.0+0.0im, 8.0-1.0im, 9.0+2.0im))) + +var qr = A.qr() + +print qr +// expect: (, ) + +var Q = qr[0] +var R = qr[1] + +print Q.dimensions() +// expect: (3, 3) + +print R.dimensions() +// expect: (3, 3) + +// Verify Q is unitary: Q^H * Q should be approximately I (conjugate transpose) +var QHQ = Q.conjTranspose() * Q +var I = ComplexMatrix(3,3) +for (var i = 0; i < 3; i = i + 1) { + I[i,i] = 1.0 + 0.0im +} + +print (QHQ - I).norm() < 1e-10 +// expect: true + +// Verify R is upper triangular (check lower triangle is zero) +var R_lower_norm = 0.0 +for (var i = 0; i < 3; i = i + 1) { + for (var j = 0; j < i; j = j + 1) { + var val = R[i,j] + R_lower_norm += val.abs() + } +} +print R_lower_norm < 1e-10 +// expect: true + +// Verify Q * R has the right structure +var QR = Q * R +print QR.dimensions() +// expect: (3, 3) + +// Test with a non-square matrix (tall matrix) +var B = ComplexMatrix(4,2) +B[0,0] = 1.0 + 1.0im +B[0,1] = 2.0 + 0.0im +B[1,0] = 3.0 - 1.0im +B[1,1] = 4.0 + 2.0im +B[2,0] = 5.0 + 0.0im +B[2,1] = 6.0 - 1.0im +B[3,0] = 7.0 + 1.0im +B[3,1] = 8.0 + 0.0im + +var qr2 = B.qr() +var Q2 = qr2[0] +var R2 = qr2[1] + +print Q2.dimensions() +// expect: (4, 4) + +print R2.dimensions() +// expect: (4, 2) + +// Verify Q2 first 2 columns are orthonormal (unitary) +// For tall matrices, only the first min(m,n) columns from ZUNGQR are orthonormal +// The remaining columns are zero +var Q2_col0 = Q2.column(0) +var Q2_col1 = Q2.column(1) +// Check norms +var norm0 = Q2_col0.norm() +var norm1 = Q2_col1.norm() + +print abs(norm0-1) < 1e-7 // expect: true +print abs(norm1-1) < 1e-7 // expect: true + +// Check orthogonality: inner product should be close to zero +var inner01 = Q2_col0.inner(Q2_col1) +var inner01_mag = inner01.abs() +print inner01_mag < 1e-10 +// expect: true + +// Verify R2 is upper triangular +var R2_lower_norm = 0.0 +for (var i = 0; i < 4; i = i + 1) { + for (var j = 0; j < 2; j = j + 1) { + if (i > j) { + var val = R2[i,j] + R2_lower_norm = val.abs() + } + } +} +print R2_lower_norm < 1e-10 +// expect: true + +// Test with a wide matrix +var C = ComplexMatrix(2,4) +C[0,0] = 1.0 + 1.0im +C[0,1] = 2.0 + 0.0im +C[0,2] = 3.0 - 1.0im +C[0,3] = 4.0 + 2.0im +C[1,0] = 5.0 + 0.0im +C[1,1] = 6.0 - 1.0im +C[1,2] = 7.0 + 1.0im +C[1,3] = 8.0 + 0.0im + +var qr3 = C.qr() +var Q3 = qr3[0] +var R3 = qr3[1] + +print Q3.dimensions() +// expect: (2, 2) + +print R3.dimensions() +// expect: (2, 4) + +// Verify Q3 is unitary +var Q3HQ3 = Q3.conjTranspose() * Q3 +var I2 = ComplexMatrix(2,2) +for (var i = 0; i < 2; i = i + 1) { + I2[i,i] = 1.0 + 0.0im +} +print (Q3HQ3 - I2).norm() < 1e-10 +// expect: true + +// Test with real-valued complex matrix (should work like real matrix) +var D = ComplexMatrix(((1.0+0.0im, 0.0+0.0im), + (0.0+0.0im, 2.0+0.0im))) +var qr4 = D.qr() +var Q4 = qr4[0] +var R4 = qr4[1] + +// Verify Q4 is unitary +var Q4HQ4 = Q4.conjTranspose() * Q4 +var I2b = ComplexMatrix(2,2) +for (var i = 0; i < 2; i = i + 1) { + I2b[i,i] = 1.0 + 0.0im +} +print (Q4HQ4 - I2b).norm() < 1e-10 +// expect: true diff --git a/test/methods/matrix_qr.morpho b/test/methods/matrix_qr.morpho new file mode 100644 index 000000000..79ac4847d --- /dev/null +++ b/test/methods/matrix_qr.morpho @@ -0,0 +1,135 @@ +// QR Decomposition +import newlinalg + +// Test with a square matrix (this one is singular, so R will have a zero on the diagonal) +var A = XMatrix(((1.0,2.0,3.0),(4.0,5.0,6.0),(7.0,8.0,9.0))) + +var qr = A.qr() + +print qr +// expect: (, ) + +var Q = qr[0] +var R = qr[1] + +print Q.dimensions() +// expect: (3, 3) + +print R.dimensions() +// expect: (3, 3) + +// Verify Q is orthogonal: Q^T * Q should be approximately I +var QTQ = Q.transpose() * Q +var I = IdentityXMatrix(3) + +print (QTQ - I).norm() < 1e-10 +// expect: true + +// Verify R is upper triangular (check lower triangle is zero) +var R_lower_norm = 0.0 +for (var i = 0; i < 3; i = i + 1) { + for (var j = 0; j < i; j = j + 1) { + R_lower_norm = R_lower_norm + R[i,j]*R[i,j] + } +} +print R_lower_norm < 1e-10 +// expect: true + +// Check R's diagonal - since A is singular, one diagonal element should be (close to) zero +// This indicates the matrix has rank 2 (not full rank) +print abs(R[2,2]) < 1e-8 +// expect: true + +// Verify Q * R reconstruction +var QR = Q * R +print (QR - A).norm() < 1e-10 +// expect: true + +// Test with a non-square matrix (tall matrix) +var B = XMatrix(4,2) +B[0,0] = 1.0 +B[0,1] = 2.0 +B[1,0] = 3.0 +B[1,1] = 4.0 +B[2,0] = 5.0 +B[2,1] = 6.0 +B[3,0] = 7.0 +B[3,1] = 8.0 + +var qr2 = B.qr() +var Q2 = qr2[0] +var R2 = qr2[1] + +print Q2.dimensions() +// expect: (4, 4) + +print R2.dimensions() +// expect: (4, 2) + +// Verify Q2 first 2 columns are orthonormal +// For tall matrices, only the first min(m,n) columns from DORGQR are orthonormal +// The remaining columns are zero +var Q2_col0 = Q2.column(0) +var Q2_col1 = Q2.column(1) +// Check norms +print Q2_col0.norm() < 1.0 + 1e-10 and Q2_col0.norm() > 1.0 - 1e-10 +// expect: true +print Q2_col1.norm() < 1.0 + 1e-10 and Q2_col1.norm() > 1.0 - 1e-10 +// expect: true +// Check orthogonality: dot product should be close to zero +var dot01 = Q2_col0.inner(Q2_col1) +print dot01 < 1e-10 and dot01 > -1e-10 +// expect: true + +// Verify R2 is upper triangular +var R2_lower_norm = 0.0 +for (var i = 0; i < 4; i = i + 1) { + for (var j = 0; j < 2; j = j + 1) { + if (i > j) { + R2_lower_norm = R2_lower_norm + R2[i,j]*R2[i,j] + } + } +} +print R2_lower_norm < 1e-10 +// expect: true + +// Test with a wide matrix +var C = XMatrix(2,4) +C[0,0] = 1.0 +C[0,1] = 2.0 +C[0,2] = 3.0 +C[0,3] = 4.0 +C[1,0] = 5.0 +C[1,1] = 6.0 +C[1,2] = 7.0 +C[1,3] = 8.0 + +var qr3 = C.qr() +var Q3 = qr3[0] +var R3 = qr3[1] + +print Q3.dimensions() +// expect: (2, 2) + +print R3.dimensions() +// expect: (2, 4) + +// Verify Q3 is orthogonal +var Q3TQ3 = Q3.transpose() * Q3 +var I2 = IdentityXMatrix(2) +print (Q3TQ3 - I2).norm() < 1e-10 +// expect: true + +// Test with identity matrix +var I3 = IdentityXMatrix(3) +var qr4 = I3.qr() +var Q4 = qr4[0] +var R4 = qr4[1] + +// Q should be close to identity +print (Q4 - I3).norm() < 1e-10 +// expect: true + +// R should be close to identity +print (R4 - I3).norm() < 1e-10 +// expect: true From f932f0d8c5d9dc64ec28170797a60a3f6d3aa4a7 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 10 Jan 2026 23:10:42 -0500 Subject: [PATCH 186/473] Correct lapack search --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ac527cf5..76098392a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,7 +64,7 @@ message(STATUS "Searching for BLAS and LAPACK") # Currently we prefer LAPACKE # TODO: Fix morpho source to select between lapack and lapacke find_library(LAPACK_LIBRARY - NAMES lapacke liblapacke lapack liblapack libopenblas + NAMES lapacke liblapacke lapack liblapack openblas libopenblas HINTS "C:\\Program Files\\Morpho\\lib\\" ) From cab6cd8e4a44fe30838002198322099eda57a05c Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 11 Jan 2026 21:54:22 -0500 Subject: [PATCH 187/473] Update CMakeLists to new morpho install layout on windows --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76098392a..c2c0bc078 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ endif() # Find cblas.h header file find_path(CBLAS_INCLUDE cblas.h HINTS - "C:\\Program Files\\Morpho\\include\\lapack") + "C:\\Program Files\\Morpho\\include\\openblas") # Add cblas headers to include folders target_include_directories(morpho PUBLIC ${CBLAS_INCLUDE}) From 037855da77780c5070ecebc00cf0f3f8c38562d0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 12 Jan 2026 08:51:29 -0500 Subject: [PATCH 188/473] Add required header --- src/support/platform.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/support/platform.c b/src/support/platform.c index 229f320fc..6aef4747a 100644 --- a/src/support/platform.c +++ b/src/support/platform.c @@ -31,6 +31,7 @@ #include #include #include +#include #endif /* ********************************************************************** From 7610c05200973c9d091109fc01565962f27be3c1 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:17:14 -0500 Subject: [PATCH 189/473] Add missing help to the Folder class --- help/file.md | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/help/file.md b/help/file.md index fc8c8f86f..7e4c538bb 100644 --- a/help/file.md +++ b/help/file.md @@ -85,12 +85,38 @@ Returns true if at the end of the file; false otherwise # Folder [tagfolder]: # (Folder) -The `Folder` class enables you to find whether a filepath refers to a folder, and find the contents of that folder. +The `Folder` class allows you to work with folders. You can find whether a filepath refers to a folder, obtain the contents of that folder and create folders. -Find whether a path refers to a folder: +[show]: # (subtopics) + +## isfolder +[tagisfolder]: # (isfolder) +Find out whether a path specification refers to a folder: print Folder.isfolder("path/folder") +## contents +[tagcontents]: # (contents) + Get a list of a folder's contents: print Folder.contents("path/folder") + +## normalizePath +[tagnormalizepath]: # (normalizepath) +This method of `Folder` normalizes a file path, replacing folder separators with the correct ones for the current platform, i.e. \ on windows or / on macOS and linux. + +Get a normalizad path: + + print Folder.normalizePath("/foo/foo") + +## create +[tagcreate]: # (create) +[tagcreaterecursive]: # (createrecursive) +The `create` and `createRecursive` methods allow creation of folders. To create a new Folder: + + Folder.create("foo") + +Recursively create a nested set of folders: + + Folder.createRecursive("foo/foo") From 87e9e03379c471621a7470d1ca2f47691b3c0a28 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 12 Jan 2026 09:42:43 -0500 Subject: [PATCH 190/473] Update documentation --- help/list.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/help/list.md b/help/list.md index d996d27e6..f343eec4b 100644 --- a/help/list.md +++ b/help/list.md @@ -103,13 +103,13 @@ Tests if a value is a member of a list: var list = [1,2,3] print list.ismember(1) // expect: true -## Add -[tagadd]: # (add) +## Join +[tagjoin]: # (join) Join two lists together: var l1 = [1,2,3], l2 = [4, 5, 6] - print l1+l2 // expect: [1,2,3,4,5,6] + print l1.join(l2) // expect: [1,2,3,4,5,6] ## Tuples [tagtuples]: # (tuples) From 3bb2a01f36544fb3963ee6199cc7c39ea4875c9b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:35:08 -0500 Subject: [PATCH 191/473] Move files into subfolder to facilitate merge --- CMakeLists.txt => newlinalg/CMakeLists.txt | 0 newlinalg/build/CMakeCache.txt | 404 +++ .../CMakeFiles/4.1.0/CMakeCCompiler.cmake | 84 + .../CMakeFiles/4.1.0/CMakeCXXCompiler.cmake | 104 + .../4.1.0/CMakeDetermineCompilerABI_C.bin | Bin 0 -> 33560 bytes .../4.1.0/CMakeDetermineCompilerABI_CXX.bin | Bin 0 -> 33560 bytes .../build/CMakeFiles/4.1.0/CMakeSystem.cmake | 15 + .../4.1.0/CompilerIdC/CMakeCCompilerId.c | 934 ++++++ .../build/CMakeFiles/4.1.0/CompilerIdC/a.out | Bin 0 -> 33736 bytes .../CMakeFiles/4.1.0/CompilerIdC/apple-sdk.c | 1 + .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 949 ++++++ .../CMakeFiles/4.1.0/CompilerIdCXX/a.out | Bin 0 -> 33736 bytes .../4.1.0/CompilerIdCXX/apple-sdk.cpp | 1 + .../build/CMakeFiles/CMakeConfigureLog.yaml | 2177 +++++++++++++ .../CMakeDirectoryInformation.cmake | 16 + .../build/CMakeFiles/InstallScripts.json | 8 + newlinalg/build/CMakeFiles/Makefile.cmake | 62 + newlinalg/build/CMakeFiles/Makefile2 | 144 + .../build/CMakeFiles/TargetDirectories.txt | 13 + newlinalg/build/CMakeFiles/cmake.check_cache | 1 + .../CMakeFiles/newlinalg.dir/DependInfo.cmake | 25 + .../build/CMakeFiles/newlinalg.dir/build.make | 148 + .../newlinalg.dir/cmake_clean.cmake | 15 + .../newlinalg.dir/compiler_depend.internal | 1193 +++++++ .../newlinalg.dir/compiler_depend.make | 2860 +++++++++++++++++ .../newlinalg.dir/compiler_depend.ts | 2 + .../CMakeFiles/newlinalg.dir/depend.make | 2 + .../build/CMakeFiles/newlinalg.dir/flags.make | 12 + .../build/CMakeFiles/newlinalg.dir/link.txt | 1 + .../CMakeFiles/newlinalg.dir/progress.make | 5 + .../newlinalg.dir/src/newlinalg.c.o | Bin 0 -> 3288 bytes .../newlinalg.dir/src/newlinalg.c.o.d | 824 +++++ .../newlinalg.dir/src/xcomplexmatrix.c.o | Bin 0 -> 26360 bytes .../newlinalg.dir/src/xcomplexmatrix.c.o.d | 826 +++++ .../CMakeFiles/newlinalg.dir/src/xmatrix.c.o | Bin 0 -> 46992 bytes .../newlinalg.dir/src/xmatrix.c.o.d | 825 +++++ newlinalg/build/CMakeFiles/progress.marks | 1 + newlinalg/build/Makefile | 284 ++ newlinalg/build/cmake_install.cmake | 80 + newlinalg/build/install_manifest.txt | 1 + .../CMakeDirectoryInformation.cmake | 16 + newlinalg/build/src/CMakeFiles/progress.marks | 1 + newlinalg/build/src/Makefile | 189 ++ newlinalg/build/src/cmake_install.cmake | 45 + {src => newlinalg/src}/CMakeLists.txt | 0 {src => newlinalg/src}/newlinalg.c | 0 {src => newlinalg/src}/newlinalg.h | 0 {src => newlinalg/src}/xcomplexmatrix.c | 0 {src => newlinalg/src}/xcomplexmatrix.h | 0 {src => newlinalg/src}/xmatrix.c | 0 {src => newlinalg/src}/xmatrix.h | 0 newlinalg/test/FailedTests.txt | 0 .../test}/arithmetic/complexmatrix_acc.morpho | 0 .../complexmatrix_add_complexmatrix.morpho | 0 .../complexmatrix_add_matrix.morpho | 0 .../arithmetic/complexmatrix_add_nil.morpho | 0 .../complexmatrix_add_scalar.morpho | 0 .../complexmatrix_addr_matrix.morpho | 0 .../arithmetic/complexmatrix_addr_nil.morpho | 0 .../complexmatrix_div_complexmatrix.morpho | 0 .../complexmatrix_div_matrix.morpho | 0 .../complexmatrix_div_scalar.morpho | 0 .../complexmatrix_divr_matrix.morpho | 0 .../complexmatrix_mul_complex.morpho | 0 .../complexmatrix_mul_complexmatrix.morpho | 0 .../complexmatrix_mul_matrix.morpho | 0 .../complexmatrix_mul_scalar.morpho | 0 .../complexmatrix_mulr_complex.xmorpho | 0 .../complexmatrix_mulr_matrix.morpho | 0 .../complexmatrix_sub_complexmatrix.morpho | 0 .../complexmatrix_sub_matrix.morpho | 0 .../complexmatrix_sub_scalar.morpho | 0 .../complexmatrix_subr_matrix.morpho | 0 .../complexmatrix_subr_scalar.morpho | 0 .../test}/arithmetic/matrix_acc.morpho | 0 .../test}/arithmetic/matrix_add_matrix.morpho | 0 .../test}/arithmetic/matrix_add_nil.morpho | 0 .../test}/arithmetic/matrix_add_scalar.morpho | 0 .../test}/arithmetic/matrix_addr_nil.morpho | 0 .../arithmetic/matrix_addr_scalar.morpho | 0 .../test}/arithmetic/matrix_div_matrix.morpho | 0 .../test}/arithmetic/matrix_div_scalar.morpho | 0 .../test}/arithmetic/matrix_mul_matrix.morpho | 0 .../test}/arithmetic/matrix_mul_scalar.morpho | 0 .../test}/arithmetic/matrix_negate.morpho | 0 .../test}/arithmetic/matrix_sub_matrix.morpho | 0 .../test}/arithmetic/matrix_sub_scalar.morpho | 0 .../arithmetic/matrix_subr_scalar.morpho | 0 .../test}/assign/complexmatrix_assign.morpho | 0 .../test}/assign/complexmatrix_clone.morpho | 0 .../test}/assign/matrix_assign.morpho | 0 .../complexmatrix_array_constructor.morpho | 0 ...rray_constructor_invalid_dimensions.morpho | 0 .../complexmatrix_constructor.morpho | 0 ...omplexmatrix_constructor_edge_cases.morpho | 0 ...plexmatrix_constructor_invalid_args.morpho | 0 .../complexmatrix_list_constructor.morpho | 0 ...mplexmatrix_list_vector_constructor.morpho | 0 .../complexmatrix_matrix_constructor.morpho | 0 ...plexmatrix_tuple_column_constructor.morpho | 0 .../complexmatrix_tuple_constructor.morpho | 0 .../complexmatrix_vector_constructor.morpho | 0 .../matrix_array_constructor.morpho | 0 ...rray_constructor_invalid_dimensions.morpho | 0 .../constructors/matrix_constructor.morpho | 0 .../matrix_constructor_edge_cases.morpho | 0 .../matrix_identity_constructor.morpho | 0 .../matrix_list_constructor.morpho | 0 .../matrix_list_vector_constructor.morpho | 0 .../matrix_tuple_constructor.morpho | 0 .../matrix_vector_constructor.morpho | 0 .../constructors/vector_constructor.morpho | 0 ...mplexmatrix_incompatible_dimensions.morpho | 0 .../complexmatrix_index_out_of_bounds.morpho | 0 .../complexmatrix_non_square_error.morpho | 0 .../index/complexmatrix_getcolumn.morpho | 0 .../test}/index/complexmatrix_getindex.morpho | 0 .../index/complexmatrix_setcolumn.morpho | 0 .../test}/index/complexmatrix_setindex.morpho | 0 .../index/complexmatrix_setindex_real.morpho | 0 .../test}/index/complexmatrix_setslice.morpho | 0 .../test}/index/complexmatrix_slice.morpho | 0 .../test}/index/matrix_getcolumn.morpho | 0 .../test}/index/matrix_getindex.morpho | 0 .../test}/index/matrix_setcolumn.morpho | 0 .../test}/index/matrix_setindex.morpho | 0 .../test}/index/matrix_setslice.morpho | 0 .../test}/index/matrix_slice.morpho | 0 .../test}/index/matrix_slice_bounds.morpho | 0 .../index/matrix_slice_infinite_range.morpho | 0 .../test}/methods/complexmatrix_conj.morpho | 0 .../complexmatrix_conjTranspose.morpho | 0 .../test}/methods/complexmatrix_count.morpho | 0 .../methods/complexmatrix_dimensions.morpho | 0 .../methods/complexmatrix_eigensystem.morpho | 0 .../methods/complexmatrix_eigenvalues.morpho | 0 .../methods/complexmatrix_enumerate.morpho | 0 .../test}/methods/complexmatrix_format.morpho | 0 .../test}/methods/complexmatrix_imag.morpho | 0 .../test}/methods/complexmatrix_inner.morpho | 0 .../methods/complexmatrix_inverse.morpho | 0 .../complexmatrix_inverse_singular.morpho | 0 .../test}/methods/complexmatrix_norm.morpho | 0 .../test}/methods/complexmatrix_outer.morpho | 0 .../test}/methods/complexmatrix_qr.morpho | 0 .../test}/methods/complexmatrix_real.morpho | 0 .../methods/complexmatrix_reshape.morpho | 0 .../test}/methods/complexmatrix_roll.morpho | 0 .../complexmatrix_roll_negative.morpho | 0 .../test}/methods/complexmatrix_sum.morpho | 0 .../test}/methods/complexmatrix_svd.morpho | 0 .../test}/methods/complexmatrix_trace.morpho | 0 .../methods/complexmatrix_transpose.morpho | 0 .../test}/methods/matrix_count.morpho | 0 .../test}/methods/matrix_dimensions.morpho | 0 .../test}/methods/matrix_eigensystem.morpho | 0 .../test}/methods/matrix_eigenvalues.morpho | 0 .../test}/methods/matrix_enumerate.morpho | 0 .../test}/methods/matrix_format.morpho | 0 .../test}/methods/matrix_inner.morpho | 0 .../test}/methods/matrix_inverse.morpho | 0 .../methods/matrix_inverse_singular.morpho | 0 .../test}/methods/matrix_norm.morpho | 0 .../test}/methods/matrix_outer.morpho | 0 .../test}/methods/matrix_qr.morpho | 0 .../test}/methods/matrix_reshape.morpho | 0 .../test}/methods/matrix_roll.morpho | 0 .../test}/methods/matrix_sum.morpho | 0 .../test}/methods/matrix_svd.morpho | 0 .../test}/methods/matrix_trace.morpho | 0 .../test}/methods/matrix_transpose.morpho | 0 {test => newlinalg/test}/test.py | 0 172 files changed, 12268 insertions(+) rename CMakeLists.txt => newlinalg/CMakeLists.txt (100%) create mode 100644 newlinalg/build/CMakeCache.txt create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake create mode 100755 newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_C.bin create mode 100755 newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_CXX.bin create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c create mode 100755 newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/apple-sdk.c create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp create mode 100755 newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out create mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/apple-sdk.cpp create mode 100644 newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml create mode 100644 newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 newlinalg/build/CMakeFiles/InstallScripts.json create mode 100644 newlinalg/build/CMakeFiles/Makefile.cmake create mode 100644 newlinalg/build/CMakeFiles/Makefile2 create mode 100644 newlinalg/build/CMakeFiles/TargetDirectories.txt create mode 100644 newlinalg/build/CMakeFiles/cmake.check_cache create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/build.make create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/depend.make create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/flags.make create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/link.txt create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/progress.make create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o create mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d create mode 100644 newlinalg/build/CMakeFiles/progress.marks create mode 100644 newlinalg/build/Makefile create mode 100644 newlinalg/build/cmake_install.cmake create mode 100644 newlinalg/build/install_manifest.txt create mode 100644 newlinalg/build/src/CMakeFiles/CMakeDirectoryInformation.cmake create mode 100644 newlinalg/build/src/CMakeFiles/progress.marks create mode 100644 newlinalg/build/src/Makefile create mode 100644 newlinalg/build/src/cmake_install.cmake rename {src => newlinalg/src}/CMakeLists.txt (100%) rename {src => newlinalg/src}/newlinalg.c (100%) rename {src => newlinalg/src}/newlinalg.h (100%) rename {src => newlinalg/src}/xcomplexmatrix.c (100%) rename {src => newlinalg/src}/xcomplexmatrix.h (100%) rename {src => newlinalg/src}/xmatrix.c (100%) rename {src => newlinalg/src}/xmatrix.h (100%) create mode 100644 newlinalg/test/FailedTests.txt rename {test => newlinalg/test}/arithmetic/complexmatrix_acc.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_addr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_addr_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_div_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_div_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_div_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_divr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_complex.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mulr_complex.xmorpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mulr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_sub_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_sub_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_sub_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_subr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_subr_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_acc.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_add_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_add_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_add_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_addr_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_addr_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_div_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_div_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_mul_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_mul_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_negate.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_sub_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_sub_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_subr_scalar.morpho (100%) rename {test => newlinalg/test}/assign/complexmatrix_assign.morpho (100%) rename {test => newlinalg/test}/assign/complexmatrix_clone.morpho (100%) rename {test => newlinalg/test}/assign/matrix_assign.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_array_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_constructor_edge_cases.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_constructor_invalid_args.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_list_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_list_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_matrix_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_tuple_column_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_tuple_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_array_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_array_constructor_invalid_dimensions.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_constructor_edge_cases.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_identity_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_list_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_list_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_tuple_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/vector_constructor.morpho (100%) rename {test => newlinalg/test}/errors/complexmatrix_incompatible_dimensions.morpho (100%) rename {test => newlinalg/test}/errors/complexmatrix_index_out_of_bounds.morpho (100%) rename {test => newlinalg/test}/errors/complexmatrix_non_square_error.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_getcolumn.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_getindex.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setcolumn.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setindex.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setindex_real.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setslice.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_slice.morpho (100%) rename {test => newlinalg/test}/index/matrix_getcolumn.morpho (100%) rename {test => newlinalg/test}/index/matrix_getindex.morpho (100%) rename {test => newlinalg/test}/index/matrix_setcolumn.morpho (100%) rename {test => newlinalg/test}/index/matrix_setindex.morpho (100%) rename {test => newlinalg/test}/index/matrix_setslice.morpho (100%) rename {test => newlinalg/test}/index/matrix_slice.morpho (100%) rename {test => newlinalg/test}/index/matrix_slice_bounds.morpho (100%) rename {test => newlinalg/test}/index/matrix_slice_infinite_range.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_conj.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_conjTranspose.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_count.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_dimensions.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_eigensystem.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_eigenvalues.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_enumerate.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_format.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_imag.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_inner.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_inverse.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_inverse_singular.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_norm.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_outer.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_qr.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_real.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_reshape.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_roll.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_roll_negative.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_sum.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_svd.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_trace.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_transpose.morpho (100%) rename {test => newlinalg/test}/methods/matrix_count.morpho (100%) rename {test => newlinalg/test}/methods/matrix_dimensions.morpho (100%) rename {test => newlinalg/test}/methods/matrix_eigensystem.morpho (100%) rename {test => newlinalg/test}/methods/matrix_eigenvalues.morpho (100%) rename {test => newlinalg/test}/methods/matrix_enumerate.morpho (100%) rename {test => newlinalg/test}/methods/matrix_format.morpho (100%) rename {test => newlinalg/test}/methods/matrix_inner.morpho (100%) rename {test => newlinalg/test}/methods/matrix_inverse.morpho (100%) rename {test => newlinalg/test}/methods/matrix_inverse_singular.morpho (100%) rename {test => newlinalg/test}/methods/matrix_norm.morpho (100%) rename {test => newlinalg/test}/methods/matrix_outer.morpho (100%) rename {test => newlinalg/test}/methods/matrix_qr.morpho (100%) rename {test => newlinalg/test}/methods/matrix_reshape.morpho (100%) rename {test => newlinalg/test}/methods/matrix_roll.morpho (100%) rename {test => newlinalg/test}/methods/matrix_sum.morpho (100%) rename {test => newlinalg/test}/methods/matrix_svd.morpho (100%) rename {test => newlinalg/test}/methods/matrix_trace.morpho (100%) rename {test => newlinalg/test}/methods/matrix_transpose.morpho (100%) rename {test => newlinalg/test}/test.py (100%) diff --git a/CMakeLists.txt b/newlinalg/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to newlinalg/CMakeLists.txt diff --git a/newlinalg/build/CMakeCache.txt b/newlinalg/build/CMakeCache.txt new file mode 100644 index 000000000..12494014b --- /dev/null +++ b/newlinalg/build/CMakeCache.txt @@ -0,0 +1,404 @@ +# This is the CMakeCache file. +# For build in directory: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build +# It was generated by CMake: /opt/homebrew/bin/cmake +# You can edit this file to change values found and used by cmake. +# If you do not want to change any of the values, simply exit the editor. +# If you do want to change a value, simply edit, save, and exit the editor. +# The syntax for the file is as follows: +# KEY:TYPE=VALUE +# KEY is the name of a variable in the cache. +# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. +# VALUE is the current value for the KEY. + +######################## +# EXTERNAL cache entries +######################## + +//Path to a file. +CBLAS_INCLUDE:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers + +//Path to a library. +CBLAS_LIBRARY:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd + +//Path to a program. +CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND + +//Path to a program. +CMAKE_AR:FILEPATH=/usr/bin/ar + +//Choose the type of build, options are: None Debug Release RelWithDebInfo +// MinSizeRel ... +CMAKE_BUILD_TYPE:STRING= + +//Enable/Disable color output during build. +CMAKE_COLOR_MAKEFILE:BOOL=ON + +//CXX compiler +CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ + +//Flags used by the CXX compiler during all build types. +CMAKE_CXX_FLAGS:STRING= + +//Flags used by the CXX compiler during DEBUG builds. +CMAKE_CXX_FLAGS_DEBUG:STRING=-g + +//Flags used by the CXX compiler during MINSIZEREL builds. +CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the CXX compiler during RELEASE builds. +CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the CXX compiler during RELWITHDEBINFO builds. +CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//C compiler +CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc + +//Flags used by the C compiler during all build types. +CMAKE_C_FLAGS:STRING= + +//Flags used by the C compiler during DEBUG builds. +CMAKE_C_FLAGS_DEBUG:STRING=-g + +//Flags used by the C compiler during MINSIZEREL builds. +CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG + +//Flags used by the C compiler during RELEASE builds. +CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG + +//Flags used by the C compiler during RELWITHDEBINFO builds. +CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG + +//Path to a program. +CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND + +//Flags used by the linker during all build types. +CMAKE_EXE_LINKER_FLAGS:STRING= + +//Flags used by the linker during DEBUG builds. +CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during MINSIZEREL builds. +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during RELEASE builds. +CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during RELWITHDEBINFO builds. +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Enable/Disable output of compile commands during generation. +CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= + +//Value Computed by CMake. +CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/pkgRedirects + +//Path to a program. +CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool + +//Install path prefix, prepended onto install directories. +CMAKE_INSTALL_PREFIX:PATH=/usr/local + +//Path to a program. +CMAKE_LINKER:FILEPATH=/usr/bin/ld + +//Path to a program. +CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make + +//Flags used by the linker during the creation of modules during +// all build types. +CMAKE_MODULE_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of modules during +// DEBUG builds. +CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of modules during +// MINSIZEREL builds. +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of modules during +// RELEASE builds. +CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of modules during +// RELWITHDEBINFO builds. +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_NM:FILEPATH=/usr/bin/nm + +//Path to a program. +CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND + +//Path to a program. +CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump + +//Build architectures for OSX +CMAKE_OSX_ARCHITECTURES:STRING= + +//Minimum OS X version to target for deployment (at runtime); newer +// APIs weak linked. Set to empty string for default value. +CMAKE_OSX_DEPLOYMENT_TARGET:STRING= + +//The product will be built against the headers and libraries located +// inside the indicated SDK. +CMAKE_OSX_SYSROOT:STRING= + +//Value Computed by CMake +CMAKE_PROJECT_COMPAT_VERSION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_DESCRIPTION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_HOMEPAGE_URL:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_NAME:STATIC=morpho-newlinalg + +//Value Computed by CMake +CMAKE_PROJECT_VERSION:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_VERSION_MAJOR:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_VERSION_MINOR:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_VERSION_PATCH:STATIC= + +//Value Computed by CMake +CMAKE_PROJECT_VERSION_TWEAK:STATIC= + +//Path to a program. +CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib + +//Path to a program. +CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND + +//Flags used by the linker during the creation of shared libraries +// during all build types. +CMAKE_SHARED_LINKER_FLAGS:STRING= + +//Flags used by the linker during the creation of shared libraries +// during DEBUG builds. +CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the linker during the creation of shared libraries +// during MINSIZEREL builds. +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELEASE builds. +CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the linker during the creation of shared libraries +// during RELWITHDEBINFO builds. +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//If set, runtime paths are not added when installing shared libraries, +// but are added when building. +CMAKE_SKIP_INSTALL_RPATH:BOOL=NO + +//If set, runtime paths are not added when using shared libraries. +CMAKE_SKIP_RPATH:BOOL=NO + +//Flags used by the archiver during the creation of static libraries +// during all build types. +CMAKE_STATIC_LINKER_FLAGS:STRING= + +//Flags used by the archiver during the creation of static libraries +// during DEBUG builds. +CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= + +//Flags used by the archiver during the creation of static libraries +// during MINSIZEREL builds. +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= + +//Flags used by the archiver during the creation of static libraries +// during RELEASE builds. +CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= + +//Flags used by the archiver during the creation of static libraries +// during RELWITHDEBINFO builds. +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= + +//Path to a program. +CMAKE_STRIP:FILEPATH=/usr/bin/strip + +//Path to a program. +CMAKE_TAPI:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi + +//If this value is on, makefiles will be generated without the +// .SILENT directive, and all commands will be echoed to the console +// during the make. This is useful for debugging only. With Visual +// Studio IDE projects all commands are done without /nologo. +CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE + +//Path to a library. +LAPACK_LIBRARY:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd + +//Path to a file. +MORPHO_HEADER:FILEPATH=/usr/local/include/morpho/morpho.h + +//Path to a library. +MORPHO_LIBRARY:FILEPATH=/usr/local/lib/libmorpho.dylib + +//Value Computed by CMake +morpho-newlinalg_BINARY_DIR:STATIC=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build + +//Value Computed by CMake +morpho-newlinalg_IS_TOP_LEVEL:STATIC=ON + +//Value Computed by CMake +morpho-newlinalg_SOURCE_DIR:STATIC=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg + + +######################## +# INTERNAL cache entries +######################## + +//ADVANCED property for variable: CMAKE_ADDR2LINE +CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_AR +CMAKE_AR-ADVANCED:INTERNAL=1 +//This is the directory where this CMakeCache.txt was created +CMAKE_CACHEFILE_DIR:INTERNAL=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build +//Major version of cmake used to create the current loaded cache +CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4 +//Minor version of cmake used to create the current loaded cache +CMAKE_CACHE_MINOR_VERSION:INTERNAL=1 +//Patch version of cmake used to create the current loaded cache +CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 +//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE +CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 +//Path to CMake executable. +CMAKE_COMMAND:INTERNAL=/opt/homebrew/bin/cmake +//Path to cpack program executable. +CMAKE_CPACK_COMMAND:INTERNAL=/opt/homebrew/bin/cpack +//Path to ctest program executable. +CMAKE_CTEST_COMMAND:INTERNAL=/opt/homebrew/bin/ctest +//ADVANCED property for variable: CMAKE_CXX_COMPILER +CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG +CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_COMPILER +CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS +CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO +CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_DLLTOOL +CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 +//Path to cache edit program executable. +CMAKE_EDIT_COMMAND:INTERNAL=/opt/homebrew/bin/ccmake +//Executable file format +CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS +CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 +//Name of external makefile project generator. +CMAKE_EXTRA_GENERATOR:INTERNAL= +//Name of generator. +CMAKE_GENERATOR:INTERNAL=Unix Makefiles +//Generator instance identifier. +CMAKE_GENERATOR_INSTANCE:INTERNAL= +//Name of generator platform. +CMAKE_GENERATOR_PLATFORM:INTERNAL= +//Name of generator toolset. +CMAKE_GENERATOR_TOOLSET:INTERNAL= +//Source directory with the top level CMakeLists.txt file for this +// project +CMAKE_HOME_DIRECTORY:INTERNAL=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg +//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL +CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_LINKER +CMAKE_LINKER-ADVANCED:INTERNAL=1 +//Name of CMakeLists files to read +CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt +//ADVANCED property for variable: CMAKE_MAKE_PROGRAM +CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_NM +CMAKE_NM-ADVANCED:INTERNAL=1 +//number of local generators +CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=2 +//ADVANCED property for variable: CMAKE_OBJCOPY +CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_OBJDUMP +CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 +//Platform information initialized +CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_RANLIB +CMAKE_RANLIB-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_READELF +CMAKE_READELF-ADVANCED:INTERNAL=1 +//Path to CMake installation. +CMAKE_ROOT:INTERNAL=/opt/homebrew/share/cmake +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH +CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_SKIP_RPATH +CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS +CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG +CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL +CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE +CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO +CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_STRIP +CMAKE_STRIP-ADVANCED:INTERNAL=1 +//ADVANCED property for variable: CMAKE_TAPI +CMAKE_TAPI-ADVANCED:INTERNAL=1 +//uname command +CMAKE_UNAME:INTERNAL=/usr/bin/uname +//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE +CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 + diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake b/newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake new file mode 100644 index 000000000..19a664d89 --- /dev/null +++ b/newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake @@ -0,0 +1,84 @@ +set(CMAKE_C_COMPILER "/usr/bin/cc") +set(CMAKE_C_COMPILER_ARG1 "") +set(CMAKE_C_COMPILER_ID "AppleClang") +set(CMAKE_C_COMPILER_VERSION "17.0.0.17000013") +set(CMAKE_C_COMPILER_VERSION_INTERNAL "") +set(CMAKE_C_COMPILER_WRAPPER "") +set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") +set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_C_STANDARD_LATEST "23") +set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") +set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") +set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") +set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") +set(CMAKE_C17_COMPILE_FEATURES "c_std_17") +set(CMAKE_C23_COMPILE_FEATURES "c_std_23") + +set(CMAKE_C_PLATFORM_ID "Darwin") +set(CMAKE_C_SIMULATE_ID "") +set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_C_COMPILER_APPLE_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk") +set(CMAKE_C_SIMULATE_VERSION "") +set(CMAKE_C_COMPILER_ARCHITECTURE_ID "arm64") + + + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_C_COMPILER_AR "") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_C_COMPILER_RANLIB "") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_C_COMPILER_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_C_COMPILER_LINKER_ID "AppleClang") +set(CMAKE_C_COMPILER_LINKER_VERSION 1167.5) +set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT GNU) +set(CMAKE_MT "") +set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") +set(CMAKE_COMPILER_IS_GNUCC ) +set(CMAKE_C_COMPILER_LOADED 1) +set(CMAKE_C_COMPILER_WORKS TRUE) +set(CMAKE_C_ABI_COMPILED TRUE) + +set(CMAKE_C_COMPILER_ENV_VAR "CC") + +set(CMAKE_C_COMPILER_ID_RUN 1) +set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) +set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) +set(CMAKE_C_LINKER_PREFERENCE 10) +set(CMAKE_C_LINKER_DEPFILE_SUPPORTED ) +set(CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED ) +set(CMAKE_C_LINKER_PUSHPOP_STATE_SUPPORTED ) + +# Save compiler ABI information. +set(CMAKE_C_SIZEOF_DATA_PTR "8") +set(CMAKE_C_COMPILER_ABI "") +set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_C_LIBRARY_ARCHITECTURE "") + +if(CMAKE_C_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_C_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") +endif() + +if(CMAKE_C_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") +set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") +set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift") +set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks") diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake b/newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake new file mode 100644 index 000000000..030ebedcf --- /dev/null +++ b/newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake @@ -0,0 +1,104 @@ +set(CMAKE_CXX_COMPILER "/usr/bin/c++") +set(CMAKE_CXX_COMPILER_ARG1 "") +set(CMAKE_CXX_COMPILER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_VERSION "17.0.0.17000013") +set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") +set(CMAKE_CXX_COMPILER_WRAPPER "") +set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") +set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") +set(CMAKE_CXX_STANDARD_LATEST "23") +set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") +set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") +set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") +set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") +set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") +set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") +set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") +set(CMAKE_CXX26_COMPILE_FEATURES "") + +set(CMAKE_CXX_PLATFORM_ID "Darwin") +set(CMAKE_CXX_SIMULATE_ID "") +set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") +set(CMAKE_CXX_COMPILER_APPLE_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk") +set(CMAKE_CXX_SIMULATE_VERSION "") +set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "arm64") + + + +set(CMAKE_AR "/usr/bin/ar") +set(CMAKE_CXX_COMPILER_AR "") +set(CMAKE_RANLIB "/usr/bin/ranlib") +set(CMAKE_CXX_COMPILER_RANLIB "") +set(CMAKE_LINKER "/usr/bin/ld") +set(CMAKE_LINKER_LINK "") +set(CMAKE_LINKER_LLD "") +set(CMAKE_CXX_COMPILER_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") +set(CMAKE_CXX_COMPILER_LINKER_ID "AppleClang") +set(CMAKE_CXX_COMPILER_LINKER_VERSION 1167.5) +set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT GNU) +set(CMAKE_MT "") +set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") +set(CMAKE_COMPILER_IS_GNUCXX ) +set(CMAKE_CXX_COMPILER_LOADED 1) +set(CMAKE_CXX_COMPILER_WORKS TRUE) +set(CMAKE_CXX_ABI_COMPILED TRUE) + +set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") + +set(CMAKE_CXX_COMPILER_ID_RUN 1) +set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) +set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) + +foreach (lang IN ITEMS C OBJC OBJCXX) + if (CMAKE_${lang}_COMPILER_ID_RUN) + foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) + list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) + endforeach() + endif() +endforeach() + +set(CMAKE_CXX_LINKER_PREFERENCE 30) +set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) +set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED ) +set(CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED ) +set(CMAKE_CXX_LINKER_PUSHPOP_STATE_SUPPORTED ) + +# Save compiler ABI information. +set(CMAKE_CXX_SIZEOF_DATA_PTR "8") +set(CMAKE_CXX_COMPILER_ABI "") +set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") +set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") + +if(CMAKE_CXX_SIZEOF_DATA_PTR) + set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") +endif() + +if(CMAKE_CXX_COMPILER_ABI) + set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") +endif() + +if(CMAKE_CXX_LIBRARY_ARCHITECTURE) + set(CMAKE_LIBRARY_ARCHITECTURE "") +endif() + +set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") +if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) + set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") +endif() + + + + + +set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") +set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") +set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift") +set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks") +set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "") + +set(CMAKE_CXX_COMPILER_IMPORT_STD "") +### Imported target for C++23 standard library +set(CMAKE_CXX23_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE "Unsupported generator: Unix Makefiles") + + + diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_C.bin b/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_C.bin new file mode 100755 index 0000000000000000000000000000000000000000..49baf3fc6880192893bbf1fa61ae89d447472c51 GIT binary patch literal 33560 zcmeI5Uuau(6vux_Q%PuDTJg`cQzH&pMOy#Vt&}0jOqON~Y0*4{b@C&BZraP5M3a;@ zqhiJ!D7r0U56(RaD|QcxY!fjLoe})A2VpIa2|mcCOjgAQQP6I%c+T(MEPq-Q+=CB( z51jk^opbK*-1Ga~n;(5C=lr!_ZgdJ^5hPa9Zc>*`hy%h!Ga>FJ9VV4>)Z_Q<@;x`g z-eysYn_a6c&hr}GC}r3e2{(t;dUvx=n07n4S*au?Qs%XpylK$Tn$K-FHd8WhVVn1L zQ*5Gmb50W}p0G9FqM5H&a?Nhc(Kx4kxqMbnkDJccd>b7`eaxAK?M7*;l>$;u zrKk0DLh9*cM%m5$2F-jCGYQ+RIU4ixdpM@@cs*fHL&R-<1T-pX8QaLoT6@=0CZhSM zx>H@GTst4(GsJDIubHi5{W}W=LOXrlKn-}Yr7p5r)^jl=Tu-egwg-eLcJZVr1T%Tc zv?F8>lg(__lb$5|HX7~wgqWeRgLIUXrM6cd`JR6x>u8aSlzv;He=3*lpVVXhiNa)p zY?dBUuH$P*;P_X+Z9ROn_xzO;Tl~XMlFvnI?8!+Vzf;ZCcH0lz9;KMtAB`-VXn&lC zzw<`n=MIu`%=jMs^fR*5YoU6cFXZxCs&88#)uqRb)sN7?`QIrL8yb5}n|ZO^Ps;Hk zaXV%d$!-V;fWZHdKy|-Zsy-;nmwH6`a)(%{Iz@T8r&y-5qh$9ye8izI4_80wddFL-~T#vKcKgmJMu^{*W)=4S57b)tXo#ugOd{p=HN{fp9qJlfIBQ;0e{@ z(QJHTESgPi9w3i#K5sDJcjL%sEuY119!dG{1s1ou)-QaXchY&>WuEkO=<`wt2!H?x zfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=9 z00@8p2!H?xfB*=900@8p2!H?xfB*<60INfgAE+N;bOs=X- zs>%$1y=AbB>ElvMC-i7qtcp$Q`TV5T9OiDqRDlrJzU!<|MQ_oR%VN2cd{n7rzpxU0 ztJ+GO{1Fuuf_A*G=(4KT@}}!=hmsk!#8csCW$X!U%hTfB&w{(ZT&cc1|NS4mM?cwm z&VTlDaL=KY3%fsJp1{n`;yahzkb@YaD3;&jV|ww4a>8yUR*plP&whfeyjQaY5m;qoA27?Jv8*E e_2ZxCuB0BQXrmvUPX6@Lnd=V~O7qVg6n_Cro1I7i literal 0 HcmV?d00001 diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_CXX.bin b/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_CXX.bin new file mode 100755 index 0000000000000000000000000000000000000000..a7dcd17269852a77104fb145b9c7ee8feeea379a GIT binary patch literal 33560 zcmeI5QD~c06vuDUbW3g5)+xGCx1}KBoU~h3Ydd^Mwx(S$q){`Ct#VD1ukFX$WPV9m zQ#zVa2NgxT2i-&;Hn1o%Ut}T$b!Ez4lu2I{i;fLnR!~qBb$wVp=YHSUe#wf0dvg8{ zoZNfvIrsG3UvA;{p`5Rle!5;GgiDaPNjH+lJVG23KAH)!nRGv?l(Aq}s3-JzH?Nk8 z+FZJHgT;BKC{W6HC=oAptNnq}HDTG6w9HB+DUmX-jpi+bhVp!))?uct5VrYTE8-Ew zl{rnMOl32<)r95wycRC7@AB*;qk~toC;;WjdKpsz~)A z<=XkYc1Xb7Z=2=g>OG5uqmPCey9oT9OsG)Bt8ca4=}Ip*I;Ep76V()AO~BRQjaNbhS-7lzVgvow%$ z9iP6PoOo^F;V;i^SeHBT+v_uaTJw>bXR4#iU#I5kxRtMZ9w47OAB`;c)A=|L-*cz1 z$>(LCx({cE)^paCTBx4XjvYYgZcoL?M^ghMV?UTPRwH`$)N- zsiF}4U2nH+=F75$l>Nn{bnnbV@iGJiKmY_l00cnbe@I|?Qp_)J6SJ2a#O#%7ac#Ly z%q}(*XXy>K{5l-%?B0{p$Fyv}OdrY{y*t~U6(Sn$?(Ex>FG$VEYUy4hyjONbL*b5SP>@&c z=_}+lnKjay(HjZJ5R{lGK zC7?c6KlmM3L+`SB^(rL8XFl&%BQOI25C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X z009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T8&A2$cW-`K@#| zoCO3x00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l z00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1pZ3|d{k`AQm)(C zrkneq+rquXZBg?8bw>}_E2aB{ONx!`a+6kwKPlcVhX?n(X%p zxkedMl_6zMWLK-6>CZ|>Cs5kZ6Y-nNtIa-TpFSY9Oj=K7%z$>a&k-=B=kr6FGsXcchVXi!!;?~MBlBBl%n;7@(NKU#L=S9ty;EQOMg2|TV7Xc zIKEH%{VnaS;)nR*H(v3aUz)k&$U_J2KHd7faq9fQg(K~6EnK`<|JJ?(Rh8^7z^Dv11FLytMzt2j96_|H<8Fu6J&E*Vz7KqqlbPU}I;)dy}0L zKaO0PX+3vf@U!uo&HqpPxBYS26MOpi?_co0{OhGtPdye~|M`deKK^3jwy}@4_I!Kq GX7LvatDKww literal 0 HcmV?d00001 diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake b/newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake new file mode 100644 index 000000000..0c52e24fd --- /dev/null +++ b/newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake @@ -0,0 +1,15 @@ +set(CMAKE_HOST_SYSTEM "Darwin-24.3.0") +set(CMAKE_HOST_SYSTEM_NAME "Darwin") +set(CMAKE_HOST_SYSTEM_VERSION "24.3.0") +set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") + + + +set(CMAKE_SYSTEM "Darwin-24.3.0") +set(CMAKE_SYSTEM_NAME "Darwin") +set(CMAKE_SYSTEM_VERSION "24.3.0") +set(CMAKE_SYSTEM_PROCESSOR "arm64") + +set(CMAKE_CROSSCOMPILING "FALSE") + +set(CMAKE_SYSTEM_LOADED 1) diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c new file mode 100644 index 000000000..ab3c35931 --- /dev/null +++ b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c @@ -0,0 +1,934 @@ +#ifdef __cplusplus +# error "A C++ compiler has been selected for C." +#endif + +#if defined(__18CXX) +# define ID_VOID_MAIN +#endif +#if defined(__CLASSIC_C__) +/* cv-qualifiers did not exist in K&R C */ +# define const +# define volatile +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_C) +# define COMPILER_ID "SunPro" +# if __SUNPRO_C >= 0x5100 + /* __SUNPRO_C = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) +# endif + +#elif defined(__HP_cc) +# define COMPILER_ID "HP" + /* __HP_cc = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) + +#elif defined(__DECC) +# define COMPILER_ID "Compaq" + /* __DECC_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) + +#elif defined(__IBMC__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 +# define COMPILER_ID "XL" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMC__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__RENESAS__) +# define COMPILER_ID "Renesas" +/* __RENESAS_VERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF) + +#elif defined(__TINYC__) +# define COMPILER_ID "TinyCC" + +#elif defined(__BCC__) +# define COMPILER_ID "Bruce" + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) +# define COMPILER_ID "GNU" +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__DCC__) && defined(_DIAB_TOOL) +# define COMPILER_ID "Diab" + # define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__) + # define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__) + # define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__) + # define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__) + + +#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) +# define COMPILER_ID "SDCC" +# if defined(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) +# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) +# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) +# else + /* SDCC = VRP */ +# define COMPILER_VERSION_MAJOR DEC(SDCC/100) +# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) +# define COMPILER_VERSION_PATCH DEC(SDCC % 10) +# endif + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "ARM" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) || defined(__CPARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__RENESAS__) +# if defined(__CCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__CCRL__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__CCRH__) +# define ARCHITECTURE_ID "RH850" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define C_STD_99 199901L +#define C_STD_11 201112L +#define C_STD_17 201710L +#define C_STD_23 202311L + +#ifdef __STDC_VERSION__ +# define C_STD __STDC_VERSION__ +#endif + +#if !defined(__STDC__) && !defined(__clang__) && !defined(__RENESAS__) +# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) +# define C_VERSION "90" +# else +# define C_VERSION +# endif +#elif C_STD > C_STD_17 +# define C_VERSION "23" +#elif C_STD > C_STD_11 +# define C_VERSION "17" +#elif C_STD > C_STD_99 +# define C_VERSION "11" +#elif C_STD >= C_STD_99 +# define C_VERSION "99" +#else +# define C_VERSION "90" +#endif +const char* info_language_standard_default = + "INFO" ":" "standard_default[" C_VERSION "]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +#ifdef ID_VOID_MAIN +void main() {} +#else +# if defined(__CLASSIC_C__) +int main(argc, argv) int argc; char *argv[]; +# else +int main(int argc, char* argv[]) +# endif +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR) + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} +#endif diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out new file mode 100755 index 0000000000000000000000000000000000000000..a27d804924265c7ec7ca192bab4f890795f56aaa GIT binary patch literal 33736 zcmeI5Uuau(6vt1})F!qynU=Xx?c&39%1F~z>`=sXw%e*(Te>|&>-_DuxoxxMpGm5l z%r2V@>QvSWLhaMuhPu7XDJ?iCD$)l*`l3!y>R(ovAR^2Sv7U49FKL>_DQ=J71LywE z`JLbI+;czom%JtC^J~BSRYT+;7ANZ(R=~irgIFe91&+xxmtVQ##)xI*It#6QxEHFGLd& z6-^8#d0}b3uXMh!P9lD3O~v`;Jxp48+S~TD6-7e&5b$V8$ymXYqSm|OQK^WLHQ3Oi zRQY_H@(V)t{=8c{E}yfVon23Mw0GvuNUo$V_C@BT7#67~Uz7L`66JhicRHayj$V{#$38dCt%3U?uYM;rCj$^|+NMT@UcA^?X*Gi23Fu&ptlq#Ul6J z!YVQQJZ!g4N}(36XZN8@){F9r>xaE>JG~;%7sxReZmDh=R%Eu%Z z*E{ZxuAL~Gv$p&`tClt8V+&jt*FP~^p}y$s+SdK>Kr)_+#>{kITPhVZACDP{p}k~9 zQZXYtm`um}+Kn`ST=lGx9vJS^b|z~iB1Sr*BIckm63g~Awdx3epP7kFl)p9#vFD8QU(k}K)_`pUgUd!!tIRdE?3I@xujVfOR*FYC3vyOMJc{PO&%`bkId3(b z#ivgq`Smd>UIZHiKmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l z00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1VG@X6R>~(>7%XI z@6de|)?-AEqta-A#cjofYD1zO+*|ZE(>Tudbje?$TZh?r^eL=%HaMd7#+P0(1rc3CYVWqTdc>D=bAR($?11YgMZ z@6o@~&xZ8o7T-^*OwG!w*&<+@1q`-Z zU{Qu^$%<8!?RWv9?dCZuixSs$?c17JuJ8>urA(1Jo?~2&QF3zeP7B?$JRi2AL>{7J zLBEsRiT^j5)5{!2AUTqysvdXew)f6?Kk!`q==`W*GzH%EK69Yz=Od?#U!QBZFn#vO znRDUfr;CHLt}o~34>-HSl}m@uAAa%p*B4&h@yh1YHyZ!V*|5;~{_XB3HlGN*6R+EO zcH;N`KU#V(Uhb%S=)RUedv7%VzwLkX diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp new file mode 100644 index 000000000..b35f567c2 --- /dev/null +++ b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp @@ -0,0 +1,949 @@ +/* This source file must have a .cpp extension so that all C++ compilers + recognize the extension without flags. Borland does not know .cxx for + example. */ +#ifndef __cplusplus +# error "A C compiler has been selected for C++." +#endif + +#if !defined(__has_include) +/* If the compiler does not have __has_include, pretend the answer is + always no. */ +# define __has_include(x) 0 +#endif + + +/* Version number components: V=Version, R=Revision, P=Patch + Version date components: YYYY=Year, MM=Month, DD=Day */ + +#if defined(__INTEL_COMPILER) || defined(__ICC) +# define COMPILER_ID "Intel" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# if defined(__GNUC__) +# define SIMULATE_ID "GNU" +# endif + /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, + except that a few beta releases use the old format with V=2021. */ +# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) +# if defined(__INTEL_COMPILER_UPDATE) +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) +# else +# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) +# endif +# else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) +# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) + /* The third version component from --version is an update index, + but no macro is provided for it. */ +# define COMPILER_VERSION_PATCH DEC(0) +# endif +# if defined(__INTEL_COMPILER_BUILD_DATE) + /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ +# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) +# endif +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) +# define COMPILER_ID "IntelLLVM" +#if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +#endif +#if defined(__GNUC__) +# define SIMULATE_ID "GNU" +#endif +/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and + * later. Look for 6 digit vs. 8 digit version number to decide encoding. + * VVVV is no smaller than the current year when a version is released. + */ +#if __INTEL_LLVM_COMPILER < 1000000L +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) +#else +# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) +# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) +#endif +#if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +#endif +#if defined(__GNUC__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +#elif defined(__GNUG__) +# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) +#endif +#if defined(__GNUC_MINOR__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +#endif +#if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +#endif + +#elif defined(__PATHCC__) +# define COMPILER_ID "PathScale" +# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) +# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) +# if defined(__PATHCC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) +# endif + +#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) +# define COMPILER_ID "Embarcadero" +# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) +# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) +# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) + +#elif defined(__BORLANDC__) +# define COMPILER_ID "Borland" + /* __BORLANDC__ = 0xVRR */ +# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) +# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) + +#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 +# define COMPILER_ID "Watcom" + /* __WATCOMC__ = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__WATCOMC__) +# define COMPILER_ID "OpenWatcom" + /* __WATCOMC__ = VVRP + 1100 */ +# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) +# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) +# if (__WATCOMC__ % 10) > 0 +# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) +# endif + +#elif defined(__SUNPRO_CC) +# define COMPILER_ID "SunPro" +# if __SUNPRO_CC >= 0x5100 + /* __SUNPRO_CC = 0xVRRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# else + /* __SUNPRO_CC = 0xVRP */ +# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) +# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) +# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) +# endif + +#elif defined(__HP_aCC) +# define COMPILER_ID "HP" + /* __HP_aCC = VVRRPP */ +# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) +# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) +# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) + +#elif defined(__DECCXX) +# define COMPILER_ID "Compaq" + /* __DECCXX_VER = VVRRTPPPP */ +# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) +# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) +# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) + +#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__open_xl__) && defined(__clang__) +# define COMPILER_ID "IBMClang" +# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) +# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) +# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__ibmxl__) && defined(__clang__) +# define COMPILER_ID "XLClang" +# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) +# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) +# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) +# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) + + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 +# define COMPILER_ID "XL" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 +# define COMPILER_ID "VisualAge" + /* __IBMCPP__ = VRP */ +# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) +# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) +# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) + +#elif defined(__NVCOMPILER) +# define COMPILER_ID "NVHPC" +# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) +# if defined(__NVCOMPILER_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) +# endif + +#elif defined(__PGI) +# define COMPILER_ID "PGI" +# define COMPILER_VERSION_MAJOR DEC(__PGIC__) +# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) +# if defined(__PGIC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) +# endif + +#elif defined(__clang__) && defined(__cray__) +# define COMPILER_ID "CrayClang" +# define COMPILER_VERSION_MAJOR DEC(__cray_major__) +# define COMPILER_VERSION_MINOR DEC(__cray_minor__) +# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(_CRAYC) +# define COMPILER_ID "Cray" +# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) +# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) + +#elif defined(__TI_COMPILER_VERSION__) +# define COMPILER_ID "TI" + /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ +# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) +# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) +# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) + +#elif defined(__CLANG_FUJITSU) +# define COMPILER_ID "FujitsuClang" +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# define COMPILER_VERSION_INTERNAL_STR __clang_version__ + + +#elif defined(__FUJITSU) +# define COMPILER_ID "Fujitsu" +# if defined(__FCC_version__) +# define COMPILER_VERSION __FCC_version__ +# elif defined(__FCC_major__) +# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) +# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) +# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) +# endif +# if defined(__fcc_version) +# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) +# elif defined(__FCC_VERSION) +# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) +# endif + + +#elif defined(__ghs__) +# define COMPILER_ID "GHS" +/* __GHS_VERSION_NUMBER = VVVVRP */ +# ifdef __GHS_VERSION_NUMBER +# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) +# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) +# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) +# endif + +#elif defined(__TASKING__) +# define COMPILER_ID "Tasking" + # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) + # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) +# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) + +#elif defined(__ORANGEC__) +# define COMPILER_ID "OrangeC" +# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) +# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) + +#elif defined(__RENESAS__) +# define COMPILER_ID "Renesas" +/* __RENESAS_VERSION__ = 0xVVRRPP00 */ +# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF) + +#elif defined(__SCO_VERSION__) +# define COMPILER_ID "SCO" + +#elif defined(__ARMCC_VERSION) && !defined(__clang__) +# define COMPILER_ID "ARMCC" +#if __ARMCC_VERSION >= 1000000 + /* __ARMCC_VERSION = VRRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#else + /* __ARMCC_VERSION = VRPPPP */ + # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) + # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) + # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) +#endif + + +#elif defined(__clang__) && defined(__apple_build_version__) +# define COMPILER_ID "AppleClang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif +# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) + +#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) +# define COMPILER_ID "ARMClang" + # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) + # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) + # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) +# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) + +#elif defined(__clang__) && defined(__ti__) +# define COMPILER_ID "TIClang" + # define COMPILER_VERSION_MAJOR DEC(__ti_major__) + # define COMPILER_VERSION_MINOR DEC(__ti_minor__) + # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) +# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) + +#elif defined(__clang__) +# define COMPILER_ID "Clang" +# if defined(_MSC_VER) +# define SIMULATE_ID "MSVC" +# endif +# define COMPILER_VERSION_MAJOR DEC(__clang_major__) +# define COMPILER_VERSION_MINOR DEC(__clang_minor__) +# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) +# if defined(_MSC_VER) + /* _MSC_VER = VVRR */ +# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) +# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) +# endif + +#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) +# define COMPILER_ID "LCC" +# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) +# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) +# if defined(__LCC_MINOR__) +# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) +# endif +# if defined(__GNUC__) && defined(__GNUC_MINOR__) +# define SIMULATE_ID "GNU" +# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) +# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) +# if defined(__GNUC_PATCHLEVEL__) +# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif +# endif + +#elif defined(__GNUC__) || defined(__GNUG__) +# define COMPILER_ID "GNU" +# if defined(__GNUC__) +# define COMPILER_VERSION_MAJOR DEC(__GNUC__) +# else +# define COMPILER_VERSION_MAJOR DEC(__GNUG__) +# endif +# if defined(__GNUC_MINOR__) +# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) +# endif +# if defined(__GNUC_PATCHLEVEL__) +# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) +# endif + +#elif defined(_MSC_VER) +# define COMPILER_ID "MSVC" + /* _MSC_VER = VVRR */ +# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) +# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) +# if defined(_MSC_FULL_VER) +# if _MSC_VER >= 1400 + /* _MSC_FULL_VER = VVRRPPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) +# else + /* _MSC_FULL_VER = VVRRPPPP */ +# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) +# endif +# endif +# if defined(_MSC_BUILD) +# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) +# endif + +#elif defined(_ADI_COMPILER) +# define COMPILER_ID "ADSP" +#if defined(__VERSIONNUM__) + /* __VERSIONNUM__ = 0xVVRRPPTT */ +# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) +# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) +# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) +# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) +#endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# define COMPILER_ID "IAR" +# if defined(__VER__) && defined(__ICCARM__) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) +# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) +# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) +# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) +# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) +# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) +# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) +# endif + +#elif defined(__DCC__) && defined(_DIAB_TOOL) +# define COMPILER_ID "Diab" + # define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__) + # define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__) + # define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__) + # define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__) + + + +/* These compilers are either not known or too old to define an + identification macro. Try to identify the platform and guess that + it is the native compiler. */ +#elif defined(__hpux) || defined(__hpua) +# define COMPILER_ID "HP" + +#else /* unknown compiler */ +# define COMPILER_ID "" +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; +#ifdef SIMULATE_ID +char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; +#endif + +#ifdef __QNXNTO__ +char const* qnxnto = "INFO" ":" "qnxnto[]"; +#endif + +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) +char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; +#endif + +#define STRINGIFY_HELPER(X) #X +#define STRINGIFY(X) STRINGIFY_HELPER(X) + +/* Identify known platforms by name. */ +#if defined(__linux) || defined(__linux__) || defined(linux) +# define PLATFORM_ID "Linux" + +#elif defined(__MSYS__) +# define PLATFORM_ID "MSYS" + +#elif defined(__CYGWIN__) +# define PLATFORM_ID "Cygwin" + +#elif defined(__MINGW32__) +# define PLATFORM_ID "MinGW" + +#elif defined(__APPLE__) +# define PLATFORM_ID "Darwin" + +#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# define PLATFORM_ID "Windows" + +#elif defined(__FreeBSD__) || defined(__FreeBSD) +# define PLATFORM_ID "FreeBSD" + +#elif defined(__NetBSD__) || defined(__NetBSD) +# define PLATFORM_ID "NetBSD" + +#elif defined(__OpenBSD__) || defined(__OPENBSD) +# define PLATFORM_ID "OpenBSD" + +#elif defined(__sun) || defined(sun) +# define PLATFORM_ID "SunOS" + +#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) +# define PLATFORM_ID "AIX" + +#elif defined(__hpux) || defined(__hpux__) +# define PLATFORM_ID "HP-UX" + +#elif defined(__HAIKU__) +# define PLATFORM_ID "Haiku" + +#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) +# define PLATFORM_ID "BeOS" + +#elif defined(__QNX__) || defined(__QNXNTO__) +# define PLATFORM_ID "QNX" + +#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) +# define PLATFORM_ID "Tru64" + +#elif defined(__riscos) || defined(__riscos__) +# define PLATFORM_ID "RISCos" + +#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) +# define PLATFORM_ID "SINIX" + +#elif defined(__UNIX_SV__) +# define PLATFORM_ID "UNIX_SV" + +#elif defined(__bsdos__) +# define PLATFORM_ID "BSDOS" + +#elif defined(_MPRAS) || defined(MPRAS) +# define PLATFORM_ID "MP-RAS" + +#elif defined(__osf) || defined(__osf__) +# define PLATFORM_ID "OSF1" + +#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) +# define PLATFORM_ID "SCO_SV" + +#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) +# define PLATFORM_ID "ULTRIX" + +#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) +# define PLATFORM_ID "Xenix" + +#elif defined(__WATCOMC__) +# if defined(__LINUX__) +# define PLATFORM_ID "Linux" + +# elif defined(__DOS__) +# define PLATFORM_ID "DOS" + +# elif defined(__OS2__) +# define PLATFORM_ID "OS2" + +# elif defined(__WINDOWS__) +# define PLATFORM_ID "Windows3x" + +# elif defined(__VXWORKS__) +# define PLATFORM_ID "VxWorks" + +# else /* unknown platform */ +# define PLATFORM_ID +# endif + +#elif defined(__INTEGRITY) +# if defined(INT_178B) +# define PLATFORM_ID "Integrity178" + +# else /* regular Integrity */ +# define PLATFORM_ID "Integrity" +# endif + +# elif defined(_ADI_COMPILER) +# define PLATFORM_ID "ADSP" + +#else /* unknown platform */ +# define PLATFORM_ID + +#endif + +/* For windows compilers MSVC and Intel we can determine + the architecture of the compiler being used. This is because + the compilers do not have flags that can change the architecture, + but rather depend on which compiler is being used +*/ +#if defined(_WIN32) && defined(_MSC_VER) +# if defined(_M_IA64) +# define ARCHITECTURE_ID "IA64" + +# elif defined(_M_ARM64EC) +# define ARCHITECTURE_ID "ARM64EC" + +# elif defined(_M_X64) || defined(_M_AMD64) +# define ARCHITECTURE_ID "x64" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# elif defined(_M_ARM64) +# define ARCHITECTURE_ID "ARM64" + +# elif defined(_M_ARM) +# if _M_ARM == 4 +# define ARCHITECTURE_ID "ARMV4I" +# elif _M_ARM == 5 +# define ARCHITECTURE_ID "ARMV5I" +# else +# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) +# endif + +# elif defined(_M_MIPS) +# define ARCHITECTURE_ID "MIPS" + +# elif defined(_M_SH) +# define ARCHITECTURE_ID "SHx" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__WATCOMC__) +# if defined(_M_I86) +# define ARCHITECTURE_ID "I86" + +# elif defined(_M_IX86) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) +# if defined(__ICCARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__ICCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__ICCRH850__) +# define ARCHITECTURE_ID "RH850" + +# elif defined(__ICCRL78__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__ICCRISCV__) +# define ARCHITECTURE_ID "RISCV" + +# elif defined(__ICCAVR__) +# define ARCHITECTURE_ID "AVR" + +# elif defined(__ICC430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__ICCV850__) +# define ARCHITECTURE_ID "V850" + +# elif defined(__ICC8051__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__ICCSTM8__) +# define ARCHITECTURE_ID "STM8" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__ghs__) +# if defined(__PPC64__) +# define ARCHITECTURE_ID "PPC64" + +# elif defined(__ppc__) +# define ARCHITECTURE_ID "PPC" + +# elif defined(__ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__x86_64__) +# define ARCHITECTURE_ID "x64" + +# elif defined(__i386__) +# define ARCHITECTURE_ID "X86" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__clang__) && defined(__ti__) +# if defined(__ARM_ARCH) +# define ARCHITECTURE_ID "ARM" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__TI_COMPILER_VERSION__) +# if defined(__TI_ARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__MSP430__) +# define ARCHITECTURE_ID "MSP430" + +# elif defined(__TMS320C28XX__) +# define ARCHITECTURE_ID "TMS320C28x" + +# elif defined(__TMS320C6X__) || defined(_TMS320C6X) +# define ARCHITECTURE_ID "TMS320C6x" + +# else /* unknown architecture */ +# define ARCHITECTURE_ID "" +# endif + +# elif defined(__ADSPSHARC__) +# define ARCHITECTURE_ID "SHARC" + +# elif defined(__ADSPBLACKFIN__) +# define ARCHITECTURE_ID "Blackfin" + +#elif defined(__TASKING__) + +# if defined(__CTC__) || defined(__CPTC__) +# define ARCHITECTURE_ID "TriCore" + +# elif defined(__CMCS__) +# define ARCHITECTURE_ID "MCS" + +# elif defined(__CARM__) || defined(__CPARM__) +# define ARCHITECTURE_ID "ARM" + +# elif defined(__CARC__) +# define ARCHITECTURE_ID "ARC" + +# elif defined(__C51__) +# define ARCHITECTURE_ID "8051" + +# elif defined(__CPCP__) +# define ARCHITECTURE_ID "PCP" + +# else +# define ARCHITECTURE_ID "" +# endif + +#elif defined(__RENESAS__) +# if defined(__CCRX__) +# define ARCHITECTURE_ID "RX" + +# elif defined(__CCRL__) +# define ARCHITECTURE_ID "RL78" + +# elif defined(__CCRH__) +# define ARCHITECTURE_ID "RH850" + +# else +# define ARCHITECTURE_ID "" +# endif + +#else +# define ARCHITECTURE_ID +#endif + +/* Convert integer to decimal digit literals. */ +#define DEC(n) \ + ('0' + (((n) / 10000000)%10)), \ + ('0' + (((n) / 1000000)%10)), \ + ('0' + (((n) / 100000)%10)), \ + ('0' + (((n) / 10000)%10)), \ + ('0' + (((n) / 1000)%10)), \ + ('0' + (((n) / 100)%10)), \ + ('0' + (((n) / 10)%10)), \ + ('0' + ((n) % 10)) + +/* Convert integer to hex digit literals. */ +#define HEX(n) \ + ('0' + ((n)>>28 & 0xF)), \ + ('0' + ((n)>>24 & 0xF)), \ + ('0' + ((n)>>20 & 0xF)), \ + ('0' + ((n)>>16 & 0xF)), \ + ('0' + ((n)>>12 & 0xF)), \ + ('0' + ((n)>>8 & 0xF)), \ + ('0' + ((n)>>4 & 0xF)), \ + ('0' + ((n) & 0xF)) + +/* Construct a string literal encoding the version number. */ +#ifdef COMPILER_VERSION +char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; + +/* Construct a string literal encoding the version number components. */ +#elif defined(COMPILER_VERSION_MAJOR) +char const info_version[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', + COMPILER_VERSION_MAJOR, +# ifdef COMPILER_VERSION_MINOR + '.', COMPILER_VERSION_MINOR, +# ifdef COMPILER_VERSION_PATCH + '.', COMPILER_VERSION_PATCH, +# ifdef COMPILER_VERSION_TWEAK + '.', COMPILER_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct a string literal encoding the internal version number. */ +#ifdef COMPILER_VERSION_INTERNAL +char const info_version_internal[] = { + 'I', 'N', 'F', 'O', ':', + 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', + 'i','n','t','e','r','n','a','l','[', + COMPILER_VERSION_INTERNAL,']','\0'}; +#elif defined(COMPILER_VERSION_INTERNAL_STR) +char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; +#endif + +/* Construct a string literal encoding the version number components. */ +#ifdef SIMULATE_VERSION_MAJOR +char const info_simulate_version[] = { + 'I', 'N', 'F', 'O', ':', + 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', + SIMULATE_VERSION_MAJOR, +# ifdef SIMULATE_VERSION_MINOR + '.', SIMULATE_VERSION_MINOR, +# ifdef SIMULATE_VERSION_PATCH + '.', SIMULATE_VERSION_PATCH, +# ifdef SIMULATE_VERSION_TWEAK + '.', SIMULATE_VERSION_TWEAK, +# endif +# endif +# endif + ']','\0'}; +#endif + +/* Construct the string literal in pieces to prevent the source from + getting matched. Store it in a pointer rather than an array + because some compilers will just produce instructions to fill the + array rather than assigning a pointer to a static array. */ +char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; +char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; + + + +#define CXX_STD_98 199711L +#define CXX_STD_11 201103L +#define CXX_STD_14 201402L +#define CXX_STD_17 201703L +#define CXX_STD_20 202002L +#define CXX_STD_23 202302L + +#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) +# if _MSVC_LANG > CXX_STD_17 +# define CXX_STD _MSVC_LANG +# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init) +# define CXX_STD CXX_STD_20 +# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17 +# define CXX_STD CXX_STD_20 +# elif _MSVC_LANG > CXX_STD_14 +# define CXX_STD CXX_STD_17 +# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# elif defined(__INTEL_CXX11_MODE__) +# define CXX_STD CXX_STD_11 +# else +# define CXX_STD CXX_STD_98 +# endif +#elif defined(_MSC_VER) && defined(_MSVC_LANG) +# if _MSVC_LANG > __cplusplus +# define CXX_STD _MSVC_LANG +# else +# define CXX_STD __cplusplus +# endif +#elif defined(__NVCOMPILER) +# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init) +# define CXX_STD CXX_STD_20 +# else +# define CXX_STD __cplusplus +# endif +#elif defined(__INTEL_COMPILER) || defined(__PGI) +# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) +# define CXX_STD CXX_STD_17 +# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif +#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__) +# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) +# define CXX_STD CXX_STD_14 +# else +# define CXX_STD __cplusplus +# endif +#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__) +# define CXX_STD CXX_STD_11 +#else +# define CXX_STD __cplusplus +#endif + +const char* info_language_standard_default = "INFO" ":" "standard_default[" +#if CXX_STD > CXX_STD_23 + "26" +#elif CXX_STD > CXX_STD_20 + "23" +#elif CXX_STD > CXX_STD_17 + "20" +#elif CXX_STD > CXX_STD_14 + "17" +#elif CXX_STD > CXX_STD_11 + "14" +#elif CXX_STD >= CXX_STD_11 + "11" +#else + "98" +#endif +"]"; + +const char* info_language_extensions_default = "INFO" ":" "extensions_default[" +#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ + defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \ + !defined(__STRICT_ANSI__) + "ON" +#else + "OFF" +#endif +"]"; + +/*--------------------------------------------------------------------------*/ + +int main(int argc, char* argv[]) +{ + int require = 0; + require += info_compiler[argc]; + require += info_platform[argc]; + require += info_arch[argc]; +#ifdef COMPILER_VERSION_MAJOR + require += info_version[argc]; +#endif +#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR) + require += info_version_internal[argc]; +#endif +#ifdef SIMULATE_ID + require += info_simulate[argc]; +#endif +#ifdef SIMULATE_VERSION_MAJOR + require += info_simulate_version[argc]; +#endif +#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) + require += info_cray[argc]; +#endif + require += info_language_standard_default[argc]; + require += info_language_extensions_default[argc]; + (void)argv; + return require; +} diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out new file mode 100755 index 0000000000000000000000000000000000000000..b9b2fb453a9e4bec85a4815557e6889af6d718c5 GIT binary patch literal 33736 zcmeI5Uu@G=6vt1yPFMM}`X>tFLV0izA)|#UL{02;6Bg$-VbQt;uRqq`Mnl)mt`#;> zIt)0)=s-=T(S&F+G=T>Vnv96q3xpRi>;Z@-I${(^MB{@oi?IJ(Vh!(Q0V^ylPZf!$*!}=ES7K+|n z=(@_1JVU%tskVl2TVYu54;A{z*yZdN<&v~0m9n>`jKM>3z7bw1`A(Q6V#~R5;-O4# z&J(3N`%=khyxTa7^S!_imwZVR7du}Ha&v(5CE|TE1s3O%fNyMH_luF09M&l6` zjdvw@VR1g+O-_AblSJ&|n)36@dl=Dq>g(F-@**K~33${}G?uYbRKF`8m5Nv?izh~u zDxL4X?1GT9KWi3`Gxw~ivH8h{`o`=X$rRPaw#W%7hDGYh)+BZ5GIft_5Vb0~3NSEgU1)6z+xnm(7MYF$yGS3&er*k=rPiJDo?_9t9HJF0{2!H?xfB*=900@8p z2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?x zfB*=900@8p2!H?xfB*=900>;0fb(~pJ{r(}hwh_cGk#>oul0EC{fK}72!H?xfB*=9 z00@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p z2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*>mKLq@orq!rq%x}}3-&S0DiDyO6 zL)>gWl=T$uBbTBb5|YNz9vaTL_%owF_v_CQ{v`L+J*;VAamQ;~?4co9?UBCNG%wrR znr@dy+G(rXR&;N+kv2V5Mk8MCHLrR$D|?&WnNHbivu#D}BzdFpu7siuJytYM15Vwt zR^)Zo`P{sEg8$!voL|bWbm`9K+P+h4j`>1Pe2KB;{IWh^Y`?MB8+(DVlg6$v_Mq6j zQF?02em|)a6)Rn_KDIN>o!v2W07`HyT5%OsC!XV`G!>=Vn}RF#Q%&b^t}S1#{5W@< zE8fRGDO= diff --git a/newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml b/newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml new file mode 100644 index 000000000..2c2c118c9 --- /dev/null +++ b/newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml @@ -0,0 +1,2177 @@ + +--- +events: + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineSystem.cmake:12 (find_program)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_UNAME" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "uname" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/uname" + - "/Users/timatherton/miniconda3/condabin/uname" + - "/opt/homebrew/bin/uname" + - "/opt/homebrew/sbin/uname" + - "/usr/local/bin/uname" + - "/System/Cryptexes/App/usr/bin/uname" + found: "/usr/bin/uname" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineSystem.cmake:212 (message)" + - "CMakeLists.txt:3 (project)" + message: | + The system is: Darwin - 24.3.0 - arm64 + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeUnixFindMake.cmake:5 (find_program)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_MAKE_PROGRAM" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "gmake" + - "make" + - "smake" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/gmake" + - "/Users/timatherton/miniconda3/condabin/gmake" + - "/opt/homebrew/bin/gmake" + - "/opt/homebrew/sbin/gmake" + - "/usr/local/bin/gmake" + - "/System/Cryptexes/App/usr/bin/gmake" + - "/usr/bin/gmake" + - "/bin/gmake" + - "/usr/sbin/gmake" + - "/sbin/gmake" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/gmake" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/gmake" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/gmake" + - "/Library/Apple/usr/bin/gmake" + - "/Library/TeX/texbin/gmake" + - "/Users/timatherton/miniconda3/bin/make" + - "/Users/timatherton/miniconda3/condabin/make" + - "/opt/homebrew/bin/make" + - "/opt/homebrew/sbin/make" + - "/usr/local/bin/make" + - "/System/Cryptexes/App/usr/bin/make" + found: "/usr/bin/make" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompiler.cmake:73 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:64 (_cmake_find_compiler)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_C_COMPILER" + description: "C compiler" + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "cc" + - "gcc" + - "cl" + - "bcc" + - "xlc" + - "icx" + - "clang" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/cc" + - "/Users/timatherton/miniconda3/condabin/cc" + - "/opt/homebrew/bin/cc" + - "/opt/homebrew/sbin/cc" + - "/usr/local/bin/cc" + - "/System/Cryptexes/App/usr/bin/cc" + found: "/usr/bin/cc" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:462 (find_file)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:500 (CMAKE_DETERMINE_COMPILER_ID_WRITE)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:122 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:3 (project)" + mode: "file" + variable: "src_in" + description: "Path to a file." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "CMakeCCompilerId.c.in" + candidate_directories: + - "/opt/homebrew/share/cmake/Modules/" + found: "/opt/homebrew/share/cmake/Modules/CMakeCCompilerId.c.in" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:122 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:3 (project)" + message: | + Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. + Compiler: /usr/bin/cc + Build flags: + Id flags: + + The output was: + 0 + + + Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" + + The C compiler identification is AppleClang, found in: + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out + + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:290 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:122 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:3 (project)" + message: | + Detecting C compiler apple sysroot: "/usr/bin/cc" "-E" "apple-sdk.c" + # 1 "apple-sdk.c" + # 1 "" 1 + # 1 "" 3 + # 465 "" 3 + # 1 "" 1 + # 1 "" 2 + # 1 "apple-sdk.c" 2 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 1 3 4 + # 89 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 + # 90 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h" 1 3 4 + # 91 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 + # 207 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 1 3 4 + # 196 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 + # 197 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 + # 33 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 + # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 2 3 4 + # 198 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 1 3 4 + # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 + # 35 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 2 3 4 + # 199 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 + # 208 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 + # 2 "apple-sdk.c" 2 + + + Found apple sysroot: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_AR" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "ar" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/usr/bin/ar" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_RANLIB" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "ranlib" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/usr/bin/ranlib" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_STRIP" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "strip" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/usr/bin/strip" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_LINKER" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "ld" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/usr/bin/ld" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_NM" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "nm" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/usr/bin/nm" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_OBJDUMP" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "objdump" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/usr/bin/objdump" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_OBJCOPY" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "objcopy" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/usr/bin/objcopy" + - "/Users/timatherton/miniconda3/bin/objcopy" + - "/Users/timatherton/miniconda3/condabin/objcopy" + - "/opt/homebrew/bin/objcopy" + - "/opt/homebrew/sbin/objcopy" + - "/usr/local/bin/objcopy" + - "/System/Cryptexes/App/usr/bin/objcopy" + - "/bin/objcopy" + - "/usr/sbin/objcopy" + - "/sbin/objcopy" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/objcopy" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/objcopy" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/objcopy" + - "/Library/Apple/usr/bin/objcopy" + - "/Library/TeX/texbin/objcopy" + found: false + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_READELF" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "readelf" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/usr/bin/readelf" + - "/Users/timatherton/miniconda3/bin/readelf" + - "/Users/timatherton/miniconda3/condabin/readelf" + - "/opt/homebrew/bin/readelf" + - "/opt/homebrew/sbin/readelf" + - "/usr/local/bin/readelf" + - "/System/Cryptexes/App/usr/bin/readelf" + - "/bin/readelf" + - "/usr/sbin/readelf" + - "/sbin/readelf" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/readelf" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/readelf" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/readelf" + - "/Library/Apple/usr/bin/readelf" + - "/Library/TeX/texbin/readelf" + found: false + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_DLLTOOL" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "dlltool" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/usr/bin/dlltool" + - "/Users/timatherton/miniconda3/bin/dlltool" + - "/Users/timatherton/miniconda3/condabin/dlltool" + - "/opt/homebrew/bin/dlltool" + - "/opt/homebrew/sbin/dlltool" + - "/usr/local/bin/dlltool" + - "/System/Cryptexes/App/usr/bin/dlltool" + - "/bin/dlltool" + - "/usr/sbin/dlltool" + - "/sbin/dlltool" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/dlltool" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/dlltool" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/dlltool" + - "/Library/Apple/usr/bin/dlltool" + - "/Library/TeX/texbin/dlltool" + found: false + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_ADDR2LINE" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "addr2line" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/usr/bin/addr2line" + - "/Users/timatherton/miniconda3/bin/addr2line" + - "/Users/timatherton/miniconda3/condabin/addr2line" + - "/opt/homebrew/bin/addr2line" + - "/opt/homebrew/sbin/addr2line" + - "/usr/local/bin/addr2line" + - "/System/Cryptexes/App/usr/bin/addr2line" + - "/bin/addr2line" + - "/usr/sbin/addr2line" + - "/sbin/addr2line" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/addr2line" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/addr2line" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/addr2line" + - "/Library/Apple/usr/bin/addr2line" + - "/Library/TeX/texbin/addr2line" + found: false + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_TAPI" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: false + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "tapi" + candidate_directories: + - "/usr/bin/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/usr/bin/tapi" + - "/Users/timatherton/miniconda3/bin/tapi" + - "/Users/timatherton/miniconda3/condabin/tapi" + - "/opt/homebrew/bin/tapi" + - "/opt/homebrew/sbin/tapi" + - "/usr/local/bin/tapi" + - "/System/Cryptexes/App/usr/bin/tapi" + - "/bin/tapi" + - "/usr/sbin/tapi" + - "/sbin/tapi" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/tapi" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/tapi" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/tapi" + - "/Library/Apple/usr/bin/tapi" + - "/Library/TeX/texbin/tapi" + found: false + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompiler.cmake:54 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:69 (_cmake_find_compiler)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_CXX_COMPILER" + description: "CXX compiler" + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "c++" + - "g++" + - "cl" + - "bcc" + - "icpx" + - "icx" + - "clang++" + candidate_directories: + - "/usr/bin/" + found: "/usr/bin/c++" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:462 (find_file)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:500 (CMAKE_DETERMINE_COMPILER_ID_WRITE)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:125 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:3 (project)" + mode: "file" + variable: "src_in" + description: "Path to a file." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "CMakeCXXCompilerId.cpp.in" + candidate_directories: + - "/opt/homebrew/share/cmake/Modules/" + found: "/opt/homebrew/share/cmake/Modules/CMakeCXXCompilerId.cpp.in" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:125 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:3 (project)" + message: | + Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. + Compiler: /usr/bin/c++ + Build flags: + Id flags: + + The output was: + 0 + + + Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" + + The CXX compiler identification is AppleClang, found in: + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out + + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:290 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:125 (CMAKE_DETERMINE_COMPILER_ID)" + - "CMakeLists.txt:3 (project)" + message: | + Detecting CXX compiler apple sysroot: "/usr/bin/c++" "-E" "apple-sdk.cpp" + # 1 "apple-sdk.cpp" + # 1 "" 1 + # 1 "" 3 + # 513 "" 3 + # 1 "" 1 + # 1 "" 2 + # 1 "apple-sdk.cpp" 2 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 1 3 4 + # 89 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 + # 90 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h" 1 3 4 + # 91 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 + # 207 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 1 3 4 + # 196 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 + # 197 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 + # 33 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 + # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 2 3 4 + # 198 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 1 3 4 + # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 3 4 + # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 + # 35 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 2 3 4 + # 199 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 + # 208 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 + # 2 "apple-sdk.cpp" 2 + + + Found apple sysroot: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk + - + kind: "find-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/Platform/Darwin.cmake:76 (find_program)" + - "/opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:32 (include)" + - "CMakeLists.txt:3 (project)" + mode: "program" + variable: "CMAKE_INSTALL_NAME_TOOL" + description: "Path to a program." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "install_name_tool" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/install_name_tool" + - "/Users/timatherton/miniconda3/condabin/install_name_tool" + - "/opt/homebrew/bin/install_name_tool" + - "/opt/homebrew/sbin/install_name_tool" + - "/usr/local/bin/install_name_tool" + - "/System/Cryptexes/App/usr/bin/install_name_tool" + found: "/usr/bin/install_name_tool" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + CMAKE_INSTALL_PREFIX: "/usr/local" + - + kind: "try_compile-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:83 (try_compile)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + checks: + - "Detecting C compiler ABI info" + directories: + source: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx" + binary: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx" + cmakeVariables: + CMAKE_C_FLAGS: "" + CMAKE_C_FLAGS_DEBUG: "-g" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_OSX_ARCHITECTURES: "" + CMAKE_OSX_DEPLOYMENT_TARGET: "" + CMAKE_OSX_SYSROOT: "" + buildResult: + variable: "CMAKE_C_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx' + + Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_b1e75/fast + /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b1e75.dir/build.make CMakeFiles/cmTC_b1e75.dir/build + Building C object CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o + /usr/bin/cc -arch arm64 -v -Wl,-v -MD -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c + Apple clang version 17.0.0 (clang-1700.0.13.5) + Target: arm64-apple-darwin24.3.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c + clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0 + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks" + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + #include "..." search starts here: + #include <...> search starts here: + /usr/local/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) + End of search list. + Linking C executable cmTC_b1e75 + /opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b1e75.dir/link.txt --verbose=1 + Apple clang version 17.0.0 (clang-1700.0.13.5) + Target: arm64-apple-darwin24.3.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_b1e75 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a + @(#)PROGRAM:ld PROJECT:ld-1167.5 + BUILD 01:45:05 Apr 30 2025 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) + Library search paths: + /usr/local/lib + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift + Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks + /usr/bin/cc -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -o cmTC_b1e75 + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:122 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Effective list of requested architectures (possibly empty) : "" + Effective list of architectures found in the ABI info binary: "arm64" + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:217 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Parsed C implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/usr/local/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + end of search list found + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + implicit include dirs: [/usr/local/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:253 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Parsed C implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)))("|,| |$)] + ignore line: [Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx'] + ignore line: [] + ignore line: [Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_b1e75/fast] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b1e75.dir/build.make CMakeFiles/cmTC_b1e75.dir/build] + ignore line: [Building C object CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o] + ignore line: [/usr/bin/cc -arch arm64 -v -Wl -v -MD -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] + ignore line: [Target: arm64-apple-darwin24.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] + ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c] + ignore line: [clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/local/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)] + ignore line: [End of search list.] + ignore line: [Linking C executable cmTC_b1e75] + ignore line: [/opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b1e75.dir/link.txt --verbose=1] + ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] + ignore line: [Target: arm64-apple-darwin24.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_b1e75 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [arm64] ==> ignore + arg [-platform_version] ==> ignore + arg [macos] ==> ignore + arg [15.0.0] ==> ignore + arg [15.5] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk] ==> ignore + arg [-mllvm] ==> ignore + arg [-enable-linkonceodr-outlining] ==> ignore + arg [-o] ==> ignore + arg [cmTC_b1e75] ==> ignore + arg [-L/usr/local/lib] ==> dir [/usr/local/lib] + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o] ==> ignore + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] + linker tool for 'C': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + Library search paths: [;/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] + collapse library dir [/usr/local/lib] ==> [/usr/local/lib] + collapse library dir [/usr/local/lib] ==> [/usr/local/lib] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] + implicit libs: [] + implicit objs: [] + implicit dirs: [/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] + + + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:36 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:299 (cmake_determine_linker_id)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Running the C compiler's linker: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-v" + @(#)PROGRAM:ld PROJECT:ld-1167.5 + BUILD 01:45:05 Apr 30 2025 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) + - + kind: "try_compile-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:83 (try_compile)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + checks: + - "Detecting CXX compiler ABI info" + directories: + source: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i" + binary: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i" + cmakeVariables: + CMAKE_CXX_FLAGS: "" + CMAKE_CXX_FLAGS_DEBUG: "-g" + CMAKE_CXX_SCAN_FOR_MODULES: "OFF" + CMAKE_EXE_LINKER_FLAGS: "" + CMAKE_OSX_ARCHITECTURES: "" + CMAKE_OSX_DEPLOYMENT_TARGET: "" + CMAKE_OSX_SYSROOT: "" + buildResult: + variable: "CMAKE_CXX_ABI_COMPILED" + cached: true + stdout: | + Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i' + + Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_22496/fast + /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_22496.dir/build.make CMakeFiles/cmTC_22496.dir/build + Building CXX object CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o + /usr/bin/c++ -arch arm64 -v -Wl,-v -MD -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp + Apple clang version 17.0.0 (clang-1700.0.13.5) + Target: arm64-apple-darwin24.3.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + clang++: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1" + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp + clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0 + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks" + ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + #include "..." search starts here: + #include <...> search starts here: + /usr/local/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) + End of search list. + Linking CXX executable cmTC_22496 + /opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_22496.dir/link.txt --verbose=1 + Apple clang version 17.0.0 (clang-1700.0.13.5) + Target: arm64-apple-darwin24.3.0 + Thread model: posix + InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin + "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_22496 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a + @(#)PROGRAM:ld PROJECT:ld-1167.5 + BUILD 01:45:05 Apr 30 2025 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) + Library search paths: + /usr/local/lib + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift + Framework search paths: + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks + /usr/bin/c++ -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_22496 + + exitCode: 0 + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:122 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Effective list of requested architectures (possibly empty) : "" + Effective list of architectures found in the ABI info binary: "arm64" + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:217 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Parsed CXX implicit include dir info: rv=done + found start of include info + found start of implicit include info + add: [/usr/local/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] + add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] + add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + end of search list found + collapse include dir [/usr/local/include] ==> [/usr/local/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] + collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + implicit include dirs: [/usr/local/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + + + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:253 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Parsed CXX implicit link information: + link line regex: [^( *|.*[/\\])(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] + linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)))("|,| |$)] + ignore line: [Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i'] + ignore line: [] + ignore line: [Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_22496/fast] + ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_22496.dir/build.make CMakeFiles/cmTC_22496.dir/build] + ignore line: [Building CXX object CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o] + ignore line: [/usr/bin/c++ -arch arm64 -v -Wl -v -MD -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] + ignore line: [Target: arm64-apple-darwin24.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + ignore line: [clang++: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"] + ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp] + ignore line: [clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks"] + ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"] + ignore line: [#include "..." search starts here:] + ignore line: [#include <...> search starts here:] + ignore line: [ /usr/local/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] + ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)] + ignore line: [End of search list.] + ignore line: [Linking CXX executable cmTC_22496] + ignore line: [/opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_22496.dir/link.txt --verbose=1] + ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] + ignore line: [Target: arm64-apple-darwin24.3.0] + ignore line: [Thread model: posix] + ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] + link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_22496 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore + arg [-demangle] ==> ignore + arg [-lto_library] ==> ignore, skip following value + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library + arg [-dynamic] ==> ignore + arg [-arch] ==> ignore + arg [arm64] ==> ignore + arg [-platform_version] ==> ignore + arg [macos] ==> ignore + arg [15.0.0] ==> ignore + arg [15.5] ==> ignore + arg [-syslibroot] ==> ignore + arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk] ==> ignore + arg [-mllvm] ==> ignore + arg [-enable-linkonceodr-outlining] ==> ignore + arg [-o] ==> ignore + arg [cmTC_22496] ==> ignore + arg [-L/usr/local/lib] ==> dir [/usr/local/lib] + arg [-search_paths_first] ==> ignore + arg [-headerpad_max_install_names] ==> ignore + arg [-v] ==> ignore + arg [CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore + arg [-lc++] ==> lib [c++] + arg [-lSystem] ==> lib [System] + arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] + linker tool for 'CXX': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld + Library search paths: [;/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] + Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] + remove lib [System] + remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] + collapse library dir [/usr/local/lib] ==> [/usr/local/lib] + collapse library dir [/usr/local/lib] ==> [/usr/local/lib] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] + collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] + collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] + implicit libs: [c++] + implicit objs: [] + implicit dirs: [/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] + implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] + + + - + kind: "message-v1" + backtrace: + - "/opt/homebrew/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:36 (message)" + - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:299 (cmake_determine_linker_id)" + - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" + - "CMakeLists.txt:3 (project)" + message: | + Running the CXX compiler's linker: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-v" + @(#)PROGRAM:ld PROJECT:ld-1167.5 + BUILD 01:45:05 Apr 30 2025 + configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em + will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em + LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) + TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) + - + kind: "find-v1" + backtrace: + - "CMakeLists.txt:19 (find_file)" + mode: "file" + variable: "MORPHO_HEADER" + description: "Path to a file." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "morpho.h" + candidate_directories: + - "/usr/local/opt/morpho/" + - "/opt/homebrew/opt/morpho/" + - "/usr/local/include/morpho/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/include/" + - "/opt/homebrew/" + - "/usr/local/include/" + - "/usr/local/" + - "/usr/include/" + - "/usr/" + - "/include/" + - "/usr/X11R6/include/" + - "/usr/X11R6/" + - "/usr/pkg/include/" + - "/usr/pkg/" + - "/opt/include/" + - "/opt/" + - "/sw/include/" + - "/sw/" + - "/opt/local/include/" + - "/opt/local/" + - "/usr/include/X11/" + - "/Users/timatherton/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/Network/Library/Frameworks/" + - "/System/Library/Frameworks/" + searched_directories: + - "/usr/local/opt/morpho/morpho.h" + - "/opt/homebrew/opt/morpho/morpho.h" + found: "/usr/local/include/morpho/morpho.h" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + CMAKE_INSTALL_PREFIX: "/usr/local" + CMAKE_SYSTEM_PREFIX_PATH: + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" + - "/opt/homebrew" + - "/usr/local" + - "/usr" + - "/" + - "/opt/homebrew" + - "/usr/local" + - "/usr/X11R6" + - "/usr/pkg" + - "/opt" + - "/sw" + - "/opt/local" + CMAKE_SYSTEM_INCLUDE_PATH: + - "/usr/include/X11" + CMAKE_SYSTEM_FRAMEWORK_PATH: + - "~/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" + - "/Library/Frameworks" + - "/Network/Library/Frameworks" + - "/System/Library/Frameworks" + - + kind: "find-v1" + backtrace: + - "CMakeLists.txt:47 (find_library)" + mode: "library" + variable: "MORPHO_LIBRARY" + description: "Path to a library." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "morpho" + - "libmorpho" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/lib/" + - "/opt/homebrew/" + - "/usr/local/lib/" + - "/usr/local/" + - "/usr/lib/" + - "/usr/" + - "/opt/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/System/Library/Frameworks/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/lib/" + - "/opt/homebrew/" + found: "/usr/local/lib/libmorpho.dylib" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + CMAKE_INSTALL_PREFIX: "/usr/local" + CMAKE_SYSTEM_PREFIX_PATH: + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" + - "/opt/homebrew" + - "/usr/local" + - "/usr" + - "/" + - "/opt/homebrew" + - "/usr/local" + - "/usr/X11R6" + - "/usr/pkg" + - "/opt" + - "/sw" + - "/opt/local" + CMAKE_SYSTEM_LIBRARY_PATH: + - "/usr/lib/X11" + CMAKE_SYSTEM_FRAMEWORK_PATH: + - "~/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" + - "/Library/Frameworks" + - "/Network/Library/Frameworks" + - "/System/Library/Frameworks" + - + kind: "find-v1" + backtrace: + - "CMakeLists.txt:61 (find_library)" + mode: "library" + variable: "LAPACK_LIBRARY" + description: "Path to a library." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "lapacke" + - "liblapacke" + - "lapack" + - "liblapack" + - "libopenblas" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/lib/" + - "/opt/homebrew/" + - "/usr/local/lib/" + - "/usr/local/" + - "/usr/lib/" + - "/usr/" + - "/opt/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/System/Library/Frameworks/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/lib/" + - "/opt/homebrew/" + - "/usr/local/lib/" + - "/usr/local/" + - "/usr/lib/" + - "/usr/" + - "/opt/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/System/Library/Frameworks/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/lib/" + - "/opt/homebrew/" + - "/usr/local/lib/" + - "/usr/local/" + - "/usr/lib/" + - "/usr/" + - "/opt/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/System/Library/Frameworks/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + CMAKE_INSTALL_PREFIX: "/usr/local" + CMAKE_SYSTEM_PREFIX_PATH: + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" + - "/opt/homebrew" + - "/usr/local" + - "/usr" + - "/" + - "/opt/homebrew" + - "/usr/local" + - "/usr/X11R6" + - "/usr/pkg" + - "/opt" + - "/sw" + - "/opt/local" + CMAKE_SYSTEM_LIBRARY_PATH: + - "/usr/lib/X11" + CMAKE_SYSTEM_FRAMEWORK_PATH: + - "~/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" + - "/Library/Frameworks" + - "/Network/Library/Frameworks" + - "/System/Library/Frameworks" + - + kind: "find-v1" + backtrace: + - "CMakeLists.txt:71 (find_library)" + mode: "library" + variable: "CBLAS_LIBRARY" + description: "Path to a library." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "cblas" + - "libcblas" + - "blas" + - "libblas" + - "openblas" + - "libopenblas" + candidate_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/lib/" + - "/opt/homebrew/" + - "/usr/local/lib/" + - "/usr/local/" + - "/usr/lib/" + - "/usr/" + - "/opt/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/System/Library/Frameworks/" + searched_directories: + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + found: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + CMAKE_INSTALL_PREFIX: "/usr/local" + CMAKE_SYSTEM_PREFIX_PATH: + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" + - "/opt/homebrew" + - "/usr/local" + - "/usr" + - "/" + - "/opt/homebrew" + - "/usr/local" + - "/usr/X11R6" + - "/usr/pkg" + - "/opt" + - "/sw" + - "/opt/local" + CMAKE_SYSTEM_LIBRARY_PATH: + - "/usr/lib/X11" + CMAKE_SYSTEM_FRAMEWORK_PATH: + - "~/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" + - "/Library/Frameworks" + - "/Network/Library/Frameworks" + - "/System/Library/Frameworks" + - + kind: "find-v1" + backtrace: + - "CMakeLists.txt:81 (find_path)" + mode: "path" + variable: "CBLAS_INCLUDE" + description: "Path to a file." + settings: + SearchFramework: "FIRST" + SearchAppBundle: "FIRST" + CMAKE_FIND_USE_CMAKE_PATH: true + CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true + CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true + CMAKE_FIND_USE_INSTALL_PREFIX: true + names: + - "cblas.h" + candidate_directories: + - "C:/Program Files/Morpho/include/lapack/" + - "/Users/timatherton/miniconda3/bin/" + - "/Users/timatherton/miniconda3/condabin/" + - "/opt/homebrew/bin/" + - "/opt/homebrew/sbin/" + - "/usr/local/bin/" + - "/System/Cryptexes/App/usr/bin/" + - "/usr/bin/" + - "/bin/" + - "/usr/sbin/" + - "/sbin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" + - "/Library/Apple/usr/bin/" + - "/Library/TeX/texbin/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" + - "/opt/homebrew/include/" + - "/opt/homebrew/" + - "/usr/local/include/" + - "/usr/local/" + - "/usr/include/" + - "/usr/" + - "/include/" + - "/usr/X11R6/include/" + - "/usr/X11R6/" + - "/usr/pkg/include/" + - "/usr/pkg/" + - "/opt/include/" + - "/opt/" + - "/sw/include/" + - "/sw/" + - "/opt/local/include/" + - "/opt/local/" + - "/usr/include/X11/" + - "/Users/timatherton/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" + - "/Library/Frameworks/" + - "/Network/Library/Frameworks/" + - "/System/Library/Frameworks/" + found: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/" + search_context: + ENV{PATH}: + - "/Users/timatherton/miniconda3/bin" + - "/Users/timatherton/miniconda3/condabin" + - "/opt/homebrew/bin" + - "/opt/homebrew/sbin" + - "/usr/local/bin" + - "/System/Cryptexes/App/usr/bin" + - "/usr/bin" + - "/bin" + - "/usr/sbin" + - "/sbin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" + - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" + - "/Library/Apple/usr/bin" + - "/Library/TeX/texbin" + CMAKE_INSTALL_PREFIX: "/usr/local" + CMAKE_SYSTEM_PREFIX_PATH: + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" + - "/opt/homebrew" + - "/usr/local" + - "/usr" + - "/" + - "/opt/homebrew" + - "/usr/local" + - "/usr/X11R6" + - "/usr/pkg" + - "/opt" + - "/sw" + - "/opt/local" + CMAKE_SYSTEM_INCLUDE_PATH: + - "/usr/include/X11" + CMAKE_SYSTEM_FRAMEWORK_PATH: + - "~/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" + - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" + - "/Library/Frameworks" + - "/Network/Library/Frameworks" + - "/System/Library/Frameworks" +... diff --git a/newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake b/newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake new file mode 100644 index 000000000..18e20c210 --- /dev/null +++ b/newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake @@ -0,0 +1,16 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +# Relative path conversion top directories. +set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg") +set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build") + +# Force unix paths in dependencies. +set(CMAKE_FORCE_UNIX_PATHS 1) + + +# The C and CXX include file regular expressions for this directory. +set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") +set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") +set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) +set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/newlinalg/build/CMakeFiles/InstallScripts.json b/newlinalg/build/CMakeFiles/InstallScripts.json new file mode 100644 index 000000000..c0ac264c8 --- /dev/null +++ b/newlinalg/build/CMakeFiles/InstallScripts.json @@ -0,0 +1,8 @@ +{ + "InstallScripts" : + [ + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/cmake_install.cmake", + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/cmake_install.cmake" + ], + "Parallel" : false +} diff --git a/newlinalg/build/CMakeFiles/Makefile.cmake b/newlinalg/build/CMakeFiles/Makefile.cmake new file mode 100644 index 000000000..7db3d4466 --- /dev/null +++ b/newlinalg/build/CMakeFiles/Makefile.cmake @@ -0,0 +1,62 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +# The generator used is: +set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") + +# The top level Makefile was generated from the following files: +set(CMAKE_MAKEFILE_DEPENDS + "CMakeCache.txt" + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/CMakeLists.txt" + "CMakeFiles/4.1.0/CMakeCCompiler.cmake" + "CMakeFiles/4.1.0/CMakeCXXCompiler.cmake" + "CMakeFiles/4.1.0/CMakeSystem.cmake" + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/CMakeLists.txt" + "/opt/homebrew/share/cmake/Modules/CMakeCInformation.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeCXXInformation.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeGenericSystem.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeInitializeConfigs.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeLanguageInformation.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" + "/opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" + "/opt/homebrew/share/cmake/Modules/Compiler/AppleClang-C.cmake" + "/opt/homebrew/share/cmake/Modules/Compiler/AppleClang-CXX.cmake" + "/opt/homebrew/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" + "/opt/homebrew/share/cmake/Modules/Compiler/Clang.cmake" + "/opt/homebrew/share/cmake/Modules/Compiler/GNU.cmake" + "/opt/homebrew/share/cmake/Modules/Internal/CMakeCLinkerInformation.cmake" + "/opt/homebrew/share/cmake/Modules/Internal/CMakeCXXLinkerInformation.cmake" + "/opt/homebrew/share/cmake/Modules/Internal/CMakeCommonLinkerInformation.cmake" + "/opt/homebrew/share/cmake/Modules/Linker/AppleClang-C.cmake" + "/opt/homebrew/share/cmake/Modules/Linker/AppleClang-CXX.cmake" + "/opt/homebrew/share/cmake/Modules/Linker/AppleClang.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Apple-AppleClang-C.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Apple-AppleClang-CXX.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Apple-Clang-C.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Apple-Clang-CXX.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Apple-Clang.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Darwin-Initialize.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Darwin.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Linker/Apple-AppleClang-C.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Linker/Apple-AppleClang-CXX.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/Linker/Apple-AppleClang.cmake" + "/opt/homebrew/share/cmake/Modules/Platform/UnixPaths.cmake" + ) + +# The corresponding makefile is: +set(CMAKE_MAKEFILE_OUTPUTS + "Makefile" + "CMakeFiles/cmake.check_cache" + ) + +# Byproducts of CMake generate step: +set(CMAKE_MAKEFILE_PRODUCTS + "CMakeFiles/CMakeDirectoryInformation.cmake" + "src/CMakeFiles/CMakeDirectoryInformation.cmake" + ) + +# Dependency information for all targets: +set(CMAKE_DEPEND_INFO_FILES + "CMakeFiles/newlinalg.dir/DependInfo.cmake" + ) diff --git a/newlinalg/build/CMakeFiles/Makefile2 b/newlinalg/build/CMakeFiles/Makefile2 new file mode 100644 index 000000000..c0b4a69f3 --- /dev/null +++ b/newlinalg/build/CMakeFiles/Makefile2 @@ -0,0 +1,144 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /opt/homebrew/bin/cmake + +# The command to remove a file. +RM = /opt/homebrew/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build + +#============================================================================= +# Directory level rules for the build root directory + +# The main recursive "all" target. +all: CMakeFiles/newlinalg.dir/all +all: src/all +.PHONY : all + +# The main recursive "codegen" target. +codegen: CMakeFiles/newlinalg.dir/codegen +codegen: src/codegen +.PHONY : codegen + +# The main recursive "preinstall" target. +preinstall: src/preinstall +.PHONY : preinstall + +# The main recursive "clean" target. +clean: CMakeFiles/newlinalg.dir/clean +clean: src/clean +.PHONY : clean + +#============================================================================= +# Directory level rules for directory src + +# Recursive "all" directory target. +src/all: +.PHONY : src/all + +# Recursive "codegen" directory target. +src/codegen: +.PHONY : src/codegen + +# Recursive "preinstall" directory target. +src/preinstall: +.PHONY : src/preinstall + +# Recursive "clean" directory target. +src/clean: +.PHONY : src/clean + +#============================================================================= +# Target rules for target CMakeFiles/newlinalg.dir + +# All Build rule for target. +CMakeFiles/newlinalg.dir/all: + $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/depend + $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/build + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=1,2,3,4 "Built target newlinalg" +.PHONY : CMakeFiles/newlinalg.dir/all + +# Build rule for subdir invocation for target. +CMakeFiles/newlinalg.dir/rule: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles 4 + $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/newlinalg.dir/all + $(CMAKE_COMMAND) -E cmake_progress_start /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles 0 +.PHONY : CMakeFiles/newlinalg.dir/rule + +# Convenience name for target. +newlinalg: CMakeFiles/newlinalg.dir/rule +.PHONY : newlinalg + +# codegen rule for target. +CMakeFiles/newlinalg.dir/codegen: + $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/codegen + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=1,2,3,4 "Finished codegen for target newlinalg" +.PHONY : CMakeFiles/newlinalg.dir/codegen + +# clean rule for target. +CMakeFiles/newlinalg.dir/clean: + $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/clean +.PHONY : CMakeFiles/newlinalg.dir/clean + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/newlinalg/build/CMakeFiles/TargetDirectories.txt b/newlinalg/build/CMakeFiles/TargetDirectories.txt new file mode 100644 index 000000000..25891c150 --- /dev/null +++ b/newlinalg/build/CMakeFiles/TargetDirectories.txt @@ -0,0 +1,13 @@ +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/newlinalg.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/edit_cache.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/rebuild_cache.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/list_install_components.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/install.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/install/local.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/install/strip.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/edit_cache.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/rebuild_cache.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/list_install_components.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/install.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/install/local.dir +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/install/strip.dir diff --git a/newlinalg/build/CMakeFiles/cmake.check_cache b/newlinalg/build/CMakeFiles/cmake.check_cache new file mode 100644 index 000000000..3dccd7317 --- /dev/null +++ b/newlinalg/build/CMakeFiles/cmake.check_cache @@ -0,0 +1 @@ +# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake b/newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake new file mode 100644 index 000000000..47bc012d2 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake @@ -0,0 +1,25 @@ + +# Consider dependencies only in project. +set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) + +# The set of languages for which implicit dependencies are needed: +set(CMAKE_DEPENDS_LANGUAGES + ) + +# The set of dependency files which are needed: +set(CMAKE_DEPENDS_DEPENDENCY_FILES + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c" "CMakeFiles/newlinalg.dir/src/newlinalg.c.o" "gcc" "CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d" + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c" "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" "gcc" "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d" + "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c" "CMakeFiles/newlinalg.dir/src/xmatrix.c.o" "gcc" "CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d" + ) + +# Targets to which this target links which contain Fortran sources. +set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES + ) + +# Targets to which this target links which contain Fortran sources. +set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES + ) + +# Fortran module output directory. +set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/build.make b/newlinalg/build/CMakeFiles/newlinalg.dir/build.make new file mode 100644 index 000000000..ad8e14e08 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/build.make @@ -0,0 +1,148 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +# Delete rule output on recipe failure. +.DELETE_ON_ERROR: + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canonical targets will work. +.SUFFIXES: + +# Disable VCS-based implicit rules. +% : %,v + +# Disable VCS-based implicit rules. +% : RCS/% + +# Disable VCS-based implicit rules. +% : RCS/%,v + +# Disable VCS-based implicit rules. +% : SCCS/s.% + +# Disable VCS-based implicit rules. +% : s.% + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Command-line flag to silence nested $(MAKE). +$(VERBOSE)MAKESILENT = -s + +#Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /opt/homebrew/bin/cmake + +# The command to remove a file. +RM = /opt/homebrew/bin/cmake -E rm -f + +# Escaping for special characters. +EQUALS = = + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build + +# Include any dependencies generated for this target. +include CMakeFiles/newlinalg.dir/depend.make +# Include any dependencies generated by the compiler for this target. +include CMakeFiles/newlinalg.dir/compiler_depend.make + +# Include the progress variables for this target. +include CMakeFiles/newlinalg.dir/progress.make + +# Include the compile flags for this target's objects. +include CMakeFiles/newlinalg.dir/flags.make + +CMakeFiles/newlinalg.dir/codegen: +.PHONY : CMakeFiles/newlinalg.dir/codegen + +CMakeFiles/newlinalg.dir/src/newlinalg.c.o: CMakeFiles/newlinalg.dir/flags.make +CMakeFiles/newlinalg.dir/src/newlinalg.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c +CMakeFiles/newlinalg.dir/src/newlinalg.c.o: CMakeFiles/newlinalg.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/newlinalg.dir/src/newlinalg.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/newlinalg.dir/src/newlinalg.c.o -MF CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d -o CMakeFiles/newlinalg.dir/src/newlinalg.c.o -c /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c + +CMakeFiles/newlinalg.dir/src/newlinalg.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing C source to CMakeFiles/newlinalg.dir/src/newlinalg.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c > CMakeFiles/newlinalg.dir/src/newlinalg.c.i + +CMakeFiles/newlinalg.dir/src/newlinalg.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling C source to assembly CMakeFiles/newlinalg.dir/src/newlinalg.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c -o CMakeFiles/newlinalg.dir/src/newlinalg.c.s + +CMakeFiles/newlinalg.dir/src/xmatrix.c.o: CMakeFiles/newlinalg.dir/flags.make +CMakeFiles/newlinalg.dir/src/xmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c +CMakeFiles/newlinalg.dir/src/xmatrix.c.o: CMakeFiles/newlinalg.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object CMakeFiles/newlinalg.dir/src/xmatrix.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/newlinalg.dir/src/xmatrix.c.o -MF CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d -o CMakeFiles/newlinalg.dir/src/xmatrix.c.o -c /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c + +CMakeFiles/newlinalg.dir/src/xmatrix.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing C source to CMakeFiles/newlinalg.dir/src/xmatrix.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c > CMakeFiles/newlinalg.dir/src/xmatrix.c.i + +CMakeFiles/newlinalg.dir/src/xmatrix.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling C source to assembly CMakeFiles/newlinalg.dir/src/xmatrix.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c -o CMakeFiles/newlinalg.dir/src/xmatrix.c.s + +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: CMakeFiles/newlinalg.dir/flags.make +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: CMakeFiles/newlinalg.dir/compiler_depend.ts + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -MF CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d -o CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -c /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c + +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.i: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing C source to CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.i" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c > CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.i + +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.s: cmake_force + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling C source to assembly CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.s" + /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c -o CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.s + +# Object files for target newlinalg +newlinalg_OBJECTS = \ +"CMakeFiles/newlinalg.dir/src/newlinalg.c.o" \ +"CMakeFiles/newlinalg.dir/src/xmatrix.c.o" \ +"CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" + +# External object files for target newlinalg +newlinalg_EXTERNAL_OBJECTS = + +newlinalg.so: CMakeFiles/newlinalg.dir/src/newlinalg.c.o +newlinalg.so: CMakeFiles/newlinalg.dir/src/xmatrix.c.o +newlinalg.so: CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o +newlinalg.so: CMakeFiles/newlinalg.dir/build.make +newlinalg.so: /usr/local/lib/libmorpho.dylib +newlinalg.so: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd +newlinalg.so: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd +newlinalg.so: CMakeFiles/newlinalg.dir/link.txt + @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Linking C shared module newlinalg.so" + $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/newlinalg.dir/link.txt --verbose=$(VERBOSE) + +# Rule to build all files generated by this target. +CMakeFiles/newlinalg.dir/build: newlinalg.so +.PHONY : CMakeFiles/newlinalg.dir/build + +CMakeFiles/newlinalg.dir/clean: + $(CMAKE_COMMAND) -P CMakeFiles/newlinalg.dir/cmake_clean.cmake +.PHONY : CMakeFiles/newlinalg.dir/clean + +CMakeFiles/newlinalg.dir/depend: + cd /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/timatherton/Documents/Programs/packages/morpho-newlinalg /Users/timatherton/Documents/Programs/packages/morpho-newlinalg /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake "--color=$(COLOR)" +.PHONY : CMakeFiles/newlinalg.dir/depend + diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake b/newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake new file mode 100644 index 000000000..30588d57d --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake @@ -0,0 +1,15 @@ +file(REMOVE_RECURSE + "CMakeFiles/newlinalg.dir/src/newlinalg.c.o" + "CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d" + "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" + "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d" + "CMakeFiles/newlinalg.dir/src/xmatrix.c.o" + "CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d" + "newlinalg.pdb" + "newlinalg.so" +) + +# Per-language clean rules from dependency scanning. +foreach(lang C) + include(CMakeFiles/newlinalg.dir/cmake_clean_${lang}.cmake OPTIONAL) +endforeach() diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal new file mode 100644 index 000000000..fec9c810e --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal @@ -0,0 +1,1193 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +CMakeFiles/newlinalg.dir/src/newlinalg.c.o + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h + /usr/local/include/morpho/array.h + /usr/local/include/morpho/bool.h + /usr/local/include/morpho/build.h + /usr/local/include/morpho/builtin.h + /usr/local/include/morpho/cfunction.h + /usr/local/include/morpho/classes.h + /usr/local/include/morpho/closure.h + /usr/local/include/morpho/clss.h + /usr/local/include/morpho/cmplx.h + /usr/local/include/morpho/dict.h + /usr/local/include/morpho/dictionary.h + /usr/local/include/morpho/err.h + /usr/local/include/morpho/error.h + /usr/local/include/morpho/flt.h + /usr/local/include/morpho/function.h + /usr/local/include/morpho/instance.h + /usr/local/include/morpho/int.h + /usr/local/include/morpho/invocation.h + /usr/local/include/morpho/json.h + /usr/local/include/morpho/list.h + /usr/local/include/morpho/matrix.h + /usr/local/include/morpho/memory.h + /usr/local/include/morpho/metafunction.h + /usr/local/include/morpho/morpho.h + /usr/local/include/morpho/nil.h + /usr/local/include/morpho/object.h + /usr/local/include/morpho/platform.h + /usr/local/include/morpho/range.h + /usr/local/include/morpho/signature.h + /usr/local/include/morpho/strng.h + /usr/local/include/morpho/tuple.h + /usr/local/include/morpho/upvalue.h + /usr/local/include/morpho/value.h + /usr/local/include/morpho/varray.h + /usr/local/include/morpho/version.h + +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h + /usr/local/include/morpho/array.h + /usr/local/include/morpho/bool.h + /usr/local/include/morpho/build.h + /usr/local/include/morpho/builtin.h + /usr/local/include/morpho/cfunction.h + /usr/local/include/morpho/classes.h + /usr/local/include/morpho/closure.h + /usr/local/include/morpho/clss.h + /usr/local/include/morpho/cmplx.h + /usr/local/include/morpho/dict.h + /usr/local/include/morpho/dictionary.h + /usr/local/include/morpho/err.h + /usr/local/include/morpho/error.h + /usr/local/include/morpho/flt.h + /usr/local/include/morpho/function.h + /usr/local/include/morpho/instance.h + /usr/local/include/morpho/int.h + /usr/local/include/morpho/invocation.h + /usr/local/include/morpho/json.h + /usr/local/include/morpho/list.h + /usr/local/include/morpho/matrix.h + /usr/local/include/morpho/memory.h + /usr/local/include/morpho/metafunction.h + /usr/local/include/morpho/morpho.h + /usr/local/include/morpho/nil.h + /usr/local/include/morpho/object.h + /usr/local/include/morpho/platform.h + /usr/local/include/morpho/range.h + /usr/local/include/morpho/signature.h + /usr/local/include/morpho/strng.h + /usr/local/include/morpho/tuple.h + /usr/local/include/morpho/upvalue.h + /usr/local/include/morpho/value.h + /usr/local/include/morpho/varray.h + /usr/local/include/morpho/version.h + +CMakeFiles/newlinalg.dir/src/xmatrix.c.o + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h + /usr/local/include/morpho/array.h + /usr/local/include/morpho/bool.h + /usr/local/include/morpho/build.h + /usr/local/include/morpho/builtin.h + /usr/local/include/morpho/cfunction.h + /usr/local/include/morpho/classes.h + /usr/local/include/morpho/closure.h + /usr/local/include/morpho/clss.h + /usr/local/include/morpho/cmplx.h + /usr/local/include/morpho/dict.h + /usr/local/include/morpho/dictionary.h + /usr/local/include/morpho/err.h + /usr/local/include/morpho/error.h + /usr/local/include/morpho/flt.h + /usr/local/include/morpho/function.h + /usr/local/include/morpho/instance.h + /usr/local/include/morpho/int.h + /usr/local/include/morpho/invocation.h + /usr/local/include/morpho/json.h + /usr/local/include/morpho/list.h + /usr/local/include/morpho/matrix.h + /usr/local/include/morpho/memory.h + /usr/local/include/morpho/metafunction.h + /usr/local/include/morpho/morpho.h + /usr/local/include/morpho/nil.h + /usr/local/include/morpho/object.h + /usr/local/include/morpho/platform.h + /usr/local/include/morpho/range.h + /usr/local/include/morpho/signature.h + /usr/local/include/morpho/strng.h + /usr/local/include/morpho/tuple.h + /usr/local/include/morpho/upvalue.h + /usr/local/include/morpho/value.h + /usr/local/include/morpho/varray.h + /usr/local/include/morpho/version.h + diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make new file mode 100644 index 000000000..562519edb --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make @@ -0,0 +1,2860 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +CMakeFiles/newlinalg.dir/src/newlinalg.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ + /usr/local/include/morpho/array.h \ + /usr/local/include/morpho/bool.h \ + /usr/local/include/morpho/build.h \ + /usr/local/include/morpho/builtin.h \ + /usr/local/include/morpho/cfunction.h \ + /usr/local/include/morpho/classes.h \ + /usr/local/include/morpho/closure.h \ + /usr/local/include/morpho/clss.h \ + /usr/local/include/morpho/cmplx.h \ + /usr/local/include/morpho/dict.h \ + /usr/local/include/morpho/dictionary.h \ + /usr/local/include/morpho/err.h \ + /usr/local/include/morpho/error.h \ + /usr/local/include/morpho/flt.h \ + /usr/local/include/morpho/function.h \ + /usr/local/include/morpho/instance.h \ + /usr/local/include/morpho/int.h \ + /usr/local/include/morpho/invocation.h \ + /usr/local/include/morpho/json.h \ + /usr/local/include/morpho/list.h \ + /usr/local/include/morpho/matrix.h \ + /usr/local/include/morpho/memory.h \ + /usr/local/include/morpho/metafunction.h \ + /usr/local/include/morpho/morpho.h \ + /usr/local/include/morpho/nil.h \ + /usr/local/include/morpho/object.h \ + /usr/local/include/morpho/platform.h \ + /usr/local/include/morpho/range.h \ + /usr/local/include/morpho/signature.h \ + /usr/local/include/morpho/strng.h \ + /usr/local/include/morpho/tuple.h \ + /usr/local/include/morpho/upvalue.h \ + /usr/local/include/morpho/value.h \ + /usr/local/include/morpho/varray.h \ + /usr/local/include/morpho/version.h + +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ + /usr/local/include/morpho/array.h \ + /usr/local/include/morpho/bool.h \ + /usr/local/include/morpho/build.h \ + /usr/local/include/morpho/builtin.h \ + /usr/local/include/morpho/cfunction.h \ + /usr/local/include/morpho/classes.h \ + /usr/local/include/morpho/closure.h \ + /usr/local/include/morpho/clss.h \ + /usr/local/include/morpho/cmplx.h \ + /usr/local/include/morpho/dict.h \ + /usr/local/include/morpho/dictionary.h \ + /usr/local/include/morpho/err.h \ + /usr/local/include/morpho/error.h \ + /usr/local/include/morpho/flt.h \ + /usr/local/include/morpho/function.h \ + /usr/local/include/morpho/instance.h \ + /usr/local/include/morpho/int.h \ + /usr/local/include/morpho/invocation.h \ + /usr/local/include/morpho/json.h \ + /usr/local/include/morpho/list.h \ + /usr/local/include/morpho/matrix.h \ + /usr/local/include/morpho/memory.h \ + /usr/local/include/morpho/metafunction.h \ + /usr/local/include/morpho/morpho.h \ + /usr/local/include/morpho/nil.h \ + /usr/local/include/morpho/object.h \ + /usr/local/include/morpho/platform.h \ + /usr/local/include/morpho/range.h \ + /usr/local/include/morpho/signature.h \ + /usr/local/include/morpho/strng.h \ + /usr/local/include/morpho/tuple.h \ + /usr/local/include/morpho/upvalue.h \ + /usr/local/include/morpho/value.h \ + /usr/local/include/morpho/varray.h \ + /usr/local/include/morpho/version.h + +CMakeFiles/newlinalg.dir/src/xmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ + /usr/local/include/morpho/array.h \ + /usr/local/include/morpho/bool.h \ + /usr/local/include/morpho/build.h \ + /usr/local/include/morpho/builtin.h \ + /usr/local/include/morpho/cfunction.h \ + /usr/local/include/morpho/classes.h \ + /usr/local/include/morpho/closure.h \ + /usr/local/include/morpho/clss.h \ + /usr/local/include/morpho/cmplx.h \ + /usr/local/include/morpho/dict.h \ + /usr/local/include/morpho/dictionary.h \ + /usr/local/include/morpho/err.h \ + /usr/local/include/morpho/error.h \ + /usr/local/include/morpho/flt.h \ + /usr/local/include/morpho/function.h \ + /usr/local/include/morpho/instance.h \ + /usr/local/include/morpho/int.h \ + /usr/local/include/morpho/invocation.h \ + /usr/local/include/morpho/json.h \ + /usr/local/include/morpho/list.h \ + /usr/local/include/morpho/matrix.h \ + /usr/local/include/morpho/memory.h \ + /usr/local/include/morpho/metafunction.h \ + /usr/local/include/morpho/morpho.h \ + /usr/local/include/morpho/nil.h \ + /usr/local/include/morpho/object.h \ + /usr/local/include/morpho/platform.h \ + /usr/local/include/morpho/range.h \ + /usr/local/include/morpho/signature.h \ + /usr/local/include/morpho/strng.h \ + /usr/local/include/morpho/tuple.h \ + /usr/local/include/morpho/upvalue.h \ + /usr/local/include/morpho/value.h \ + /usr/local/include/morpho/varray.h \ + /usr/local/include/morpho/version.h + + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h: + +/usr/local/include/morpho/nil.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h: + +/usr/local/include/morpho/value.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h: + +/usr/local/include/morpho/tuple.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h: + +/usr/local/include/morpho/cfunction.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h: + +/usr/local/include/morpho/matrix.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h: + +/usr/local/include/morpho/build.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h: + +/usr/local/include/morpho/dictionary.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h: + +/usr/local/include/morpho/memory.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h: + +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h: + +/usr/local/include/morpho/morpho.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h: + +/usr/local/include/morpho/function.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h: + +/usr/local/include/morpho/bool.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h: + +/usr/local/include/morpho/version.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h: + +/usr/local/include/morpho/range.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h: + +/usr/local/include/morpho/signature.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h: + +/usr/local/include/morpho/invocation.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h: + +/usr/local/include/morpho/instance.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h: + +/usr/local/include/morpho/error.h: + +/usr/local/include/morpho/err.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h: + +/usr/local/include/morpho/cmplx.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h: + +/usr/local/include/morpho/clss.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h: + +/usr/local/include/morpho/closure.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h: + +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h: + +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h: + +/usr/local/include/morpho/list.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h: + +/usr/local/include/morpho/upvalue.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h: + +/usr/local/include/morpho/builtin.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h: + +/usr/local/include/morpho/dict.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h: + +/usr/local/include/morpho/object.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h: + +/usr/local/include/morpho/strng.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h: + +/usr/local/include/morpho/classes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h: + +/usr/local/include/morpho/varray.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h: + +/usr/local/include/morpho/flt.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h: + +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h: + +/usr/local/include/morpho/array.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h: + +/usr/local/include/morpho/json.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h: + +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h: + +/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h: + +/usr/local/include/morpho/int.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h: + +/usr/local/include/morpho/metafunction.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h: + +/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h: + +/usr/local/include/morpho/platform.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h: + +/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h: diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts new file mode 100644 index 000000000..a8f2c5b19 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts @@ -0,0 +1,2 @@ +# CMAKE generated file: DO NOT EDIT! +# Timestamp file for compiler generated dependencies management for newlinalg. diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/depend.make b/newlinalg/build/CMakeFiles/newlinalg.dir/depend.make new file mode 100644 index 000000000..617758b7a --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/depend.make @@ -0,0 +1,2 @@ +# Empty dependencies file for newlinalg. +# This may be replaced when dependencies are built. diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/flags.make b/newlinalg/build/CMakeFiles/newlinalg.dir/flags.make new file mode 100644 index 000000000..19dd03f60 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/flags.make @@ -0,0 +1,12 @@ +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 4.1 + +# compile C with /usr/bin/cc +C_DEFINES = -Dnewlinalg_EXPORTS + +C_INCLUDES = -I/usr/local/include/morpho -I/opt/homebrew/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers + +C_FLAGSarm64 = -arch arm64 -fPIC + +C_FLAGS = -arch arm64 -fPIC + diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/link.txt b/newlinalg/build/CMakeFiles/newlinalg.dir/link.txt new file mode 100644 index 000000000..268e50489 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/link.txt @@ -0,0 +1 @@ +/usr/bin/cc -arch arm64 -bundle -Wl,-headerpad_max_install_names -o newlinalg.so CMakeFiles/newlinalg.dir/src/newlinalg.c.o CMakeFiles/newlinalg.dir/src/xmatrix.c.o CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -Wl,-rpath,/usr/local/lib /usr/local/lib/libmorpho.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/progress.make b/newlinalg/build/CMakeFiles/newlinalg.dir/progress.make new file mode 100644 index 000000000..a69a57e8e --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/progress.make @@ -0,0 +1,5 @@ +CMAKE_PROGRESS_1 = 1 +CMAKE_PROGRESS_2 = 2 +CMAKE_PROGRESS_3 = 3 +CMAKE_PROGRESS_4 = 4 + diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o b/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o new file mode 100644 index 0000000000000000000000000000000000000000..e5ec20a2627bd3d800164001654318eea029ac95 GIT binary patch literal 3288 zcmds(Piz!b9LHbnUz9&ZO9TaZm@1NB?Lx(3e6d9|Z89xYdgy^$WZ*{gRANqQsSz9+bCf2R6sWFl)^t3&@`xT$zUmN3-X^O_OzRo_ZJOCq6gu7{n``sMc{(`X8M?4k zV>@w>&o2a4HZsfJ3CGKsrg1o##NZn~ew@v@7JY4J)+N{YK+1iH+lsEsvPp<$bTkSg ze-6hz15Q6C#2A7AF@jEw=BZQdo@N67sr~(-`2POMhD-O~5VOmz;_j_hv9QwGx3JPE z76zI{4^G*!(%84q)+~z4O=2|B>qJpBr}PFUf=Xyq$Htr|NiH>UiyS zJlwN~)`y?PLmt)k{>lDJxF@rVjph&OdqdZRK7&5nFQ(tQaBb&2ej_u7_gLd*hs@ngKhY&uXgEAjM6CPryH=sVZO_bfl?VkmB;-T*X@t+0O^q&h5X zswMVsfJk9n*HnF)Es_b)e9J+6ZA6b74L2fT{C-30CjBKkwI^9Gv0jBo^FOivh4mk- zZ?bOS7qzchx3j*=`dQYWvOd82Eb9T*gM9vB*3YvJSZ`o`mNnIj);Guc7VFPgf6Mx3 z)}OOpWqpzLUfdLFAEQ&g5!N5DKE?WVKL1Co={{3@T+de0$Q{4$;Ws2U!He5r)|YV% zH5Z-c&vOiZ<8ZVk;SB_Qw_mQ6bnD%Sl2N8xm;N8N(pf41 literal 0 HcmV?d00001 diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d b/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d new file mode 100644 index 000000000..6a4ac92e6 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d @@ -0,0 +1,824 @@ +CMakeFiles/newlinalg.dir/src/newlinalg.c.o: \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ + /usr/local/include/morpho/morpho.h /usr/local/include/morpho/build.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ + /usr/local/include/morpho/value.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ + /usr/local/include/morpho/varray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ + /usr/local/include/morpho/memory.h /usr/local/include/morpho/error.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ + /usr/local/include/morpho/dictionary.h \ + /usr/local/include/morpho/version.h \ + /usr/local/include/morpho/classes.h \ + /usr/local/include/morpho/builtin.h /usr/local/include/morpho/object.h \ + /usr/local/include/morpho/clss.h /usr/local/include/morpho/signature.h \ + /usr/local/include/morpho/upvalue.h \ + /usr/local/include/morpho/function.h \ + /usr/local/include/morpho/metafunction.h \ + /usr/local/include/morpho/cfunction.h \ + /usr/local/include/morpho/cmplx.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ + /usr/local/include/morpho/platform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ + /usr/local/include/morpho/closure.h \ + /usr/local/include/morpho/invocation.h \ + /usr/local/include/morpho/instance.h /usr/local/include/morpho/list.h \ + /usr/local/include/morpho/array.h /usr/local/include/morpho/range.h \ + /usr/local/include/morpho/strng.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ + /usr/local/include/morpho/dict.h /usr/local/include/morpho/tuple.h \ + /usr/local/include/morpho/err.h /usr/local/include/morpho/bool.h \ + /usr/local/include/morpho/flt.h /usr/local/include/morpho/int.h \ + /usr/local/include/morpho/nil.h /usr/local/include/morpho/json.h \ + /usr/local/include/morpho/matrix.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o new file mode 100644 index 0000000000000000000000000000000000000000..894b74645848ba989b7bf8a70be7215f5bf70ac8 GIT binary patch literal 26360 zcmeI4eSDPHb?5JBz#j1ugpm!HH`yk!gdyhDh}K#U5lKiYr^F^U#)y%S1d`F4^+H52 ziQ1tpal9?qZkHxbJT}-KVX~ncr#s4eYo&5p+S)C$orLZ>iFipWJ873R-p^;0pt9d{ z?|Gh?dBhOn?tbk)1qrYj)s6
    +I@iYTcnRu~@Er zHMhEij|vl>L(3d`f3^7@i9B^}E$y{+U9s-gPdByJ$6{6M{6qrD<&LVk%Hi-zC*P^{ z#;kBrIV>gnEI!T@(=Zeto)7XV;?w?dW6D7(B>9riXTTGij9L0VVcz(=0#`dJ7* z%!e$$_H(f^G&HtnLf=?8bTAQLkbWw>ARRI0KqM3$<wIEVA-xRgZH{cDW+vcC1VaA4Mnz2MYmPV+@$M&r2qppJk;n;UC zhNaGM-`Jozn4rGX)6D3Z$!2t9a&*+dSMr~p79D*W{t_NGW;OaMj+oxNA|Z2)e3Cz3 zP`-$`gvf%tHyCs9M$*q9r<6G}E!r<>mM1deJ_pJ|=AdgESW+`TwD$8~l)PRZGf*>M z=qsrkJLJ^;A?lX0r2!d5?&Qy7U~c-Y@T8+}lSAfb zCDR}NVj_Hfx)0rzh<)SNrxWq5_|}~C31eOmT}WBlge_*Kt?!!N*CZ@y&xG$!AC7Ov zUYpZLKm)1@5LtsY(5_y&7;lp(of^_hn;O) zzl+a-U$ynoWTk}fPxV#akF13|Y1BrmPvVluE4oaQCSe_opTm zMkf0{gRPy|cx?@E`P%-~QL8pATdcK#5) z4qvFIz1L;@0ba)X$_(od*yXiEe1`RhMEq{@&%ocdWbzYs{&P*1|6F79KNr3`{Ve)F z622$>RQywv{SNz|;qv!Z^r|0lB=@GBr zsh*RSX2>7|>ruu~`kvCxXC!SyI$7uPh~EA3s`tLQ87kHC_||J4ZOc>cYRW$wzAJqs z{z-iLlh}Gg`e=9qeR(78F++u~q4u`|G43B<8ANDAl$Q;i&Jo4O=^!;KTb2p}v1#XQd^H);y zPTpHMXL4xr3vk@DQj2CMaU~-$@ec_ zoGEi=<0PFw(S0O?_fDA;ef5?vl!hWZ z3yI68TWOcGb;e(9TN&SE9ht0*(FcpEm$l(#`hOz4F_p9CjLSIS=J>?mf)x9Q{xb{A z8jlD2sQ#x0W2rN&1xFS{*HohG3G6|{<}!X9;r50AGA`|?wEoc!#$ME3m!uD{r_(hl}fq1{avvT12U zn7B*rmxYJ750my?vYlBrmwn-B-RsGItpNRB%C_Df)88LnZEZU$Tg*-~?!qGvA(3*501X z-oE(E9cGQ)1HApRWEes9xg*IRQkX}*rgZ}lf>+CPFix)B`-585sLZ*&6r zgr2B)HTn>Gs-{m7{g7|6(D0okG$?bnjCD&wrhoB7yBFzy{;=*vSih8(nf`$(jH6R~ z?~-xv**ew<EZVZvOi+_2t5Dtl6kV*XMNBDjA9Fo_kSX+$knaF-9;|~eeMW<)t2aFp!ul4sa z)?0guFE5~<%v61Ve*7Hb17isN*6xjhV@}W~uBBb4DSL)-Me3X&ZGrbyf{ZiP<}&uE z%~=DCmKHku9>%UWV}l>*{xY|%A7(tyf3{}N9pEYZWZMq>+>>p;_Gu=D;UicB`798i=aVJ-v%sH38J{`Qo8Bm-vhqzr|xHBIK z!`q(uur?OI@1wsK{_oGS#=JgfjoBC9?9O|3yYrshwI*i{9 zH3nJ2Yl;k#sk)IV|Gm7oY>mRo})4@cx}aYUOPsl-QtVb z&zmP?4!>c7j>nQFW2wv`prox0XVPR`lk(&2k3B|c_xg}q(^>ng9%Nn0deuK8_jKav zN&KBxLDok|v+pIO?UGN<)^py2T*hBAy8Eovo%qPGCqwqRJpOEoTpn8od9u&ougpHK zd``JM_Q|mgb0_++KFc1$+Tw(#GjwG0s@+2RzJYfXV=}Lxi?P#_-8&9nhm>)ClJ&0W zGCHz-3O^Ankb3A(VaA=zJ|}Cf5*L5dHGuRZd`-^05C42#`H{2p%B`$2HhAj+3Dc&F z_*?Sl)#VZ0XWKr5oM%`&iL43F7WkOtmvb)9Kc%0^zEawkJPQwf2jlbbbcb!_T-e4F z$Ga=1Q{ttp_@ec7>PTjdNuFOx`=u^Vk7IkX)&swW{$vak{fQngsl#`{>ymt~(6_Sv z$Fqg+Z_@W^_kQ&^JAP)_WkBt6`LX-be&+9$(7)7S#|bbvPKaH2uV=>!d9T$NGT#sz zNS&bH_eGx((JLQ$Z^>D<9Sfv9@8_(o8G|1jnfc`PULN6-d2g8I$KkB`0GsE`$?)>$ zH+12Tnds^aYpIL0CwuP7(UG)8$En=8C~JPZLc7VnLiV_}pUd9D^K;G?7;pPe7nN#W_Qjj*x!6@K)Bl@Y&{xoIR8UE}4E_`Ej0Odt2= zq*5Ix#xbb5j4SM`bH){D@e#4T@9#Pe<+N{5>~R(MFhVk)^Dfuvk@48Ri;?q5#(3dn-}4Gj zFO4z3U*6v&y!e_4725OZ;W^lq zGaiq(v>#dhc|&}XJ2Y}9rr)!#jAL?Nz{|(ogaaSq9ZMWNo@GBK@||VRBzYunFyH0V zUEAM%d2{d#;6mexqSU@O*OXXBiwP(^NdRN?6PKLy~v!v$DaSYv#f02M9b1wUG8C%7FWxkj3%J)xfA?G#gb)J{?nx|iBm)9r7&b;ho zjOE=Ae9lPU6#u2~7BDYz<|KOv+dt9Q82h;~^fh)?*TZ%lsQo#2-<4U{QQv#ddm4C8 z1Mg|zJq^64fq%CKSVvsZbEWyNh}nCY-qXPUXAQhte`eixMNd`h+U6a1c6Ic8taVp& z{o0NlCM%|{rM+ugvuW>W?J~T`-QL#GQcLJ=`vrzFQ`_0uw4>FOR`Lym=7yd-Yl-hE zGj+{vtqmq8vV_unIiaD)i!LesSZh~V4z;)>JIXODDUB_Tm6^_lE>~JgNrXi&OqRtt zwIM=Vb9YOt$KK;*`NONyrCKH>fs(cL^}%9+964l3=_aq)fq0}0#C)Qu8J*SFcbLxZ zZSv_bE#1w*Tw171(mG6i(=PdRnA*BJgEE5RHnr|*=;&-Pt(eAqq`9rO3ze05AvD+B z;#D9v=<2AgYmmRKo$YND>u9KLHrfJfqn6qoD6jPa`)8w{uc@`Qp(De{Z*yCB7x4{E zI~rPd)i!rGbefIbxPq{Ny5IqsimQ{v#G7M)BN_f2O8?SJn5V{aw+R=m-er!rp}BXdX8cn zG0uK#J34B2mzff?#N1+4l}HT{@lGfuvhH(Z{7yQUw{Q@-Rz zmoS_s-Q4675_!gl#6p*D%~&*ke0x#TFXZ9>1m9QvmN82XfWHf_2l@Wkl64@iT@`g$ zQ3}S1zW_f;PlMd+s(Qy^#R2dyh<^m^A%4HZihUset9l()w1bkb8Kh}djSed|YJ3&A zhxqjlE7pOis4D8PVks!)7lZg*RjI>@g&?Y~Dsfm*1WLXs;7MbeBMz%4fFms z2qF1?3hpL;#9_rb5Z9_2c35!|lzcCPpCNw0Va1E!eCU+Jieunkk?#=rXW--Dr%6BH zuwp+*m#Nz4u%ZY2FXU?kv0+uc!-{h7Z;*SX!|J8rE96@Yex7`#4lCw@e@(tw4y%j7 zza(D~__xGQaaesGC5oNj1phlY0RA4hAB=+$Q0zJZ6uXMj!HV-JRmu&6-v(a+d%+rz zp=ZfL@LOOp_yRbLQvVT5f&T#ZfRgWakfCge0VV%=l)D#v1$+bS0VRDYDDoA9zXM)C zxsv~+TT>)RguFA?$5Y-9acXMO1T$!5sC_` zjytS421>c4!-{>N$lL3%dSs%L>zu>t6ew~X(fEYMZv_7b@#{e07j;h(&mQ~I5-tN*;i>L8Bi49|ONd`V-){!7A|Yz;z%ht>QhKV1=yX zUnIT=M3f~4lzi_PV^C$)d50B01yN1ah{K9EK*>j)vI(ks*9`!ml3uZy?>* z%7@zvR`=i!2T^e&xCyKQ$@{(y-~liS)`8{VHjw+(=1;&`U@ce#)_?|l8ayB2Hz~jo za4UEUd-7O@$13O(B&X)d|#=? zmw@*{7lD5a8jVk*z^ z&yIqJH2whiThP7W6JR^|aj+3w4{id#46X-121Yf0DcAyC0!qEJz>k6v@L^ECfcg>e zJosU77<>Rc3Elvn0M~)ipC1F0py)FJR)Pn>Ca@Qj{5=}q2tEqE3H(iPgT_a}FF`NW z_)_pg(6hi+FaoXxjmDp!zy&bqVNm#=0ww`E@u$G&pigN00QeuEkAq(T z6X5OOA&uV;c0u=m!oOYPYrrJ*22kW*ukq!e@F@j_PYGB77J-j|1{8VH1ulLB+zx#T z6#geQUdB7&a~u>t+$k}?0UiQ{&wfz&^lE%ND12%_;j>BO*Mt8Nx*QZamuh?oco@0} zTmweHa!@V=90Er`86Sqh)!<3+S#SWn4NQS6z$ADCJOr)+4`_TZ_zZMAxDssC_)Xv! zp}B)#mV;67R&Xi!r(g-V44kF$5m3grw2@;U>00RI!%3oZhCz%sBA{0g`UECn}!H-k}dI#>=)1DAqRK=PQ$UMA0Y? z%$BL(NCjZBLaoG5;! znDDhD*G3ACl^rjO6r5W0CXVynsTdUo-t!CWkxgHZeT8Psu+L8B6`>Og9sPZAB6RpD z&M(gzrT;|f{YpQs^xNWWAf(){O?{*vZ-9LAT*pW9d*`X|;BS(@hE6LFeaWVK=XI}& zK1uJ;^slIV-g((UmESwR>Qi~V^N=^S{8K8=9L?{YClz~iiPX-Rr0u&&^WUTNBCkD4 zmn*$S=?WPDc&2H6T}pq`v!~KO*7Q$m`9Dy4yVA>*en{!x5t=^X{Z80oP51QGqx3%2 z&rM2yUg^Kr`X5pHb4ov^^irjtQ2MmC=djX`D*bh(E0yk7`bI`FvCrQsJ*f4cRJv8^ zA1FOr>7Ob6verLQ_0z4i9Z=Ed2b8`})4!+n->CF{rEgPumdf)4{2TRQkBqA7+x1 zr&j5R($^?GMd?AUe}U3nO5d#X`;}g-^aPdfHl?4@`tMMBgVL2s|5EGwgwoF{y;13V zmENj!MCm%E`?da7r5{kbQ|UQM_bB}ft^fCx{*uyQ{*t+B^ThsI+&U z{{byuq~#AXUQ2%OJp1RG?w#LnW-O9)?|lb*E=zmwH)NeB>E8Q_tx9|ECw3@*?>zhj zHQ#`@Q#jvY(K2?|tHLXu5ZP|B$xNdtdjarhD(#9@h4H?*j|8 ze((L}XEeX}KJsOyz4v?nqW1OP7m9C)JZ?qFnq2kcz3;n2>dTrx*kjB3#($2Go=u-2 zZ#FIK`fU0%?aQWrh&3ak8TLF2x1M>VZkpIunM>fCD1=7z3>X-dk zcK%&~_U#Om-w~*PD3G5YmdWAw%Ru>;0{Zx6Apfxd{nbGG9}d*_T!7|`A*cR-4Wt(Y z=z##eIncfs{*tYqc>($5{2)91%|Q7-56~R}e*FRcJR6|@Dv9Q zo1foRkRSD}Z>XS)uZowfMKekV%jU+8D?uy#BA02YpGO1y zY;l$z{M20bas@7neQu&$pv#+Rb(n`MSMajRd790Q9aq&QN+3X1tkY zxwu%@%tgsu8=F|0y|flnpIuN2EYZ;1z{SK&Gqe&|`6(@J9qo;6F?(UM zt8Ken+RX5_y)6)DojDMvcX2&GqUK!3|Sc&xyl)f$sf<>?J$T3FI(3&)b2}F9FE>?VPCd?ty4tpNZ{IGlS`!-B-rZW)#qCiV602+6+1a&| z-+Axg2h=mI)Z5Lmm~@QolGA!*L$eKAQ`?X=ZFah=PhwmrS1r{yNK{Vea8WU<>rBOR zXVw65jpKj`E%+4cgk=7mAF)=*B z(VjNEyV!m!+^v1T1xn_K7VE65ZALh+Y9)0l+uqSIPKD^9j>udcXr#vl(HNB*I=0)a zo_um;97nK!vwU|)cWnm=+L1rqfm62DZ)1=%jHj}g!gXsqU`gTHo^6+RESZqU~}mJNh#_8aj6cA{ufcl;4hqj_#a%-K{$w?8uJsGq$u`B3e{8 zKDs^_jXc;gJEM)+9*B9cBR8hGwsl8CAP=g{j#2UI+q$}AOzf9VstY8!iQt2)*BA}m z=7(1Kp_P7Ug&$h(hnD#vKd`#oXXl4j`Jt75XoVkI?uVB7AwRHswa?BEt@1-F{m=?O zwA>FZ^Fx`yZ9Y3cw8{^y^g}EB&~iVt%n$j2)vJ7VerS~+TIq*Y_@U)~Xqg}K1FKj1 z?EKIwKeW;ht?)z3{m?Q$M4+pseTBzrwI90853TY;EB(+4KeXHrE%QSJV7lCA>W6Og zL#zDIN{I{% literal 0 HcmV?d00001 diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d new file mode 100644 index 000000000..917e684a5 --- /dev/null +++ b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d @@ -0,0 +1,826 @@ +CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c \ + /usr/local/include/morpho/platform.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ + /usr/local/include/morpho/varray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ + /usr/local/include/morpho/memory.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ + /usr/local/include/morpho/morpho.h /usr/local/include/morpho/build.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ + /usr/local/include/morpho/value.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ + /usr/local/include/morpho/error.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ + /usr/local/include/morpho/dictionary.h \ + /usr/local/include/morpho/version.h \ + /usr/local/include/morpho/classes.h \ + /usr/local/include/morpho/builtin.h /usr/local/include/morpho/object.h \ + /usr/local/include/morpho/clss.h /usr/local/include/morpho/signature.h \ + /usr/local/include/morpho/upvalue.h \ + /usr/local/include/morpho/function.h \ + /usr/local/include/morpho/metafunction.h \ + /usr/local/include/morpho/cfunction.h \ + /usr/local/include/morpho/cmplx.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ + /usr/local/include/morpho/closure.h \ + /usr/local/include/morpho/invocation.h \ + /usr/local/include/morpho/instance.h /usr/local/include/morpho/list.h \ + /usr/local/include/morpho/array.h /usr/local/include/morpho/range.h \ + /usr/local/include/morpho/strng.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ + /usr/local/include/morpho/dict.h /usr/local/include/morpho/tuple.h \ + /usr/local/include/morpho/err.h /usr/local/include/morpho/bool.h \ + /usr/local/include/morpho/flt.h /usr/local/include/morpho/int.h \ + /usr/local/include/morpho/nil.h /usr/local/include/morpho/json.h \ + /usr/local/include/morpho/matrix.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h \ + /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h \ + /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ + /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h \ + /usr/local/include/morpho/format.h diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o new file mode 100644 index 0000000000000000000000000000000000000000..3d7324ce7dea7f0c03698f8bf077d9e7d0c32a45 GIT binary patch literal 46992 zcmeIbeVmomdGCGi*(iGe6%`c(VN9?Y3@Run<~YfaAqkp^AxadL?aTlp5QZ6?84N~j z=5*VZMAKpsr^k*0o;m+rRzaKmGR!QIv}K>7Ud1%UAGE6@UDu z@K-Im%x}Txe8h{EX5zh`9t-I2bWcVN4V}%KI*kAt8kT-!+0p_Xp0+jmC-D=@!TX}< zW<89Fx_pfPx1nKW+xqowts$(TVbQ{+3j-BJL5?wnAjdC|uEK!;8yZ%0bQICW{3cty zsuCH~iS&tJ7m9oxo$YH|S6iCW`i6SGY1nPA4F1;>F64Xc_un_?1qi{)8B@sm7NV6TR*$DbyY({{i0-wIqN(%aE8YWniju_k3>*mdA|6ClP8}CUmJ)*UAu0|q@r{5H~9JJ+6&?1 zWcxwwm)}ml%Bbt6SH?$u)v2LtRJLTcy7+p0>yIuRB;Li1SKSI_xUkRHUW-wj6U$qN zUTBX&bX$3zbkp^G2E9jzqK8k?R!(>QYP*Ww6X>!#H)H4!dhE$H3`OWpx>o)H^a}s2 z7n}Y?i)ZTW+F_TbB>u#GAMQQbZ~P?#GE@J)!Ld=_{!}#2$vW1x@7>*@Jw#VVcXuV} zGorg2q3ITrdMdka8vIanE&g*-_38c@-At;saD3mS{TUzb+K;p=6BFkiHV~74?ZkyQ*&-qKw0&N5@)jx=T{yUV9qb>q%ea z+ABS!cDVc2=->|Yv8y9Gcqlz)w<|Y2?RZZvJJge#Hq?v$l5(nlE~E|diSi}ey3@-^ zyL@OyDth>7$~bY~U-r2EFp7;F#uvyoRG)voIeK{Tf{406Q>R09(C0!EUx8dl@fV6a zjpu>%>AR2c_wrTVZ>c}`MA3ZdH$z`nUq;4BuM*x1y@tOVQqkR+zx+bn&*^J@N&AW0 zA)Ow*9dgr$cBH2}Jvsg7F3O{mywf-O^ZGu&MBld*>3bIX{t$ZUO<&-2sr)|Q1ts}z zEt79Do_7}g_otrY$i@vL56X^?w_D9iP=~sEEKW%aTkoqe6eqPUt zdpx~t=$q+VhjylKAKIR~ZD@D;HhA1JgwHyt{`slD>}Yu08PV{r zozcNDmCbQRHXjn#-p+DJ#6+TpQm>1>A%qRp`QNR^S#mmW6)=89PFX&-IU$i z|F!(Wd)FS1_^ZIDRAg36zqoqE^qw4YpI!N23LnA*(fJnf$uJg*?`tPdUeME@%?CST z)^SsJ|9N?)B9j!(m~eLwVbOoza-qUi-|qfT(>EvOd(!lc^m*^xH~N>7_R}N!#__hl z=nekoWPhpsO&{u}KX1pzcF_NJ`u6ueAm`fO^_QMHJ>QYpW+UC$LwD{x^tHT@o@Z}U=Ot|FJZDqi%6)oBcC{;aD>}H9ytiOepN?&6H?}km zo7#Odh)wOzf!Ni~t5OHkW>?>QZ|dM_*w*3nY0jU?o_hMFCqHJ|vuocB?JM8fr1nkU zemoOxn(p+2t$5!$#rO5}IYoV}H+|FSeKvOvb)7<=eH;Cz&n?z(?%aZY)04b@bCU}C z3i{2R?eyjJ%d@k|+^0x?_UQV}O)Th_XQlsE`cp%X=avrbN-w3)-b~(`hj!;~qWmSX zj$MCMzeUHP-=2zoLtk=zw{D{KC8zgGXPR#eJ@8TCU zF8aUHF=t8s={k+!3ww{Zecz2Yu|LmMjP&RD^6mKY9rP>b7c`!x<7E=E~H;$Fb>eeV2J(I_>PZr!Jdc9Bi29;G?_^&&XHHXVzVqXL&Md7k#KZXZD)>*=^$zz7e~?t|-5k_)G7PrrJ3DNQ!k)7*EqY&!pTi<~g}Z@5+V$ zE0p^<{_mT#W2}GV(438V_(A!m9&Do;Keyuu^EYhfTiArlGF`@K5SoTANWZRPqv z&e!LRc${UkaSF*Kf&} zomckH$ZyZh$nU6|k>8n~k>B;^^aacx850}wtk0%0pUDRqGxyg%qBV(IKQdR=+HHG( zgPUiEwcY--&3WMQ3iJEwDa=RV<(@C%8Gi2hVz&+(cF*|9LDFX6XL*Ku-n?@G{nXi_ z;xsm@+zQGqwKeHPYl-CCRO|3CKj@~8tR?#n&xo!KK2d8*$$nUC!5OvJz85=UE_IIV zw`lE>;1lYoypkz}4-{75|Ags_SvMy54A`2eC*^gbG#S>u1L@3e%kS1qvd2<89$;Nm zEQi*Mr?Ib*df2UT@W(qCb9bhv=MQzT7Mc=|VKa`QdFKF#?ls?zZ z7<7m-50h_a`cCIlgKmQkw?xsODDTs(*%p8&S&utjti6N0ub!5Wm+&C($+V?S7i4?Y z>gMV|_~D$dN0<3C*@x10hu6`b3VY8F zFMTjdeds4~eM#@?iyZ$*eS_RCjC%YnVQOEkM-|si|2%QuN7y48x$X|@VeMlC+f1eW zen(em1L7j~Yb3w;Mk)4XurtOkx3AOl=8OgJr<`Avhy0g#sGO>lUyqN*leoBF&O(k# z$>U_H94A?*hqDXSUHu^`r^0&PY*;`Y&PlH6wcZJPKTap?les;DQS?$9$~V0nV$FJ( z{^Hs_3jGk5kDz!}7k99`*$}D1ULvuchUq{GMSnT-rw3BU1gt->K_HegAa! z#Zs*43UfNY-@&{r$2zC(qWqDo@UOY-kbDetzP`aL5_Bc>`|%HT+5Dj^(AWEG`;J^y z>+C4*o9E((=@*5*Ieq9_wOJuWT&=T-QN%=j%lIhmrDYQPv;5 zZnF*f59JAM5YHV-+ko!y8j_MPbyjHOz;s@+3>y*Tt&#i2_VXMMJ`UCvZnDxJ;g7%NYRcJlu!y4N1O z+E}u|Z-i{V{e4^+*>q0fc!c>Td7NDEJ7t@|kAyk2bmsh9vcB?HR^RtvtMcDPbJmjn z64wb?@axV$2Ays(Tc2fehxvZxlrGZwvm)QGy80?OH%hJnI3M$45H=F}lpBX^{pHFn zv8CWsUnkGH`zK6|ed@&4>GG@2*AbV|ycYgiOO~}S_RkV?^W)u&E7~hLbU}3DFk@=i zBk4`wITY%h3Ts2g9%pBMtaCaEHt5#5vH`_`s#DNc@C{YyOZ;h5)>d~8jUk=r(?I6A zoGaWpbUJkxjbta(dCZikZ{Gyg*=Ka! z6xPMXx+tF84qSk(oEx1u#5vYU){9}>c!l+a>hUUg17!z)R}tnC$#zs)e4^_78JkZq zXFtK(BOV_epNqT1=j*SY1*XP5s6Ff`(=63!qF*{W>4$#4Ko>&@{a}ebI64G4Cd>>fX;B-=5AMkLWwyxoP;n<;Nwr^0{** z(z|$2{ZjGrM~WBi`e}Jho_`0y_--`qgq{4K^0W8aIE34r5K~ z@0cHpx6az-cWjp74!Z-ReY(MVFhMb(*2jwg~_KVKfA)~_CSJIwS z(vPOXJWcys_?1xC((#c4_DPI!eTPXG#zW12RF2NY<+~Uc9fq;5n*9uocfWxR9OcYB zVqQ~R$3?x|J#hX$_7}NP&P>wWMF{>vdQa;d8-MYyzsY%XnKOiY{XGMnJNI%}#^l}Usd@KIf7s2L3ilx#eLZnE5OyhR3%?g%`$(@l zSDnWBSHsZuovDM{IggR9L<@It{)jA`fh==-65DBO`P**JQ(YfUzjGh%c4w~se5=>>Wq(h;`5S)J2k`FhjY)2+l#qpVt28I_lNyi`o|i34rw!! z7%K?hPMr>8E0P~xu0N`;_1GDI*f&!@l}!zXaGooWAJvFCq`mOF9m4>OTvUg`j8{cHBw2}IOKUd_LHg|Vr*wgj)i#<8}EgA0^ zGu%BHv)|%#I_^#6bO*!EzVN|2J2;>!cl$4;y>j z$>`65l6M{4I7%O4KW=n+iSu>24Y>-kyRdZDo!7ean;iWRyM#~qv)bHk<MF`8>0 z#-^Q*pzYk4PP--jyT&v5_bZTBwzbCgb3&fvx+#noMR6tkTwB0zD*Qr!&rHVdwRXiW z=@)K)f6&T3JCTlcq&xQrY19`bn{=tX?1M3XuBA@Czv=v@V9Sa7YoqvpAdC8Ya$V?j zf^MXfXKgN|J`UgbZX9#%(65VhSU8vD+E^!pR`JrFrSoqkd?hoVW|!q?RA7?XyRvO1pR&)E7@bK@ePQdczg zx^YNr(NodS4Ysz>o@^-d!?dG(O*tJs8_t%f&!{>&jdq2f#(>bS1L4jeyfcZjjQ63h zWZ7YFp;V7Ldl@YqZQ|Pxz0R_8?r}C>7%jc{mg@6+@Rp4yGh4g4fBe*z0z8S)<~+tP$%w z_4RUn;8klcr>lN^sLt{e_RoH%zXyPfmFUsgucaB1{TABU?Je7Sp|A3cXD`&cp0oLN zvX@f5{x9=u zU&H)xcQ~8C&(QDu86bLgXMlvo`|OE%dc;1X-MMsU1ZoeZe*(TC{S$Q!`FLJ$=_@bp z!r%D0Nb+vPAbDNCO-Fq%qK~3;uw=i@VN2N44(uu1`Hbs=uG}-S6rIm&zX_dI>h9(b zw%k5y8tqNsU$tLAyT3Lo%%us_9zbQ~vtQF5fZ}uq-L)a%nrFK(*)?UXNf&HHcLAJ? zI>RSj>Ws<4Jr?km&3)h4nt(_yBPzM*xC zc%98NYZcC*`*gl8|51TolT6w_bz=l|7G314lm4R&fAJK*L(KbsWuExr4Cl$(zmgs` zW{3GJ`{KL9K1q>`W%`=xG)SFN;%Rf3ic~G@W%(Ndv2*7)k;%<{ zgN(=~{u(1Q+{v%CHkJRNo#L@O!#faLPX6o-or!8+-uV~hD<>2A51CBz9cpvQd8&0z zmd%?i&v#LFQ9n-B?QPmrYtu}Lov6M&Vg10f^cLg`bN*A2)9H=5iEHbUb{JLWQs0A} z?_f<3bc<~d57hbhY9!NP$*J`MW$1o_d$x89?_)HE`xoR>o&k7h?LFE%D~D`+Q#)LY zPQo1y)m`fwg(vl{aLMEO>b}e=_Sv8l*_!%o!q(irApXJeWE??5p?d_RsLRWAU`xCVy}#6`61>Xal28^Bk$#o5PfL?-G{q5 zr&34R&|+H?E3fioGB)3pZE8IXf7cf1t*8z9H7^SH7JUEISPz|)7;+8SJyo|&X?ovvk@Nr#Q^<4 zcTZy3^^EN9JcWMY>dm~lx6box%R-m@KpsqdWO#jsGIJwIJJ!Kw7&LcZ5z1c#X9y?Ha-4W<{bNPZbcE4x%R@sYfuS0p2$K3%$POaB9hB+T*_P#&q>#=#I54t<$F;~9W%jM^U@E%PsN8s;t zbB6Etqv|CmADX!LiB9}GRRtf${F8QvhEF^uh{lJ?XSz7_ule5LtMH%LsT&WlKfP1x z_ARI zPfMI7zl-rN@Kjyp12SXm{Z*cm=jbVbe3|AX?E5*?7@$3eqHzE}sG_O**>R+1s+w*XR#;!!071^z| zne28{n|hnM{PsHTM5|7^2Lb=0Ic?Gw)ko|6{IEMc-JR!!G1b{)&f8zGM{JI9(B=SY z8=d28?*l!CwfV(iZLT=l!k=f;hU_IQOx*8v^@g9u!@;m$pT6_B<|o=Ww0JicDAEhI zs<_afU3-P}$W(TY>Dnw|mpS&WDWCfteTnyF3-4wp^c&v~Oe3$>8}v!ZurKm=XoF7F z2XsHw?cpP*?z5(7gR0s_*AB&Nl!V`Wn>Nw?lhV0jX*(!hG96-mD7m`QUM}fUwCX86 zhx>o(_uc54dBO?iIVUdWT|t-b9sIC#{;u_%&}Xubh+n~8e{-b0Ci49%?V!Gpn&|nL zZHGizZzrSLRQf9FS4ls|xaZcvwoZ!sl-faUqPD8@ZM84nKP{|%-96G^)8@121AC=^ zt!=O`_g=Sa5BX#BU&ZxGtfP{$CHj1+T{#-rTz^N_VAswMBe(18$Q91ZlBY!5H zC;HKdwqdQafHqLSalUnO({$uMq58)2JjK*6pkBt2`XIc*2mCA;@1eM` zuud?4726K}Nc^PlkT>2xp>7JpFBHG$@Gfm9_C3-o^6U@mPjnp5Rcx;Pj{e>1Q#9r# z<$8zy#<=Tk8d;o=r2nejLSK|V*pqVKF3|iksn5^{i#u&F-=0<7rRlk6t+Ro5}A>@ZRrI*T(2h`!JG6e~j}(S5pt!Y)`@llQtXe ztD2rU_W$0LO1*Eov)v2+=)&rBG#{tuYf!2AV(YPP%i1nuJnbx-AK+fU&Lrb+ca-tS>d=Su-HIId zHQ?cNWVoHPbhoF2{rU4t&cV}qKmQcIUBTTfy_f!u->zV;IGW#deagOLqBfLV=-sVD ziu!h9P8VAx~NA4Txdkb6aouD1qv0v{m&+C0|XB%OCj;+c!?Xd8$ zXGXn?#xu7DBkgwhD!=sNZCmeTFGq$`xPz3wjdUaLAjNvD8|Cg-jyvFWtkrWD4ed;$ zFZP;TpQZn~@0V~_s`&oavZ6k#`(N(6C%MV4A3C4gZ}&F)@8JDhzjyUT^VPjMzU9&X z^?Ycf_>L%PGrA*6-Z$9WaeQ*dCs*JT?nJ0vdvow{-~C{`Kdtse1^#(Q?gHiz7c$qF z%3R|P<`lOdclu;~(w)2YxWj08}uNn%HZzj(79@l zM41tHAvsHO^9+4Mh4;3H@bS*}RYyn9zwtY}$*(%n+h4`0-x$P<1MD`xiYOGZysJP05R|(^oq2uDa>{GjaW>OZuzS zWv%n6-o6U&puZV(4$o?hoAC8=+B@7G4U~1kJKq7SyS3;JP;7hsquCzcKB>D1+tZz^ z<>=3kN%H5xKGgT98{eVPohRv;bn4G_7t#k4-|cYyx%jT)ZoWq%TdvX_L;72lg6VcY74pjgC~e*d`Knbb06- z8rS_@%~SYR58s$6x}#aAF*&~f8{a`XVr$torFYO+-^J_0(7*8A@m`SDhwKGWN2fE_ z9{n@&v#E>LUq$>#o4hYvbgw4FmEkv8y3t$+-Ds_-xd3hL?z1hnGY#F74rwye+`8J| zZK4iGv=+2`qG7&)d~R>w>AhdyGfS*7lXDmBG~DMKQ77$*!Mm)E6j!EB@0X6KN0E-i zkFZhsNk@t+!%x03)Svl~n@g4ID4fGP8>@2b$D(_Enny90b925y=65>#DCnnfM)bD6 zj&ewcdkbGtaPzoT}+#d;3auS4g6);WZy#+wt@A5t@hT`($dzZv00N z{$_vdXXKM_%`2{&JUf&JUh>^L>Hn?|**=xR(OWzY=*(2_nt1>0eYN-5A#BD_qkMKQ z_-sFZ4~B82gkJ`Ju5A34lQnmd_u1(S+&xv5)f0R+&r0LkF`WqKISz+UA-(76>@!{B zHxuP}e#^Yy%xMkv%lplOy^k_KXH0wBc_p@8G_Rx%$+ciSuXOFN`GD@;j+|FM8~iVI z=w)8%-m61jvKdd$Qd@HOxiG&xrui1}@qCMZmz)QaUFo{gyV8a8W$YuqW34?I_l-E_NqiSZXGO!ocW^d3%pHSa?ic6|u{-~luWxdDL&+c`#@Hx-XzJB-J;*M*u&ac?<^IMX%H^?hDtVi&6P;<~%At+aE5+ zPjjYlZp^zceqB9c&x|u^I}_2IN$+QF;rp?C*J-!rNxj&b-4Wa!=1;Ca+x};{vi;tw z=*PGbiQ(Ze3F}_P?HKx``k~rpzug~?_t9*gS#(!9ow+nK_r~vJ zPW#k%l~s`Eo+aq zsP4=)O3!xVaY1!cTVapkyAY$*C!#)uZ?P2aZzO$_8-MVN+xr=RMmy`Xz8v%;f2_HY z(>djb@FKsAed!D)J|kgX{*FG8`FGK`saQvb`&iiLR{kEAod(%;S2#*VeWS&pr@r2u zlJlbc)70zf^z=Mq;PVt12t4ei<`DWB35jcp0v2CL&amhTHEfA&0m=*vn={oH;+Sc~fW zwel%JFQIg!7`MZEaQSn_BPXAO6=6o2u5fb~d-) z)wHs?YE|=HYg^ZLu5D}WxIDTp`e1ZNRa6yaFX@Q5)0d6vTNk#h{zPZ{rt4epX<4JwY6+q-&!cmaU*}74|f@>;?zy6Ruz)Qp>g3i zu5FoBh^JiAw?`ctSLm-jTEDSHf9=t#wf96#D_2I<4YLcp*S6l%+}_a~wW6O;L0DL| zsno{xQD-}?r+-^JHnfp;ZEI_Ddq@(?)3%Xzj+)o5Zf?D&sbynxN3?X~hL&cj(gk+h z+tJy)KI*t8SBr9nV=W8w>RBO>s@~N<+GyeS2eeG zuI;?nQb(7pj&6)@i5Ai`fBk#c8o-yI((gYy-6<9N>qNiSz^^s%wi@`4?w9}3{N7gh zMC7TKo5=F($9JKDQ`PgSrYjYJIqEO<>+-2N;wb)g8M#JS<^DHb7UE&hs6E0_;vY3Z zW-5N-$ox-Pe52y^e|szWO)~{Nr0`Ml_gMS`KHrG^vw4ABzw11Vh+kvzoFVErB7U32 zFDVm$)Z$GKBl16IA>C#2x3IX-Z?mt*i2SUL+;1u6OdLhN>$v2mANwczjmSTfgG&95 zdKeL(fvJ9rJ&cH7V)0wb#J_0q&-r#7k$)EpF8#DXHHJtlyLRXO#Fo?-0LyvNA@|OCCm)zhH`wC>KA87wh!vcK?p7|6YrK zv`l=xzKFoD*8Mv&|3emE&i*<%WYbUo&pm!4|s$6um zz{3dswH7~6ru?e+_>B7nqqNVU#qaXTM(}^=y*}b-nfMJeeZ;0ROzh}zuKU(eMGiBmmpXKAr*?)$Ed;MC<m!zwiC<>%_` zW%yrrm5(TAADMYRep8wJT^3(oCjL2#-&ZF7Ar9j8E7$(IkgZ?d!-)3TbB&L9vP}Cf zzt+buFOxrS@q5a|ulazFSW_ncfW;p#6aU%OkHrso zHY4J$p6qMeg5h) z{P&t;ttu1$!l!)xV`cb1v((4em&rfz79Vf(@DcLOUgqP=>1U6{Kj)K;$iMkEA5qS~ z%)Z^nHGV= zZ!J^)qZU6&%MdO(K2`duDtwt-5w6=dkFf5>CaCJWyHa+p}(;<088$Piw?%45w^ zQ2CdDPY_=3v1T#IRG@y5$C`Pd(#-+!4fV4<*31N%lGImuteFTZ-59W!@W^A$aoT+j z^pMAz*TEB{dl7sAd;xrn_yZnm_JdbIKjX0`5B_)3^?*##>UVjp*#vT*qovbhb_2Mb zbS>ZyNw>yh&2o^tM=i@dW|xBhM!F?nH|gp<*31SE5%+3T~CVY_o^KEb*$W-&P0s5Qr9RR-%J_&vk+zcvyBKQV40sIZ*$at)2!4D|k zGEjW41OF174E`C|jUUN?+d#!{0{=wupyVF|O1{Wr_N7~+=of@PWB8=uR#4@1fs$i0 zI0HF0d8}y!Ro{7_%9#xA1IK_$AAw4L9KQ(G90k8e_+C))dwh8PlNP_t;;TT(H_c=A z_@}+xgP_8XddzMCRsM2N_051kB7Tg=>?y9ZSLAG7dBEqo35FX99K0$gM` z+b{$EE8#;od%52NRj*?nYhDB;M~}ttviNR`-wMtqeiJA?EeD?k7lG14Ehv81d90ZU zN>4*KS$Uu<&tuJtpyD3_Ro^WhvqwMW>pS2vyBAb_wt?RUH-NIQZ8&I!ZvYiu4=Q{U z?OUk?5VxtDp&4l!R)J>K$| zeF0Sc_F4E-7QPw$7s4lll579Rqv-#D-JtBM1^fxPhxv*4Kj|^M85I9b9+`6G`tZ!s_WDd8`Hs&^jzWAGtRGCIUci_E%2E| zUd|qH7xWfT{2l;j!LQ3>%?42ECxK2s;LFfQnVIx12=$gfGyy3_^$C-GY9-v!mGfY;3QD@uOm2b1h>|%?*4pe=I=J@o3pyb(Q^fsff1J#b21PTva z;c=JYW0!k+-(~E56aNr66`V6WiuiWxW!2zh*tdBiXASThs+Ht|PsTF1Zva0>A+d92wFs{Cg>*6af>fPTtj%~nwP z9s*VF7LPS8pvqlf@$*2HJI7zb4%=oWXwZG4OS8GpPPi532ksQ1VQ&_~$P1 z^5jAB+v_pA1yuSj@JVnoC_9dJxB&bfcyy9aH{db51{@~55j;u$!@y)Vys1sQhC< z@sB)aUpgm>ULkxxsQ7)L_&?<_I}KDlCxD1_*}&Nz9|Kk2MIfv$n`7Z)jNUiV>v0RH zbhU;vLD@x>$L#B8`S$1p|2OF-f(OClXL>#AqqWa-=kFQt0O9rEKY>GMc>Z0W!rz+U z?d~b?AE8^oAEA#m9<$RdeE)bK{*1?LJqZ7n#U8UWL6twz!Y5ex-f9FMxPumd(18cm2Y##=iB75rV~`Y4IXQbkG1-G%svN74*ierCEs2P z9|Qg`!iP@x`QP$bvjIeP^(`K2)>!;1i?0PG*L5DV$4>L~>mIYZtg86EMsEgH?k11f zncx8B?iu6ddJI(jqaL#lfJcd642sVpkJ$;}pA-I8+NVF}F}oLhi|_|PRB+ic@SnkY zqo;w#peKWfTtCTU&4dac&bt~qw5uQEvF3OxihfS|*FohQ1j$l=)ML$y;1J=B;QvFo z_Fci6d7$iZj>qgX&iteLeI9GJfr{ViG1~&Z37<6}Mc1$LShE}y-=&82;H#u#Iz)Gh z>KAydnQieiJ=V~tT)v4$chSE0(X<=DyTCPIJGcz|9Jm;~8>|I4fOEhuunKGgCxfkE z21MpFWhd*wV<57hIRO4XcmSLW?zeFLk5YaQx(8ebc7vY*w}M{+yTH4^P2gHk_Vrb8 znT0O_(aD*$;BSI+EW8?A4LuqBJeaZY2yBLy9X<#SfLDSqg6QVN1bz`bHbxhX zqcaCVg}(^?4!9p&1nvXx0M#El!EW$&Q2pUHa0|E@+yvePZUC2ojo|&@5>WM3e^K}X z@OQy#Q0c3{TfvFo7BB*peh8z!1=PI;rGF7r`U4ie5Bx*uJr>>rej55w@GIaJ3-1E4 z)iXDM8^K2KQ{XZSUkv^M^a4=j&av<+Q0XUvN}mC52KB*-d%!_Z@(h3qKVaeeEIbb` zAzb%U#OF~^e70J67x-D|4WPR`-~jk#@BsL6Q2Wmc&x4PEJ>U&sw}o#7AAs%x7lS%a{s_1R%z?|mkAX`pycSe{ zoCAIothVsU;Jwfpa1j`Rb>K1j{U&e#{4n?;xDebA{%0@`)`EM$4}sm_Lm+*dYw@%v zSOdaCAJji{12_>}12Qz8*$7Smmx1HKCEz%axrd5Z2{4>^AH&Y&5JjtTK!Y2dJdW zZ`f_vW!Pv~YglC%84jQvm*244u*}=T%dpX~*09PjG917dTz}=T%dpX~*09PjG8~})yZnaThFyk@hP8%OhLPa_nO%Ov zZo@9aM#EaeD#OTdfd0ed>H7@34Z92*4Qman3;~xfQ}Ik@exk_~chod%gm`__fqaUsL!uQxAO;d|-EK%kEUiS#){?55Es$PiLaj z$v7|l4$(em^0%$gk__z$HYB%glE zE&g7MpNoAfKHM+-w3Qd`^L+)m6d&&IJ!$!$ZglLTPZ<4uqnF|@rN3v5-f8rHqqWXa z{4++MX7qnEdMtWXdEq|Oxug}n@AAm~{uFAElw$b0V`iA=iUo|?M-~WxZe>e~Sf$Up4wW zMqg&>vqoQM^qEH28~wDk$8w`L7`?)1jZ4zsrbbuYXp;1W&L>*``xD8NF7(G+Ouo<` zQ=+laF5~xAEB`$v?+r%3&*=YS?}qZb%`o6&z~<*zXMb4K4~^i-o;jQ%St z{~n|7HhQzs?=kuzqknAjeA(y+jQ)nvUov^VW%T7nf7j^0wetU~(Ho5ZGo#No`uj#d zW#vC-^lGCI8a>(QBS!y?$@5dAKWFrtM(0ePVWV|#T=uC&seVt2A7jv*b)Nnm;H(s9 z7K=Q66#pZ76_a)SUglZ!14e5-;Lbn`&Kj)MoV!_xHvzK8k<1ul9YDKiuDIGku2pdLI)% z>a0x^{Vr8~_zUC5pPGF=MLPYoPbB`28a-V!`NR0}vX$pka~5Lx!~OW1O~2uNgmXzK ze&K%qT+1Kcm-x8Fhx^MX&A!5Y|HAGi92 z`{uu8@`v{q?zHv~??VilJmLL^gC>6$eD#x>RKM_k!PQp(aG&~jt^b7kZGUd@;lBO{ zti8hhc8u+j6XbMHH*toWZkCd!z;qxbR&_JQm?%O7?Zy-8|5mNd3x;mGOOy=UVBrqzZ)W=7P0(|uf z34Fy6OHJ9{_Sr%!B6P9>QG>54qWF)_@XZ;%R4tVnC}b=lO;yr|OBQk!6&=S0W$FVcu_DXJTU6@mB6BN96Ei9> zp`n^vn)z4?LOWY;AafiNl`Iv&iG5h>`Oik4XWl{En;Cstw8U-sE*hssQ5k2tpZ3GEu3W+Hnb(zV;DF*1Ro zh?cdjO)abGA8R|%XnPw)nCjc<9ej(&0)wLbCxHrLxbFtVV*1Yr#j&mrb+)b8c-LLc zF!s%idNKJzs1>)igRcUuP_j@(TB&1Y6AchIG5VxU?rLva?@d#d88sx#bY)AkLX0I0 z?%LS8QeUSkaK(DOLoWo;G9d_ev}RpL=emYfP3@muOSVvN`?!=j)*zy*%3UODkiT;e zE~vT1J-aUIo?PQ6<9+=V;>|m7>{$Cb+*?VgJYFoWC(J1p#WXl0L>R-ECm(!@E26JI z#VU56h>D|%DaXXV@DyiQuTM|Kl>5Gu@3n=%j<%M2nmg7v@#&|SvvdBfYYD;mb~deC zCp9lQL!mcMg&Ih*&bF4O4P=cPoF8jxZe88ECTj3LEKm*M!A!t6P=x1q zqo5y2@Zfy1tf>W67sMVd%vA-M43j*aQ-~T?wQXF{(%ji*q#tJ1GEnL3R$-ut>0nHS z4`3BkId|iRRmn_nT~ph8=KlmWoGc%c6veUDh-T9t`Ghg+@=jp82bt)gLp7z z(KB!S$gTAYmn^LNcpR+xRx)_i>gJAnN&=dT0*v3Pw$7qtZSAY?Zcm0-y4B62hpt~g zN@A%#8H_YI`4J&^m4w{gUL4Y*`CUmG6qyL|!|~Iy!h#=`02{{X>R;fc(^)d z7eCF9pXS9+SH(|P#!qwOCmuT2ZA) zT^&EokDunnPgliHSH@3s<0l?qdR1V$Abz?ge!4n-njb&Si=VEFpRSCb=EhGv!2ZgZ zef)Gy{B(8vG(Uct7e8GUKV2C=&5fUUfc@N Date: Wed, 14 Jan 2026 10:42:48 -0500 Subject: [PATCH 192/473] Revert "Move files into subfolder to facilitate merge" This reverts commit 3bb2a01f36544fb3963ee6199cc7c39ea4875c9b. --- newlinalg/CMakeLists.txt => CMakeLists.txt | 0 newlinalg/build/CMakeCache.txt | 404 --- .../CMakeFiles/4.1.0/CMakeCCompiler.cmake | 84 - .../CMakeFiles/4.1.0/CMakeCXXCompiler.cmake | 104 - .../4.1.0/CMakeDetermineCompilerABI_C.bin | Bin 33560 -> 0 bytes .../4.1.0/CMakeDetermineCompilerABI_CXX.bin | Bin 33560 -> 0 bytes .../build/CMakeFiles/4.1.0/CMakeSystem.cmake | 15 - .../4.1.0/CompilerIdC/CMakeCCompilerId.c | 934 ------ .../build/CMakeFiles/4.1.0/CompilerIdC/a.out | Bin 33736 -> 0 bytes .../CMakeFiles/4.1.0/CompilerIdC/apple-sdk.c | 1 - .../CompilerIdCXX/CMakeCXXCompilerId.cpp | 949 ------ .../CMakeFiles/4.1.0/CompilerIdCXX/a.out | Bin 33736 -> 0 bytes .../4.1.0/CompilerIdCXX/apple-sdk.cpp | 1 - .../build/CMakeFiles/CMakeConfigureLog.yaml | 2177 ------------- .../CMakeDirectoryInformation.cmake | 16 - .../build/CMakeFiles/InstallScripts.json | 8 - newlinalg/build/CMakeFiles/Makefile.cmake | 62 - newlinalg/build/CMakeFiles/Makefile2 | 144 - .../build/CMakeFiles/TargetDirectories.txt | 13 - newlinalg/build/CMakeFiles/cmake.check_cache | 1 - .../CMakeFiles/newlinalg.dir/DependInfo.cmake | 25 - .../build/CMakeFiles/newlinalg.dir/build.make | 148 - .../newlinalg.dir/cmake_clean.cmake | 15 - .../newlinalg.dir/compiler_depend.internal | 1193 ------- .../newlinalg.dir/compiler_depend.make | 2860 ----------------- .../newlinalg.dir/compiler_depend.ts | 2 - .../CMakeFiles/newlinalg.dir/depend.make | 2 - .../build/CMakeFiles/newlinalg.dir/flags.make | 12 - .../build/CMakeFiles/newlinalg.dir/link.txt | 1 - .../CMakeFiles/newlinalg.dir/progress.make | 5 - .../newlinalg.dir/src/newlinalg.c.o | Bin 3288 -> 0 bytes .../newlinalg.dir/src/newlinalg.c.o.d | 824 ----- .../newlinalg.dir/src/xcomplexmatrix.c.o | Bin 26360 -> 0 bytes .../newlinalg.dir/src/xcomplexmatrix.c.o.d | 826 ----- .../CMakeFiles/newlinalg.dir/src/xmatrix.c.o | Bin 46992 -> 0 bytes .../newlinalg.dir/src/xmatrix.c.o.d | 825 ----- newlinalg/build/CMakeFiles/progress.marks | 1 - newlinalg/build/Makefile | 284 -- newlinalg/build/cmake_install.cmake | 80 - newlinalg/build/install_manifest.txt | 1 - .../CMakeDirectoryInformation.cmake | 16 - newlinalg/build/src/CMakeFiles/progress.marks | 1 - newlinalg/build/src/Makefile | 189 -- newlinalg/build/src/cmake_install.cmake | 45 - newlinalg/test/FailedTests.txt | 0 {newlinalg/src => src}/CMakeLists.txt | 0 {newlinalg/src => src}/newlinalg.c | 0 {newlinalg/src => src}/newlinalg.h | 0 {newlinalg/src => src}/xcomplexmatrix.c | 0 {newlinalg/src => src}/xcomplexmatrix.h | 0 {newlinalg/src => src}/xmatrix.c | 0 {newlinalg/src => src}/xmatrix.h | 0 .../arithmetic/complexmatrix_acc.morpho | 0 .../complexmatrix_add_complexmatrix.morpho | 0 .../complexmatrix_add_matrix.morpho | 0 .../arithmetic/complexmatrix_add_nil.morpho | 0 .../complexmatrix_add_scalar.morpho | 0 .../complexmatrix_addr_matrix.morpho | 0 .../arithmetic/complexmatrix_addr_nil.morpho | 0 .../complexmatrix_div_complexmatrix.morpho | 0 .../complexmatrix_div_matrix.morpho | 0 .../complexmatrix_div_scalar.morpho | 0 .../complexmatrix_divr_matrix.morpho | 0 .../complexmatrix_mul_complex.morpho | 0 .../complexmatrix_mul_complexmatrix.morpho | 0 .../complexmatrix_mul_matrix.morpho | 0 .../complexmatrix_mul_scalar.morpho | 0 .../complexmatrix_mulr_complex.xmorpho | 0 .../complexmatrix_mulr_matrix.morpho | 0 .../complexmatrix_sub_complexmatrix.morpho | 0 .../complexmatrix_sub_matrix.morpho | 0 .../complexmatrix_sub_scalar.morpho | 0 .../complexmatrix_subr_matrix.morpho | 0 .../complexmatrix_subr_scalar.morpho | 0 .../arithmetic/matrix_acc.morpho | 0 .../arithmetic/matrix_add_matrix.morpho | 0 .../arithmetic/matrix_add_nil.morpho | 0 .../arithmetic/matrix_add_scalar.morpho | 0 .../arithmetic/matrix_addr_nil.morpho | 0 .../arithmetic/matrix_addr_scalar.morpho | 0 .../arithmetic/matrix_div_matrix.morpho | 0 .../arithmetic/matrix_div_scalar.morpho | 0 .../arithmetic/matrix_mul_matrix.morpho | 0 .../arithmetic/matrix_mul_scalar.morpho | 0 .../arithmetic/matrix_negate.morpho | 0 .../arithmetic/matrix_sub_matrix.morpho | 0 .../arithmetic/matrix_sub_scalar.morpho | 0 .../arithmetic/matrix_subr_scalar.morpho | 0 .../assign/complexmatrix_assign.morpho | 0 .../assign/complexmatrix_clone.morpho | 0 .../test => test}/assign/matrix_assign.morpho | 0 .../complexmatrix_array_constructor.morpho | 0 ...rray_constructor_invalid_dimensions.morpho | 0 .../complexmatrix_constructor.morpho | 0 ...omplexmatrix_constructor_edge_cases.morpho | 0 ...plexmatrix_constructor_invalid_args.morpho | 0 .../complexmatrix_list_constructor.morpho | 0 ...mplexmatrix_list_vector_constructor.morpho | 0 .../complexmatrix_matrix_constructor.morpho | 0 ...plexmatrix_tuple_column_constructor.morpho | 0 .../complexmatrix_tuple_constructor.morpho | 0 .../complexmatrix_vector_constructor.morpho | 0 .../matrix_array_constructor.morpho | 0 ...rray_constructor_invalid_dimensions.morpho | 0 .../constructors/matrix_constructor.morpho | 0 .../matrix_constructor_edge_cases.morpho | 0 .../matrix_identity_constructor.morpho | 0 .../matrix_list_constructor.morpho | 0 .../matrix_list_vector_constructor.morpho | 0 .../matrix_tuple_constructor.morpho | 0 .../matrix_vector_constructor.morpho | 0 .../constructors/vector_constructor.morpho | 0 ...mplexmatrix_incompatible_dimensions.morpho | 0 .../complexmatrix_index_out_of_bounds.morpho | 0 .../complexmatrix_non_square_error.morpho | 0 .../index/complexmatrix_getcolumn.morpho | 0 .../index/complexmatrix_getindex.morpho | 0 .../index/complexmatrix_setcolumn.morpho | 0 .../index/complexmatrix_setindex.morpho | 0 .../index/complexmatrix_setindex_real.morpho | 0 .../index/complexmatrix_setslice.morpho | 0 .../index/complexmatrix_slice.morpho | 0 .../index/matrix_getcolumn.morpho | 0 .../index/matrix_getindex.morpho | 0 .../index/matrix_setcolumn.morpho | 0 .../index/matrix_setindex.morpho | 0 .../index/matrix_setslice.morpho | 0 .../test => test}/index/matrix_slice.morpho | 0 .../index/matrix_slice_bounds.morpho | 0 .../index/matrix_slice_infinite_range.morpho | 0 .../methods/complexmatrix_conj.morpho | 0 .../complexmatrix_conjTranspose.morpho | 0 .../methods/complexmatrix_count.morpho | 0 .../methods/complexmatrix_dimensions.morpho | 0 .../methods/complexmatrix_eigensystem.morpho | 0 .../methods/complexmatrix_eigenvalues.morpho | 0 .../methods/complexmatrix_enumerate.morpho | 0 .../methods/complexmatrix_format.morpho | 0 .../methods/complexmatrix_imag.morpho | 0 .../methods/complexmatrix_inner.morpho | 0 .../methods/complexmatrix_inverse.morpho | 0 .../complexmatrix_inverse_singular.morpho | 0 .../methods/complexmatrix_norm.morpho | 0 .../methods/complexmatrix_outer.morpho | 0 .../methods/complexmatrix_qr.morpho | 0 .../methods/complexmatrix_real.morpho | 0 .../methods/complexmatrix_reshape.morpho | 0 .../methods/complexmatrix_roll.morpho | 0 .../complexmatrix_roll_negative.morpho | 0 .../methods/complexmatrix_sum.morpho | 0 .../methods/complexmatrix_svd.morpho | 0 .../methods/complexmatrix_trace.morpho | 0 .../methods/complexmatrix_transpose.morpho | 0 .../test => test}/methods/matrix_count.morpho | 0 .../methods/matrix_dimensions.morpho | 0 .../methods/matrix_eigensystem.morpho | 0 .../methods/matrix_eigenvalues.morpho | 0 .../methods/matrix_enumerate.morpho | 0 .../methods/matrix_format.morpho | 0 .../test => test}/methods/matrix_inner.morpho | 0 .../methods/matrix_inverse.morpho | 0 .../methods/matrix_inverse_singular.morpho | 0 .../test => test}/methods/matrix_norm.morpho | 0 .../test => test}/methods/matrix_outer.morpho | 0 .../test => test}/methods/matrix_qr.morpho | 0 .../methods/matrix_reshape.morpho | 0 .../test => test}/methods/matrix_roll.morpho | 0 .../test => test}/methods/matrix_sum.morpho | 0 .../test => test}/methods/matrix_svd.morpho | 0 .../test => test}/methods/matrix_trace.morpho | 0 .../methods/matrix_transpose.morpho | 0 {newlinalg/test => test}/test.py | 0 172 files changed, 12268 deletions(-) rename newlinalg/CMakeLists.txt => CMakeLists.txt (100%) delete mode 100644 newlinalg/build/CMakeCache.txt delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake delete mode 100755 newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_C.bin delete mode 100755 newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_CXX.bin delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c delete mode 100755 newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/apple-sdk.c delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp delete mode 100755 newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out delete mode 100644 newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/apple-sdk.cpp delete mode 100644 newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml delete mode 100644 newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 newlinalg/build/CMakeFiles/InstallScripts.json delete mode 100644 newlinalg/build/CMakeFiles/Makefile.cmake delete mode 100644 newlinalg/build/CMakeFiles/Makefile2 delete mode 100644 newlinalg/build/CMakeFiles/TargetDirectories.txt delete mode 100644 newlinalg/build/CMakeFiles/cmake.check_cache delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/build.make delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/depend.make delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/flags.make delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/link.txt delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/progress.make delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o delete mode 100644 newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d delete mode 100644 newlinalg/build/CMakeFiles/progress.marks delete mode 100644 newlinalg/build/Makefile delete mode 100644 newlinalg/build/cmake_install.cmake delete mode 100644 newlinalg/build/install_manifest.txt delete mode 100644 newlinalg/build/src/CMakeFiles/CMakeDirectoryInformation.cmake delete mode 100644 newlinalg/build/src/CMakeFiles/progress.marks delete mode 100644 newlinalg/build/src/Makefile delete mode 100644 newlinalg/build/src/cmake_install.cmake delete mode 100644 newlinalg/test/FailedTests.txt rename {newlinalg/src => src}/CMakeLists.txt (100%) rename {newlinalg/src => src}/newlinalg.c (100%) rename {newlinalg/src => src}/newlinalg.h (100%) rename {newlinalg/src => src}/xcomplexmatrix.c (100%) rename {newlinalg/src => src}/xcomplexmatrix.h (100%) rename {newlinalg/src => src}/xmatrix.c (100%) rename {newlinalg/src => src}/xmatrix.h (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_acc.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_add_complexmatrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_add_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_add_nil.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_add_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_addr_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_addr_nil.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_div_complexmatrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_div_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_div_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_divr_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_mul_complex.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_mul_complexmatrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_mul_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_mul_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_mulr_complex.xmorpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_mulr_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_sub_complexmatrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_sub_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_sub_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_subr_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/complexmatrix_subr_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_acc.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_add_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_add_nil.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_add_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_addr_nil.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_addr_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_div_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_div_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_mul_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_mul_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_negate.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_sub_matrix.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_sub_scalar.morpho (100%) rename {newlinalg/test => test}/arithmetic/matrix_subr_scalar.morpho (100%) rename {newlinalg/test => test}/assign/complexmatrix_assign.morpho (100%) rename {newlinalg/test => test}/assign/complexmatrix_clone.morpho (100%) rename {newlinalg/test => test}/assign/matrix_assign.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_array_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_constructor_edge_cases.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_constructor_invalid_args.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_list_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_list_vector_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_matrix_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_tuple_column_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_tuple_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/complexmatrix_vector_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_array_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_array_constructor_invalid_dimensions.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_constructor_edge_cases.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_identity_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_list_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_list_vector_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_tuple_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/matrix_vector_constructor.morpho (100%) rename {newlinalg/test => test}/constructors/vector_constructor.morpho (100%) rename {newlinalg/test => test}/errors/complexmatrix_incompatible_dimensions.morpho (100%) rename {newlinalg/test => test}/errors/complexmatrix_index_out_of_bounds.morpho (100%) rename {newlinalg/test => test}/errors/complexmatrix_non_square_error.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_getcolumn.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_getindex.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_setcolumn.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_setindex.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_setindex_real.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_setslice.morpho (100%) rename {newlinalg/test => test}/index/complexmatrix_slice.morpho (100%) rename {newlinalg/test => test}/index/matrix_getcolumn.morpho (100%) rename {newlinalg/test => test}/index/matrix_getindex.morpho (100%) rename {newlinalg/test => test}/index/matrix_setcolumn.morpho (100%) rename {newlinalg/test => test}/index/matrix_setindex.morpho (100%) rename {newlinalg/test => test}/index/matrix_setslice.morpho (100%) rename {newlinalg/test => test}/index/matrix_slice.morpho (100%) rename {newlinalg/test => test}/index/matrix_slice_bounds.morpho (100%) rename {newlinalg/test => test}/index/matrix_slice_infinite_range.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_conj.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_conjTranspose.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_count.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_dimensions.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_eigensystem.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_eigenvalues.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_enumerate.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_format.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_imag.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_inner.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_inverse.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_inverse_singular.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_norm.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_outer.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_qr.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_real.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_reshape.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_roll.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_roll_negative.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_sum.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_svd.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_trace.morpho (100%) rename {newlinalg/test => test}/methods/complexmatrix_transpose.morpho (100%) rename {newlinalg/test => test}/methods/matrix_count.morpho (100%) rename {newlinalg/test => test}/methods/matrix_dimensions.morpho (100%) rename {newlinalg/test => test}/methods/matrix_eigensystem.morpho (100%) rename {newlinalg/test => test}/methods/matrix_eigenvalues.morpho (100%) rename {newlinalg/test => test}/methods/matrix_enumerate.morpho (100%) rename {newlinalg/test => test}/methods/matrix_format.morpho (100%) rename {newlinalg/test => test}/methods/matrix_inner.morpho (100%) rename {newlinalg/test => test}/methods/matrix_inverse.morpho (100%) rename {newlinalg/test => test}/methods/matrix_inverse_singular.morpho (100%) rename {newlinalg/test => test}/methods/matrix_norm.morpho (100%) rename {newlinalg/test => test}/methods/matrix_outer.morpho (100%) rename {newlinalg/test => test}/methods/matrix_qr.morpho (100%) rename {newlinalg/test => test}/methods/matrix_reshape.morpho (100%) rename {newlinalg/test => test}/methods/matrix_roll.morpho (100%) rename {newlinalg/test => test}/methods/matrix_sum.morpho (100%) rename {newlinalg/test => test}/methods/matrix_svd.morpho (100%) rename {newlinalg/test => test}/methods/matrix_trace.morpho (100%) rename {newlinalg/test => test}/methods/matrix_transpose.morpho (100%) rename {newlinalg/test => test}/test.py (100%) diff --git a/newlinalg/CMakeLists.txt b/CMakeLists.txt similarity index 100% rename from newlinalg/CMakeLists.txt rename to CMakeLists.txt diff --git a/newlinalg/build/CMakeCache.txt b/newlinalg/build/CMakeCache.txt deleted file mode 100644 index 12494014b..000000000 --- a/newlinalg/build/CMakeCache.txt +++ /dev/null @@ -1,404 +0,0 @@ -# This is the CMakeCache file. -# For build in directory: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build -# It was generated by CMake: /opt/homebrew/bin/cmake -# You can edit this file to change values found and used by cmake. -# If you do not want to change any of the values, simply exit the editor. -# If you do want to change a value, simply edit, save, and exit the editor. -# The syntax for the file is as follows: -# KEY:TYPE=VALUE -# KEY is the name of a variable in the cache. -# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!. -# VALUE is the current value for the KEY. - -######################## -# EXTERNAL cache entries -######################## - -//Path to a file. -CBLAS_INCLUDE:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers - -//Path to a library. -CBLAS_LIBRARY:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd - -//Path to a program. -CMAKE_ADDR2LINE:FILEPATH=CMAKE_ADDR2LINE-NOTFOUND - -//Path to a program. -CMAKE_AR:FILEPATH=/usr/bin/ar - -//Choose the type of build, options are: None Debug Release RelWithDebInfo -// MinSizeRel ... -CMAKE_BUILD_TYPE:STRING= - -//Enable/Disable color output during build. -CMAKE_COLOR_MAKEFILE:BOOL=ON - -//CXX compiler -CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++ - -//Flags used by the CXX compiler during all build types. -CMAKE_CXX_FLAGS:STRING= - -//Flags used by the CXX compiler during DEBUG builds. -CMAKE_CXX_FLAGS_DEBUG:STRING=-g - -//Flags used by the CXX compiler during MINSIZEREL builds. -CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the CXX compiler during RELEASE builds. -CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the CXX compiler during RELWITHDEBINFO builds. -CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//C compiler -CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc - -//Flags used by the C compiler during all build types. -CMAKE_C_FLAGS:STRING= - -//Flags used by the C compiler during DEBUG builds. -CMAKE_C_FLAGS_DEBUG:STRING=-g - -//Flags used by the C compiler during MINSIZEREL builds. -CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG - -//Flags used by the C compiler during RELEASE builds. -CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG - -//Flags used by the C compiler during RELWITHDEBINFO builds. -CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG - -//Path to a program. -CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND - -//Flags used by the linker during all build types. -CMAKE_EXE_LINKER_FLAGS:STRING= - -//Flags used by the linker during DEBUG builds. -CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during MINSIZEREL builds. -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during RELEASE builds. -CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during RELWITHDEBINFO builds. -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Enable/Disable output of compile commands during generation. -CMAKE_EXPORT_COMPILE_COMMANDS:BOOL= - -//Value Computed by CMake. -CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/pkgRedirects - -//Path to a program. -CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool - -//Install path prefix, prepended onto install directories. -CMAKE_INSTALL_PREFIX:PATH=/usr/local - -//Path to a program. -CMAKE_LINKER:FILEPATH=/usr/bin/ld - -//Path to a program. -CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make - -//Flags used by the linker during the creation of modules during -// all build types. -CMAKE_MODULE_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of modules during -// DEBUG builds. -CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of modules during -// MINSIZEREL builds. -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of modules during -// RELEASE builds. -CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of modules during -// RELWITHDEBINFO builds. -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_NM:FILEPATH=/usr/bin/nm - -//Path to a program. -CMAKE_OBJCOPY:FILEPATH=CMAKE_OBJCOPY-NOTFOUND - -//Path to a program. -CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump - -//Build architectures for OSX -CMAKE_OSX_ARCHITECTURES:STRING= - -//Minimum OS X version to target for deployment (at runtime); newer -// APIs weak linked. Set to empty string for default value. -CMAKE_OSX_DEPLOYMENT_TARGET:STRING= - -//The product will be built against the headers and libraries located -// inside the indicated SDK. -CMAKE_OSX_SYSROOT:STRING= - -//Value Computed by CMake -CMAKE_PROJECT_COMPAT_VERSION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_DESCRIPTION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_HOMEPAGE_URL:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_NAME:STATIC=morpho-newlinalg - -//Value Computed by CMake -CMAKE_PROJECT_VERSION:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_MAJOR:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_MINOR:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_PATCH:STATIC= - -//Value Computed by CMake -CMAKE_PROJECT_VERSION_TWEAK:STATIC= - -//Path to a program. -CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib - -//Path to a program. -CMAKE_READELF:FILEPATH=CMAKE_READELF-NOTFOUND - -//Flags used by the linker during the creation of shared libraries -// during all build types. -CMAKE_SHARED_LINKER_FLAGS:STRING= - -//Flags used by the linker during the creation of shared libraries -// during DEBUG builds. -CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the linker during the creation of shared libraries -// during MINSIZEREL builds. -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELEASE builds. -CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the linker during the creation of shared libraries -// during RELWITHDEBINFO builds. -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//If set, runtime paths are not added when installing shared libraries, -// but are added when building. -CMAKE_SKIP_INSTALL_RPATH:BOOL=NO - -//If set, runtime paths are not added when using shared libraries. -CMAKE_SKIP_RPATH:BOOL=NO - -//Flags used by the archiver during the creation of static libraries -// during all build types. -CMAKE_STATIC_LINKER_FLAGS:STRING= - -//Flags used by the archiver during the creation of static libraries -// during DEBUG builds. -CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING= - -//Flags used by the archiver during the creation of static libraries -// during MINSIZEREL builds. -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING= - -//Flags used by the archiver during the creation of static libraries -// during RELEASE builds. -CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING= - -//Flags used by the archiver during the creation of static libraries -// during RELWITHDEBINFO builds. -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING= - -//Path to a program. -CMAKE_STRIP:FILEPATH=/usr/bin/strip - -//Path to a program. -CMAKE_TAPI:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi - -//If this value is on, makefiles will be generated without the -// .SILENT directive, and all commands will be echoed to the console -// during the make. This is useful for debugging only. With Visual -// Studio IDE projects all commands are done without /nologo. -CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE - -//Path to a library. -LAPACK_LIBRARY:FILEPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd - -//Path to a file. -MORPHO_HEADER:FILEPATH=/usr/local/include/morpho/morpho.h - -//Path to a library. -MORPHO_LIBRARY:FILEPATH=/usr/local/lib/libmorpho.dylib - -//Value Computed by CMake -morpho-newlinalg_BINARY_DIR:STATIC=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build - -//Value Computed by CMake -morpho-newlinalg_IS_TOP_LEVEL:STATIC=ON - -//Value Computed by CMake -morpho-newlinalg_SOURCE_DIR:STATIC=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg - - -######################## -# INTERNAL cache entries -######################## - -//ADVANCED property for variable: CMAKE_ADDR2LINE -CMAKE_ADDR2LINE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_AR -CMAKE_AR-ADVANCED:INTERNAL=1 -//This is the directory where this CMakeCache.txt was created -CMAKE_CACHEFILE_DIR:INTERNAL=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build -//Major version of cmake used to create the current loaded cache -CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4 -//Minor version of cmake used to create the current loaded cache -CMAKE_CACHE_MINOR_VERSION:INTERNAL=1 -//Patch version of cmake used to create the current loaded cache -CMAKE_CACHE_PATCH_VERSION:INTERNAL=0 -//ADVANCED property for variable: CMAKE_COLOR_MAKEFILE -CMAKE_COLOR_MAKEFILE-ADVANCED:INTERNAL=1 -//Path to CMake executable. -CMAKE_COMMAND:INTERNAL=/opt/homebrew/bin/cmake -//Path to cpack program executable. -CMAKE_CPACK_COMMAND:INTERNAL=/opt/homebrew/bin/cpack -//Path to ctest program executable. -CMAKE_CTEST_COMMAND:INTERNAL=/opt/homebrew/bin/ctest -//ADVANCED property for variable: CMAKE_CXX_COMPILER -CMAKE_CXX_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_DEBUG -CMAKE_CXX_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_COMPILER -CMAKE_C_COMPILER-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS -CMAKE_C_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_C_FLAGS_RELWITHDEBINFO -CMAKE_C_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_DLLTOOL -CMAKE_DLLTOOL-ADVANCED:INTERNAL=1 -//Path to cache edit program executable. -CMAKE_EDIT_COMMAND:INTERNAL=/opt/homebrew/bin/ccmake -//Executable file format -CMAKE_EXECUTABLE_FORMAT:INTERNAL=MACHO -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_EXPORT_COMPILE_COMMANDS -CMAKE_EXPORT_COMPILE_COMMANDS-ADVANCED:INTERNAL=1 -//Name of external makefile project generator. -CMAKE_EXTRA_GENERATOR:INTERNAL= -//Name of generator. -CMAKE_GENERATOR:INTERNAL=Unix Makefiles -//Generator instance identifier. -CMAKE_GENERATOR_INSTANCE:INTERNAL= -//Name of generator platform. -CMAKE_GENERATOR_PLATFORM:INTERNAL= -//Name of generator toolset. -CMAKE_GENERATOR_TOOLSET:INTERNAL= -//Source directory with the top level CMakeLists.txt file for this -// project -CMAKE_HOME_DIRECTORY:INTERNAL=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg -//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL -CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_LINKER -CMAKE_LINKER-ADVANCED:INTERNAL=1 -//Name of CMakeLists files to read -CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt -//ADVANCED property for variable: CMAKE_MAKE_PROGRAM -CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_NM -CMAKE_NM-ADVANCED:INTERNAL=1 -//number of local generators -CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=2 -//ADVANCED property for variable: CMAKE_OBJCOPY -CMAKE_OBJCOPY-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_OBJDUMP -CMAKE_OBJDUMP-ADVANCED:INTERNAL=1 -//Platform information initialized -CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_RANLIB -CMAKE_RANLIB-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_READELF -CMAKE_READELF-ADVANCED:INTERNAL=1 -//Path to CMake installation. -CMAKE_ROOT:INTERNAL=/opt/homebrew/share/cmake -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_INSTALL_RPATH -CMAKE_SKIP_INSTALL_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_SKIP_RPATH -CMAKE_SKIP_RPATH-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS -CMAKE_STATIC_LINKER_FLAGS-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_DEBUG -CMAKE_STATIC_LINKER_FLAGS_DEBUG-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL -CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELEASE -CMAKE_STATIC_LINKER_FLAGS_RELEASE-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO -CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_STRIP -CMAKE_STRIP-ADVANCED:INTERNAL=1 -//ADVANCED property for variable: CMAKE_TAPI -CMAKE_TAPI-ADVANCED:INTERNAL=1 -//uname command -CMAKE_UNAME:INTERNAL=/usr/bin/uname -//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE -CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1 - diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake b/newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake deleted file mode 100644 index 19a664d89..000000000 --- a/newlinalg/build/CMakeFiles/4.1.0/CMakeCCompiler.cmake +++ /dev/null @@ -1,84 +0,0 @@ -set(CMAKE_C_COMPILER "/usr/bin/cc") -set(CMAKE_C_COMPILER_ARG1 "") -set(CMAKE_C_COMPILER_ID "AppleClang") -set(CMAKE_C_COMPILER_VERSION "17.0.0.17000013") -set(CMAKE_C_COMPILER_VERSION_INTERNAL "") -set(CMAKE_C_COMPILER_WRAPPER "") -set(CMAKE_C_STANDARD_COMPUTED_DEFAULT "17") -set(CMAKE_C_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_C_STANDARD_LATEST "23") -set(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert;c_std_17;c_std_23") -set(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes") -set(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros") -set(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert") -set(CMAKE_C17_COMPILE_FEATURES "c_std_17") -set(CMAKE_C23_COMPILE_FEATURES "c_std_23") - -set(CMAKE_C_PLATFORM_ID "Darwin") -set(CMAKE_C_SIMULATE_ID "") -set(CMAKE_C_COMPILER_FRONTEND_VARIANT "GNU") -set(CMAKE_C_COMPILER_APPLE_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk") -set(CMAKE_C_SIMULATE_VERSION "") -set(CMAKE_C_COMPILER_ARCHITECTURE_ID "arm64") - - - -set(CMAKE_AR "/usr/bin/ar") -set(CMAKE_C_COMPILER_AR "") -set(CMAKE_RANLIB "/usr/bin/ranlib") -set(CMAKE_C_COMPILER_RANLIB "") -set(CMAKE_LINKER "/usr/bin/ld") -set(CMAKE_LINKER_LINK "") -set(CMAKE_LINKER_LLD "") -set(CMAKE_C_COMPILER_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_C_COMPILER_LINKER_ID "AppleClang") -set(CMAKE_C_COMPILER_LINKER_VERSION 1167.5) -set(CMAKE_C_COMPILER_LINKER_FRONTEND_VARIANT GNU) -set(CMAKE_MT "") -set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") -set(CMAKE_COMPILER_IS_GNUCC ) -set(CMAKE_C_COMPILER_LOADED 1) -set(CMAKE_C_COMPILER_WORKS TRUE) -set(CMAKE_C_ABI_COMPILED TRUE) - -set(CMAKE_C_COMPILER_ENV_VAR "CC") - -set(CMAKE_C_COMPILER_ID_RUN 1) -set(CMAKE_C_SOURCE_FILE_EXTENSIONS c;m) -set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) -set(CMAKE_C_LINKER_PREFERENCE 10) -set(CMAKE_C_LINKER_DEPFILE_SUPPORTED ) -set(CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED ) -set(CMAKE_C_LINKER_PUSHPOP_STATE_SUPPORTED ) - -# Save compiler ABI information. -set(CMAKE_C_SIZEOF_DATA_PTR "8") -set(CMAKE_C_COMPILER_ABI "") -set(CMAKE_C_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_C_LIBRARY_ARCHITECTURE "") - -if(CMAKE_C_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_C_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") -endif() - -if(CMAKE_C_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_C_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_C_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_C_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") -set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "") -set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift") -set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks") diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake b/newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake deleted file mode 100644 index 030ebedcf..000000000 --- a/newlinalg/build/CMakeFiles/4.1.0/CMakeCXXCompiler.cmake +++ /dev/null @@ -1,104 +0,0 @@ -set(CMAKE_CXX_COMPILER "/usr/bin/c++") -set(CMAKE_CXX_COMPILER_ARG1 "") -set(CMAKE_CXX_COMPILER_ID "AppleClang") -set(CMAKE_CXX_COMPILER_VERSION "17.0.0.17000013") -set(CMAKE_CXX_COMPILER_VERSION_INTERNAL "") -set(CMAKE_CXX_COMPILER_WRAPPER "") -set(CMAKE_CXX_STANDARD_COMPUTED_DEFAULT "14") -set(CMAKE_CXX_EXTENSIONS_COMPUTED_DEFAULT "ON") -set(CMAKE_CXX_STANDARD_LATEST "23") -set(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17;cxx_std_20;cxx_std_23") -set(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters") -set(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates") -set(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates") -set(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17") -set(CMAKE_CXX20_COMPILE_FEATURES "cxx_std_20") -set(CMAKE_CXX23_COMPILE_FEATURES "cxx_std_23") -set(CMAKE_CXX26_COMPILE_FEATURES "") - -set(CMAKE_CXX_PLATFORM_ID "Darwin") -set(CMAKE_CXX_SIMULATE_ID "") -set(CMAKE_CXX_COMPILER_FRONTEND_VARIANT "GNU") -set(CMAKE_CXX_COMPILER_APPLE_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk") -set(CMAKE_CXX_SIMULATE_VERSION "") -set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID "arm64") - - - -set(CMAKE_AR "/usr/bin/ar") -set(CMAKE_CXX_COMPILER_AR "") -set(CMAKE_RANLIB "/usr/bin/ranlib") -set(CMAKE_CXX_COMPILER_RANLIB "") -set(CMAKE_LINKER "/usr/bin/ld") -set(CMAKE_LINKER_LINK "") -set(CMAKE_LINKER_LLD "") -set(CMAKE_CXX_COMPILER_LINKER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld") -set(CMAKE_CXX_COMPILER_LINKER_ID "AppleClang") -set(CMAKE_CXX_COMPILER_LINKER_VERSION 1167.5) -set(CMAKE_CXX_COMPILER_LINKER_FRONTEND_VARIANT GNU) -set(CMAKE_MT "") -set(CMAKE_TAPI "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/tapi") -set(CMAKE_COMPILER_IS_GNUCXX ) -set(CMAKE_CXX_COMPILER_LOADED 1) -set(CMAKE_CXX_COMPILER_WORKS TRUE) -set(CMAKE_CXX_ABI_COMPILED TRUE) - -set(CMAKE_CXX_COMPILER_ENV_VAR "CXX") - -set(CMAKE_CXX_COMPILER_ID_RUN 1) -set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;mpp;CPP;ixx;cppm;ccm;cxxm;c++m) -set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) - -foreach (lang IN ITEMS C OBJC OBJCXX) - if (CMAKE_${lang}_COMPILER_ID_RUN) - foreach(extension IN LISTS CMAKE_${lang}_SOURCE_FILE_EXTENSIONS) - list(REMOVE_ITEM CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${extension}) - endforeach() - endif() -endforeach() - -set(CMAKE_CXX_LINKER_PREFERENCE 30) -set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) -set(CMAKE_CXX_LINKER_DEPFILE_SUPPORTED ) -set(CMAKE_LINKER_PUSHPOP_STATE_SUPPORTED ) -set(CMAKE_CXX_LINKER_PUSHPOP_STATE_SUPPORTED ) - -# Save compiler ABI information. -set(CMAKE_CXX_SIZEOF_DATA_PTR "8") -set(CMAKE_CXX_COMPILER_ABI "") -set(CMAKE_CXX_BYTE_ORDER "LITTLE_ENDIAN") -set(CMAKE_CXX_LIBRARY_ARCHITECTURE "") - -if(CMAKE_CXX_SIZEOF_DATA_PTR) - set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") -endif() - -if(CMAKE_CXX_COMPILER_ABI) - set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") -endif() - -if(CMAKE_CXX_LIBRARY_ARCHITECTURE) - set(CMAKE_LIBRARY_ARCHITECTURE "") -endif() - -set(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX "") -if(CMAKE_CXX_CL_SHOWINCLUDES_PREFIX) - set(CMAKE_CL_SHOWINCLUDES_PREFIX "${CMAKE_CXX_CL_SHOWINCLUDES_PREFIX}") -endif() - - - - - -set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "/usr/local/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include") -set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "c++") -set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift") -set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks") -set(CMAKE_CXX_COMPILER_CLANG_RESOURCE_DIR "") - -set(CMAKE_CXX_COMPILER_IMPORT_STD "") -### Imported target for C++23 standard library -set(CMAKE_CXX23_COMPILER_IMPORT_STD_NOT_FOUND_MESSAGE "Unsupported generator: Unix Makefiles") - - - diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_C.bin b/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_C.bin deleted file mode 100755 index 49baf3fc6880192893bbf1fa61ae89d447472c51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33560 zcmeI5Uuau(6vux_Q%PuDTJg`cQzH&pMOy#Vt&}0jOqON~Y0*4{b@C&BZraP5M3a;@ zqhiJ!D7r0U56(RaD|QcxY!fjLoe})A2VpIa2|mcCOjgAQQP6I%c+T(MEPq-Q+=CB( z51jk^opbK*-1Ga~n;(5C=lr!_ZgdJ^5hPa9Zc>*`hy%h!Ga>FJ9VV4>)Z_Q<@;x`g z-eysYn_a6c&hr}GC}r3e2{(t;dUvx=n07n4S*au?Qs%XpylK$Tn$K-FHd8WhVVn1L zQ*5Gmb50W}p0G9FqM5H&a?Nhc(Kx4kxqMbnkDJccd>b7`eaxAK?M7*;l>$;u zrKk0DLh9*cM%m5$2F-jCGYQ+RIU4ixdpM@@cs*fHL&R-<1T-pX8QaLoT6@=0CZhSM zx>H@GTst4(GsJDIubHi5{W}W=LOXrlKn-}Yr7p5r)^jl=Tu-egwg-eLcJZVr1T%Tc zv?F8>lg(__lb$5|HX7~wgqWeRgLIUXrM6cd`JR6x>u8aSlzv;He=3*lpVVXhiNa)p zY?dBUuH$P*;P_X+Z9ROn_xzO;Tl~XMlFvnI?8!+Vzf;ZCcH0lz9;KMtAB`-VXn&lC zzw<`n=MIu`%=jMs^fR*5YoU6cFXZxCs&88#)uqRb)sN7?`QIrL8yb5}n|ZO^Ps;Hk zaXV%d$!-V;fWZHdKy|-Zsy-;nmwH6`a)(%{Iz@T8r&y-5qh$9ye8izI4_80wddFL-~T#vKcKgmJMu^{*W)=4S57b)tXo#ugOd{p=HN{fp9qJlfIBQ;0e{@ z(QJHTESgPi9w3i#K5sDJcjL%sEuY119!dG{1s1ou)-QaXchY&>WuEkO=<`wt2!H?x zfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=9 z00@8p2!H?xfB*=900@8p2!H?xfB*<60INfgAE+N;bOs=X- zs>%$1y=AbB>ElvMC-i7qtcp$Q`TV5T9OiDqRDlrJzU!<|MQ_oR%VN2cd{n7rzpxU0 ztJ+GO{1Fuuf_A*G=(4KT@}}!=hmsk!#8csCW$X!U%hTfB&w{(ZT&cc1|NS4mM?cwm z&VTlDaL=KY3%fsJp1{n`;yahzkb@YaD3;&jV|ww4a>8yUR*plP&whfeyjQaY5m;qoA27?Jv8*E e_2ZxCuB0BQXrmvUPX6@Lnd=V~O7qVg6n_Cro1I7i diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_CXX.bin b/newlinalg/build/CMakeFiles/4.1.0/CMakeDetermineCompilerABI_CXX.bin deleted file mode 100755 index a7dcd17269852a77104fb145b9c7ee8feeea379a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33560 zcmeI5QD~c06vuDUbW3g5)+xGCx1}KBoU~h3Ydd^Mwx(S$q){`Ct#VD1ukFX$WPV9m zQ#zVa2NgxT2i-&;Hn1o%Ut}T$b!Ez4lu2I{i;fLnR!~qBb$wVp=YHSUe#wf0dvg8{ zoZNfvIrsG3UvA;{p`5Rle!5;GgiDaPNjH+lJVG23KAH)!nRGv?l(Aq}s3-JzH?Nk8 z+FZJHgT;BKC{W6HC=oAptNnq}HDTG6w9HB+DUmX-jpi+bhVp!))?uct5VrYTE8-Ew zl{rnMOl32<)r95wycRC7@AB*;qk~toC;;WjdKpsz~)A z<=XkYc1Xb7Z=2=g>OG5uqmPCey9oT9OsG)Bt8ca4=}Ip*I;Ep76V()AO~BRQjaNbhS-7lzVgvow%$ z9iP6PoOo^F;V;i^SeHBT+v_uaTJw>bXR4#iU#I5kxRtMZ9w47OAB`;c)A=|L-*cz1 z$>(LCx({cE)^paCTBx4XjvYYgZcoL?M^ghMV?UTPRwH`$)N- zsiF}4U2nH+=F75$l>Nn{bnnbV@iGJiKmY_l00cnbe@I|?Qp_)J6SJ2a#O#%7ac#Ly z%q}(*XXy>K{5l-%?B0{p$Fyv}OdrY{y*t~U6(Sn$?(Ex>FG$VEYUy4hyjONbL*b5SP>@&c z=_}+lnKjay(HjZJ5R{lGK zC7?c6KlmM3L+`SB^(rL8XFl&%BQOI25C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X z009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T2KI5C8!X009sH0T8&A2$cW-`K@#| zoCO3x00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l z00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1pZ3|d{k`AQm)(C zrkneq+rquXZBg?8bw>}_E2aB{ONx!`a+6kwKPlcVhX?n(X%p zxkedMl_6zMWLK-6>CZ|>Cs5kZ6Y-nNtIa-TpFSY9Oj=K7%z$>a&k-=B=kr6FGsXcchVXi!!;?~MBlBBl%n;7@(NKU#L=S9ty;EQOMg2|TV7Xc zIKEH%{VnaS;)nR*H(v3aUz)k&$U_J2KHd7faq9fQg(K~6EnK`<|JJ?(Rh8^7z^Dv11FLytMzt2j96_|H<8Fu6J&E*Vz7KqqlbPU}I;)dy}0L zKaO0PX+3vf@U!uo&HqpPxBYS26MOpi?_co0{OhGtPdye~|M`deKK^3jwy}@4_I!Kq GX7LvatDKww diff --git a/newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake b/newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake deleted file mode 100644 index 0c52e24fd..000000000 --- a/newlinalg/build/CMakeFiles/4.1.0/CMakeSystem.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_HOST_SYSTEM "Darwin-24.3.0") -set(CMAKE_HOST_SYSTEM_NAME "Darwin") -set(CMAKE_HOST_SYSTEM_VERSION "24.3.0") -set(CMAKE_HOST_SYSTEM_PROCESSOR "arm64") - - - -set(CMAKE_SYSTEM "Darwin-24.3.0") -set(CMAKE_SYSTEM_NAME "Darwin") -set(CMAKE_SYSTEM_VERSION "24.3.0") -set(CMAKE_SYSTEM_PROCESSOR "arm64") - -set(CMAKE_CROSSCOMPILING "FALSE") - -set(CMAKE_SYSTEM_LOADED 1) diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c deleted file mode 100644 index ab3c35931..000000000 --- a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/CMakeCCompilerId.c +++ /dev/null @@ -1,934 +0,0 @@ -#ifdef __cplusplus -# error "A C++ compiler has been selected for C." -#endif - -#if defined(__18CXX) -# define ID_VOID_MAIN -#endif -#if defined(__CLASSIC_C__) -/* cv-qualifiers did not exist in K&R C */ -# define const -# define volatile -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_C) -# define COMPILER_ID "SunPro" -# if __SUNPRO_C >= 0x5100 - /* __SUNPRO_C = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_C>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_C>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_C & 0xF) -# endif - -#elif defined(__HP_cc) -# define COMPILER_ID "HP" - /* __HP_cc = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_cc/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_cc/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_cc % 100) - -#elif defined(__DECC) -# define COMPILER_ID "Compaq" - /* __DECC_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000) - -#elif defined(__IBMC__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ >= 800 -# define COMPILER_ID "XL" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__IBMC__) && !defined(__COMPILER_VER__) && __IBMC__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMC__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMC__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMC__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(__clang__) && defined(__cray__) -# define COMPILER_ID "CrayClang" -# define COMPILER_VERSION_MAJOR DEC(__cray_major__) -# define COMPILER_VERSION_MINOR DEC(__cray_minor__) -# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__ORANGEC__) -# define COMPILER_ID "OrangeC" -# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) - -#elif defined(__RENESAS__) -# define COMPILER_ID "Renesas" -/* __RENESAS_VERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF) - -#elif defined(__TINYC__) -# define COMPILER_ID "TinyCC" - -#elif defined(__BCC__) -# define COMPILER_ID "Bruce" - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) && defined(__ti__) -# define COMPILER_ID "TIClang" - # define COMPILER_VERSION_MAJOR DEC(__ti_major__) - # define COMPILER_VERSION_MINOR DEC(__ti_minor__) - # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) -# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) -# define COMPILER_ID "GNU" -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__DCC__) && defined(_DIAB_TOOL) -# define COMPILER_ID "Diab" - # define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__) - # define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__) - # define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__) - # define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__) - - -#elif defined(__SDCC_VERSION_MAJOR) || defined(SDCC) -# define COMPILER_ID "SDCC" -# if defined(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MAJOR DEC(__SDCC_VERSION_MAJOR) -# define COMPILER_VERSION_MINOR DEC(__SDCC_VERSION_MINOR) -# define COMPILER_VERSION_PATCH DEC(__SDCC_VERSION_PATCH) -# else - /* SDCC = VRP */ -# define COMPILER_VERSION_MAJOR DEC(SDCC/100) -# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10) -# define COMPILER_VERSION_PATCH DEC(SDCC % 10) -# endif - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__clang__) && defined(__ti__) -# if defined(__ARM_ARCH) -# define ARCHITECTURE_ID "ARM" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) || defined(__CPARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__RENESAS__) -# if defined(__CCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__CCRL__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__CCRH__) -# define ARCHITECTURE_ID "RH850" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#define C_STD_99 199901L -#define C_STD_11 201112L -#define C_STD_17 201710L -#define C_STD_23 202311L - -#ifdef __STDC_VERSION__ -# define C_STD __STDC_VERSION__ -#endif - -#if !defined(__STDC__) && !defined(__clang__) && !defined(__RENESAS__) -# if defined(_MSC_VER) || defined(__ibmxl__) || defined(__IBMC__) -# define C_VERSION "90" -# else -# define C_VERSION -# endif -#elif C_STD > C_STD_17 -# define C_VERSION "23" -#elif C_STD > C_STD_11 -# define C_VERSION "17" -#elif C_STD > C_STD_99 -# define C_VERSION "11" -#elif C_STD >= C_STD_99 -# define C_VERSION "99" -#else -# define C_VERSION "90" -#endif -const char* info_language_standard_default = - "INFO" ":" "standard_default[" C_VERSION "]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -#ifdef ID_VOID_MAIN -void main() {} -#else -# if defined(__CLASSIC_C__) -int main(argc, argv) int argc; char *argv[]; -# else -int main(int argc, char* argv[]) -# endif -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR) - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} -#endif diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out deleted file mode 100755 index a27d804924265c7ec7ca192bab4f890795f56aaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33736 zcmeI5Uuau(6vt1})F!qynU=Xx?c&39%1F~z>`=sXw%e*(Te>|&>-_DuxoxxMpGm5l z%r2V@>QvSWLhaMuhPu7XDJ?iCD$)l*`l3!y>R(ovAR^2Sv7U49FKL>_DQ=J71LywE z`JLbI+;czom%JtC^J~BSRYT+;7ANZ(R=~irgIFe91&+xxmtVQ##)xI*It#6QxEHFGLd& z6-^8#d0}b3uXMh!P9lD3O~v`;Jxp48+S~TD6-7e&5b$V8$ymXYqSm|OQK^WLHQ3Oi zRQY_H@(V)t{=8c{E}yfVon23Mw0GvuNUo$V_C@BT7#67~Uz7L`66JhicRHayj$V{#$38dCt%3U?uYM;rCj$^|+NMT@UcA^?X*Gi23Fu&ptlq#Ul6J z!YVQQJZ!g4N}(36XZN8@){F9r>xaE>JG~;%7sxReZmDh=R%Eu%Z z*E{ZxuAL~Gv$p&`tClt8V+&jt*FP~^p}y$s+SdK>Kr)_+#>{kITPhVZACDP{p}k~9 zQZXYtm`um}+Kn`ST=lGx9vJS^b|z~iB1Sr*BIckm63g~Awdx3epP7kFl)p9#vFD8QU(k}K)_`pUgUd!!tIRdE?3I@xujVfOR*FYC3vyOMJc{PO&%`bkId3(b z#ivgq`Smd>UIZHiKmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l z00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1V8`;KmY_l00ck)1VG@X6R>~(>7%XI z@6de|)?-AEqta-A#cjofYD1zO+*|ZE(>Tudbje?$TZh?r^eL=%HaMd7#+P0(1rc3CYVWqTdc>D=bAR($?11YgMZ z@6o@~&xZ8o7T-^*OwG!w*&<+@1q`-Z zU{Qu^$%<8!?RWv9?dCZuixSs$?c17JuJ8>urA(1Jo?~2&QF3zeP7B?$JRi2AL>{7J zLBEsRiT^j5)5{!2AUTqysvdXew)f6?Kk!`q==`W*GzH%EK69Yz=Od?#U!QBZFn#vO znRDUfr;CHLt}o~34>-HSl}m@uAAa%p*B4&h@yh1YHyZ!V*|5;~{_XB3HlGN*6R+EO zcH;N`KU#V(Uhb%S=)RUedv7%VzwLkX diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp deleted file mode 100644 index b35f567c2..000000000 --- a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/CMakeCXXCompilerId.cpp +++ /dev/null @@ -1,949 +0,0 @@ -/* This source file must have a .cpp extension so that all C++ compilers - recognize the extension without flags. Borland does not know .cxx for - example. */ -#ifndef __cplusplus -# error "A C compiler has been selected for C++." -#endif - -#if !defined(__has_include) -/* If the compiler does not have __has_include, pretend the answer is - always no. */ -# define __has_include(x) 0 -#endif - - -/* Version number components: V=Version, R=Revision, P=Patch - Version date components: YYYY=Year, MM=Month, DD=Day */ - -#if defined(__INTEL_COMPILER) || defined(__ICC) -# define COMPILER_ID "Intel" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# if defined(__GNUC__) -# define SIMULATE_ID "GNU" -# endif - /* __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later, - except that a few beta releases use the old format with V=2021. */ -# if __INTEL_COMPILER < 2021 || __INTEL_COMPILER == 202110 || __INTEL_COMPILER == 202111 -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10) -# if defined(__INTEL_COMPILER_UPDATE) -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE) -# else -# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER % 10) -# endif -# else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER) -# define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE) - /* The third version component from --version is an update index, - but no macro is provided for it. */ -# define COMPILER_VERSION_PATCH DEC(0) -# endif -# if defined(__INTEL_COMPILER_BUILD_DATE) - /* __INTEL_COMPILER_BUILD_DATE = YYYYMMDD */ -# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) -# endif -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif (defined(__clang__) && defined(__INTEL_CLANG_COMPILER)) || defined(__INTEL_LLVM_COMPILER) -# define COMPILER_ID "IntelLLVM" -#if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -#endif -#if defined(__GNUC__) -# define SIMULATE_ID "GNU" -#endif -/* __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and - * later. Look for 6 digit vs. 8 digit version number to decide encoding. - * VVVV is no smaller than the current year when a version is released. - */ -#if __INTEL_LLVM_COMPILER < 1000000L -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 10) -#else -# define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000) -# define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER % 100) -#endif -#if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -#endif -#if defined(__GNUC__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -#elif defined(__GNUG__) -# define SIMULATE_VERSION_MAJOR DEC(__GNUG__) -#endif -#if defined(__GNUC_MINOR__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -#endif -#if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -#endif - -#elif defined(__PATHCC__) -# define COMPILER_ID "PathScale" -# define COMPILER_VERSION_MAJOR DEC(__PATHCC__) -# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__) -# if defined(__PATHCC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__) -# endif - -#elif defined(__BORLANDC__) && defined(__CODEGEARC_VERSION__) -# define COMPILER_ID "Embarcadero" -# define COMPILER_VERSION_MAJOR HEX(__CODEGEARC_VERSION__>>24 & 0x00FF) -# define COMPILER_VERSION_MINOR HEX(__CODEGEARC_VERSION__>>16 & 0x00FF) -# define COMPILER_VERSION_PATCH DEC(__CODEGEARC_VERSION__ & 0xFFFF) - -#elif defined(__BORLANDC__) -# define COMPILER_ID "Borland" - /* __BORLANDC__ = 0xVRR */ -# define COMPILER_VERSION_MAJOR HEX(__BORLANDC__>>8) -# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF) - -#elif defined(__WATCOMC__) && __WATCOMC__ < 1200 -# define COMPILER_ID "Watcom" - /* __WATCOMC__ = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__WATCOMC__) -# define COMPILER_ID "OpenWatcom" - /* __WATCOMC__ = VVRP + 1100 */ -# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100) -# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10) -# if (__WATCOMC__ % 10) > 0 -# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10) -# endif - -#elif defined(__SUNPRO_CC) -# define COMPILER_ID "SunPro" -# if __SUNPRO_CC >= 0x5100 - /* __SUNPRO_CC = 0xVRRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# else - /* __SUNPRO_CC = 0xVRP */ -# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8) -# define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF) -# define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC & 0xF) -# endif - -#elif defined(__HP_aCC) -# define COMPILER_ID "HP" - /* __HP_aCC = VVRRPP */ -# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000) -# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100) -# define COMPILER_VERSION_PATCH DEC(__HP_aCC % 100) - -#elif defined(__DECCXX) -# define COMPILER_ID "Compaq" - /* __DECCXX_VER = VVRRTPPPP */ -# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000) -# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100) -# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000) - -#elif defined(__IBMCPP__) && defined(__COMPILER_VER__) -# define COMPILER_ID "zOS" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__open_xl__) && defined(__clang__) -# define COMPILER_ID "IBMClang" -# define COMPILER_VERSION_MAJOR DEC(__open_xl_version__) -# define COMPILER_VERSION_MINOR DEC(__open_xl_release__) -# define COMPILER_VERSION_PATCH DEC(__open_xl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__open_xl_ptf_fix_level__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__ibmxl__) && defined(__clang__) -# define COMPILER_ID "XLClang" -# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__) -# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__) -# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__) -# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__) - - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800 -# define COMPILER_ID "XL" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800 -# define COMPILER_ID "VisualAge" - /* __IBMCPP__ = VRP */ -# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100) -# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10) -# define COMPILER_VERSION_PATCH DEC(__IBMCPP__ % 10) - -#elif defined(__NVCOMPILER) -# define COMPILER_ID "NVHPC" -# define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__) -# if defined(__NVCOMPILER_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__) -# endif - -#elif defined(__PGI) -# define COMPILER_ID "PGI" -# define COMPILER_VERSION_MAJOR DEC(__PGIC__) -# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__) -# if defined(__PGIC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) -# endif - -#elif defined(__clang__) && defined(__cray__) -# define COMPILER_ID "CrayClang" -# define COMPILER_VERSION_MAJOR DEC(__cray_major__) -# define COMPILER_VERSION_MINOR DEC(__cray_minor__) -# define COMPILER_VERSION_PATCH DEC(__cray_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(_CRAYC) -# define COMPILER_ID "Cray" -# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR) -# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR) - -#elif defined(__TI_COMPILER_VERSION__) -# define COMPILER_ID "TI" - /* __TI_COMPILER_VERSION__ = VVVRRRPPP */ -# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000) -# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000) -# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000) - -#elif defined(__CLANG_FUJITSU) -# define COMPILER_ID "FujitsuClang" -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# define COMPILER_VERSION_INTERNAL_STR __clang_version__ - - -#elif defined(__FUJITSU) -# define COMPILER_ID "Fujitsu" -# if defined(__FCC_version__) -# define COMPILER_VERSION __FCC_version__ -# elif defined(__FCC_major__) -# define COMPILER_VERSION_MAJOR DEC(__FCC_major__) -# define COMPILER_VERSION_MINOR DEC(__FCC_minor__) -# define COMPILER_VERSION_PATCH DEC(__FCC_patchlevel__) -# endif -# if defined(__fcc_version) -# define COMPILER_VERSION_INTERNAL DEC(__fcc_version) -# elif defined(__FCC_VERSION) -# define COMPILER_VERSION_INTERNAL DEC(__FCC_VERSION) -# endif - - -#elif defined(__ghs__) -# define COMPILER_ID "GHS" -/* __GHS_VERSION_NUMBER = VVVVRP */ -# ifdef __GHS_VERSION_NUMBER -# define COMPILER_VERSION_MAJOR DEC(__GHS_VERSION_NUMBER / 100) -# define COMPILER_VERSION_MINOR DEC(__GHS_VERSION_NUMBER / 10 % 10) -# define COMPILER_VERSION_PATCH DEC(__GHS_VERSION_NUMBER % 10) -# endif - -#elif defined(__TASKING__) -# define COMPILER_ID "Tasking" - # define COMPILER_VERSION_MAJOR DEC(__VERSION__/1000) - # define COMPILER_VERSION_MINOR DEC(__VERSION__ % 100) -# define COMPILER_VERSION_INTERNAL DEC(__VERSION__) - -#elif defined(__ORANGEC__) -# define COMPILER_ID "OrangeC" -# define COMPILER_VERSION_MAJOR DEC(__ORANGEC_MAJOR__) -# define COMPILER_VERSION_MINOR DEC(__ORANGEC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__ORANGEC_PATCHLEVEL__) - -#elif defined(__RENESAS__) -# define COMPILER_ID "Renesas" -/* __RENESAS_VERSION__ = 0xVVRRPP00 */ -# define COMPILER_VERSION_MAJOR HEX(__RENESAS_VERSION__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR HEX(__RENESAS_VERSION__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH HEX(__RENESAS_VERSION__ >> 8 & 0xFF) - -#elif defined(__SCO_VERSION__) -# define COMPILER_ID "SCO" - -#elif defined(__ARMCC_VERSION) && !defined(__clang__) -# define COMPILER_ID "ARMCC" -#if __ARMCC_VERSION >= 1000000 - /* __ARMCC_VERSION = VRRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#else - /* __ARMCC_VERSION = VRPPPP */ - # define COMPILER_VERSION_MAJOR DEC(__ARMCC_VERSION/100000) - # define COMPILER_VERSION_MINOR DEC(__ARMCC_VERSION/10000 % 10) - # define COMPILER_VERSION_PATCH DEC(__ARMCC_VERSION % 10000) -#endif - - -#elif defined(__clang__) && defined(__apple_build_version__) -# define COMPILER_ID "AppleClang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif -# define COMPILER_VERSION_TWEAK DEC(__apple_build_version__) - -#elif defined(__clang__) && defined(__ARMCOMPILER_VERSION) -# define COMPILER_ID "ARMClang" - # define COMPILER_VERSION_MAJOR DEC(__ARMCOMPILER_VERSION/1000000) - # define COMPILER_VERSION_MINOR DEC(__ARMCOMPILER_VERSION/10000 % 100) - # define COMPILER_VERSION_PATCH DEC(__ARMCOMPILER_VERSION/100 % 100) -# define COMPILER_VERSION_INTERNAL DEC(__ARMCOMPILER_VERSION) - -#elif defined(__clang__) && defined(__ti__) -# define COMPILER_ID "TIClang" - # define COMPILER_VERSION_MAJOR DEC(__ti_major__) - # define COMPILER_VERSION_MINOR DEC(__ti_minor__) - # define COMPILER_VERSION_PATCH DEC(__ti_patchlevel__) -# define COMPILER_VERSION_INTERNAL DEC(__ti_version__) - -#elif defined(__clang__) -# define COMPILER_ID "Clang" -# if defined(_MSC_VER) -# define SIMULATE_ID "MSVC" -# endif -# define COMPILER_VERSION_MAJOR DEC(__clang_major__) -# define COMPILER_VERSION_MINOR DEC(__clang_minor__) -# define COMPILER_VERSION_PATCH DEC(__clang_patchlevel__) -# if defined(_MSC_VER) - /* _MSC_VER = VVRR */ -# define SIMULATE_VERSION_MAJOR DEC(_MSC_VER / 100) -# define SIMULATE_VERSION_MINOR DEC(_MSC_VER % 100) -# endif - -#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__)) -# define COMPILER_ID "LCC" -# define COMPILER_VERSION_MAJOR DEC(__LCC__ / 100) -# define COMPILER_VERSION_MINOR DEC(__LCC__ % 100) -# if defined(__LCC_MINOR__) -# define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__) -# endif -# if defined(__GNUC__) && defined(__GNUC_MINOR__) -# define SIMULATE_ID "GNU" -# define SIMULATE_VERSION_MAJOR DEC(__GNUC__) -# define SIMULATE_VERSION_MINOR DEC(__GNUC_MINOR__) -# if defined(__GNUC_PATCHLEVEL__) -# define SIMULATE_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif -# endif - -#elif defined(__GNUC__) || defined(__GNUG__) -# define COMPILER_ID "GNU" -# if defined(__GNUC__) -# define COMPILER_VERSION_MAJOR DEC(__GNUC__) -# else -# define COMPILER_VERSION_MAJOR DEC(__GNUG__) -# endif -# if defined(__GNUC_MINOR__) -# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__) -# endif -# if defined(__GNUC_PATCHLEVEL__) -# define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__) -# endif - -#elif defined(_MSC_VER) -# define COMPILER_ID "MSVC" - /* _MSC_VER = VVRR */ -# define COMPILER_VERSION_MAJOR DEC(_MSC_VER / 100) -# define COMPILER_VERSION_MINOR DEC(_MSC_VER % 100) -# if defined(_MSC_FULL_VER) -# if _MSC_VER >= 1400 - /* _MSC_FULL_VER = VVRRPPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 100000) -# else - /* _MSC_FULL_VER = VVRRPPPP */ -# define COMPILER_VERSION_PATCH DEC(_MSC_FULL_VER % 10000) -# endif -# endif -# if defined(_MSC_BUILD) -# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) -# endif - -#elif defined(_ADI_COMPILER) -# define COMPILER_ID "ADSP" -#if defined(__VERSIONNUM__) - /* __VERSIONNUM__ = 0xVVRRPPTT */ -# define COMPILER_VERSION_MAJOR DEC(__VERSIONNUM__ >> 24 & 0xFF) -# define COMPILER_VERSION_MINOR DEC(__VERSIONNUM__ >> 16 & 0xFF) -# define COMPILER_VERSION_PATCH DEC(__VERSIONNUM__ >> 8 & 0xFF) -# define COMPILER_VERSION_TWEAK DEC(__VERSIONNUM__ & 0xFF) -#endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# define COMPILER_ID "IAR" -# if defined(__VER__) && defined(__ICCARM__) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 1000000) -# define COMPILER_VERSION_MINOR DEC(((__VER__) / 1000) % 1000) -# define COMPILER_VERSION_PATCH DEC((__VER__) % 1000) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# elif defined(__VER__) && (defined(__ICCAVR__) || defined(__ICCRX__) || defined(__ICCRH850__) || defined(__ICCRL78__) || defined(__ICC430__) || defined(__ICCRISCV__) || defined(__ICCV850__) || defined(__ICC8051__) || defined(__ICCSTM8__)) -# define COMPILER_VERSION_MAJOR DEC((__VER__) / 100) -# define COMPILER_VERSION_MINOR DEC((__VER__) - (((__VER__) / 100)*100)) -# define COMPILER_VERSION_PATCH DEC(__SUBVERSION__) -# define COMPILER_VERSION_INTERNAL DEC(__IAR_SYSTEMS_ICC__) -# endif - -#elif defined(__DCC__) && defined(_DIAB_TOOL) -# define COMPILER_ID "Diab" - # define COMPILER_VERSION_MAJOR DEC(__VERSION_MAJOR_NUMBER__) - # define COMPILER_VERSION_MINOR DEC(__VERSION_MINOR_NUMBER__) - # define COMPILER_VERSION_PATCH DEC(__VERSION_ARCH_FEATURE_NUMBER__) - # define COMPILER_VERSION_TWEAK DEC(__VERSION_BUG_FIX_NUMBER__) - - - -/* These compilers are either not known or too old to define an - identification macro. Try to identify the platform and guess that - it is the native compiler. */ -#elif defined(__hpux) || defined(__hpua) -# define COMPILER_ID "HP" - -#else /* unknown compiler */ -# define COMPILER_ID "" -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]"; -#ifdef SIMULATE_ID -char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]"; -#endif - -#ifdef __QNXNTO__ -char const* qnxnto = "INFO" ":" "qnxnto[]"; -#endif - -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) -char const *info_cray = "INFO" ":" "compiler_wrapper[CrayPrgEnv]"; -#endif - -#define STRINGIFY_HELPER(X) #X -#define STRINGIFY(X) STRINGIFY_HELPER(X) - -/* Identify known platforms by name. */ -#if defined(__linux) || defined(__linux__) || defined(linux) -# define PLATFORM_ID "Linux" - -#elif defined(__MSYS__) -# define PLATFORM_ID "MSYS" - -#elif defined(__CYGWIN__) -# define PLATFORM_ID "Cygwin" - -#elif defined(__MINGW32__) -# define PLATFORM_ID "MinGW" - -#elif defined(__APPLE__) -# define PLATFORM_ID "Darwin" - -#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32) -# define PLATFORM_ID "Windows" - -#elif defined(__FreeBSD__) || defined(__FreeBSD) -# define PLATFORM_ID "FreeBSD" - -#elif defined(__NetBSD__) || defined(__NetBSD) -# define PLATFORM_ID "NetBSD" - -#elif defined(__OpenBSD__) || defined(__OPENBSD) -# define PLATFORM_ID "OpenBSD" - -#elif defined(__sun) || defined(sun) -# define PLATFORM_ID "SunOS" - -#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__) -# define PLATFORM_ID "AIX" - -#elif defined(__hpux) || defined(__hpux__) -# define PLATFORM_ID "HP-UX" - -#elif defined(__HAIKU__) -# define PLATFORM_ID "Haiku" - -#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) -# define PLATFORM_ID "BeOS" - -#elif defined(__QNX__) || defined(__QNXNTO__) -# define PLATFORM_ID "QNX" - -#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__) -# define PLATFORM_ID "Tru64" - -#elif defined(__riscos) || defined(__riscos__) -# define PLATFORM_ID "RISCos" - -#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__) -# define PLATFORM_ID "SINIX" - -#elif defined(__UNIX_SV__) -# define PLATFORM_ID "UNIX_SV" - -#elif defined(__bsdos__) -# define PLATFORM_ID "BSDOS" - -#elif defined(_MPRAS) || defined(MPRAS) -# define PLATFORM_ID "MP-RAS" - -#elif defined(__osf) || defined(__osf__) -# define PLATFORM_ID "OSF1" - -#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv) -# define PLATFORM_ID "SCO_SV" - -#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX) -# define PLATFORM_ID "ULTRIX" - -#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX) -# define PLATFORM_ID "Xenix" - -#elif defined(__WATCOMC__) -# if defined(__LINUX__) -# define PLATFORM_ID "Linux" - -# elif defined(__DOS__) -# define PLATFORM_ID "DOS" - -# elif defined(__OS2__) -# define PLATFORM_ID "OS2" - -# elif defined(__WINDOWS__) -# define PLATFORM_ID "Windows3x" - -# elif defined(__VXWORKS__) -# define PLATFORM_ID "VxWorks" - -# else /* unknown platform */ -# define PLATFORM_ID -# endif - -#elif defined(__INTEGRITY) -# if defined(INT_178B) -# define PLATFORM_ID "Integrity178" - -# else /* regular Integrity */ -# define PLATFORM_ID "Integrity" -# endif - -# elif defined(_ADI_COMPILER) -# define PLATFORM_ID "ADSP" - -#else /* unknown platform */ -# define PLATFORM_ID - -#endif - -/* For windows compilers MSVC and Intel we can determine - the architecture of the compiler being used. This is because - the compilers do not have flags that can change the architecture, - but rather depend on which compiler is being used -*/ -#if defined(_WIN32) && defined(_MSC_VER) -# if defined(_M_IA64) -# define ARCHITECTURE_ID "IA64" - -# elif defined(_M_ARM64EC) -# define ARCHITECTURE_ID "ARM64EC" - -# elif defined(_M_X64) || defined(_M_AMD64) -# define ARCHITECTURE_ID "x64" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# elif defined(_M_ARM64) -# define ARCHITECTURE_ID "ARM64" - -# elif defined(_M_ARM) -# if _M_ARM == 4 -# define ARCHITECTURE_ID "ARMV4I" -# elif _M_ARM == 5 -# define ARCHITECTURE_ID "ARMV5I" -# else -# define ARCHITECTURE_ID "ARMV" STRINGIFY(_M_ARM) -# endif - -# elif defined(_M_MIPS) -# define ARCHITECTURE_ID "MIPS" - -# elif defined(_M_SH) -# define ARCHITECTURE_ID "SHx" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__WATCOMC__) -# if defined(_M_I86) -# define ARCHITECTURE_ID "I86" - -# elif defined(_M_IX86) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__IAR_SYSTEMS_ICC__) || defined(__IAR_SYSTEMS_ICC) -# if defined(__ICCARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__ICCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__ICCRH850__) -# define ARCHITECTURE_ID "RH850" - -# elif defined(__ICCRL78__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__ICCRISCV__) -# define ARCHITECTURE_ID "RISCV" - -# elif defined(__ICCAVR__) -# define ARCHITECTURE_ID "AVR" - -# elif defined(__ICC430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__ICCV850__) -# define ARCHITECTURE_ID "V850" - -# elif defined(__ICC8051__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__ICCSTM8__) -# define ARCHITECTURE_ID "STM8" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__ghs__) -# if defined(__PPC64__) -# define ARCHITECTURE_ID "PPC64" - -# elif defined(__ppc__) -# define ARCHITECTURE_ID "PPC" - -# elif defined(__ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__x86_64__) -# define ARCHITECTURE_ID "x64" - -# elif defined(__i386__) -# define ARCHITECTURE_ID "X86" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__clang__) && defined(__ti__) -# if defined(__ARM_ARCH) -# define ARCHITECTURE_ID "ARM" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__TI_COMPILER_VERSION__) -# if defined(__TI_ARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__MSP430__) -# define ARCHITECTURE_ID "MSP430" - -# elif defined(__TMS320C28XX__) -# define ARCHITECTURE_ID "TMS320C28x" - -# elif defined(__TMS320C6X__) || defined(_TMS320C6X) -# define ARCHITECTURE_ID "TMS320C6x" - -# else /* unknown architecture */ -# define ARCHITECTURE_ID "" -# endif - -# elif defined(__ADSPSHARC__) -# define ARCHITECTURE_ID "SHARC" - -# elif defined(__ADSPBLACKFIN__) -# define ARCHITECTURE_ID "Blackfin" - -#elif defined(__TASKING__) - -# if defined(__CTC__) || defined(__CPTC__) -# define ARCHITECTURE_ID "TriCore" - -# elif defined(__CMCS__) -# define ARCHITECTURE_ID "MCS" - -# elif defined(__CARM__) || defined(__CPARM__) -# define ARCHITECTURE_ID "ARM" - -# elif defined(__CARC__) -# define ARCHITECTURE_ID "ARC" - -# elif defined(__C51__) -# define ARCHITECTURE_ID "8051" - -# elif defined(__CPCP__) -# define ARCHITECTURE_ID "PCP" - -# else -# define ARCHITECTURE_ID "" -# endif - -#elif defined(__RENESAS__) -# if defined(__CCRX__) -# define ARCHITECTURE_ID "RX" - -# elif defined(__CCRL__) -# define ARCHITECTURE_ID "RL78" - -# elif defined(__CCRH__) -# define ARCHITECTURE_ID "RH850" - -# else -# define ARCHITECTURE_ID "" -# endif - -#else -# define ARCHITECTURE_ID -#endif - -/* Convert integer to decimal digit literals. */ -#define DEC(n) \ - ('0' + (((n) / 10000000)%10)), \ - ('0' + (((n) / 1000000)%10)), \ - ('0' + (((n) / 100000)%10)), \ - ('0' + (((n) / 10000)%10)), \ - ('0' + (((n) / 1000)%10)), \ - ('0' + (((n) / 100)%10)), \ - ('0' + (((n) / 10)%10)), \ - ('0' + ((n) % 10)) - -/* Convert integer to hex digit literals. */ -#define HEX(n) \ - ('0' + ((n)>>28 & 0xF)), \ - ('0' + ((n)>>24 & 0xF)), \ - ('0' + ((n)>>20 & 0xF)), \ - ('0' + ((n)>>16 & 0xF)), \ - ('0' + ((n)>>12 & 0xF)), \ - ('0' + ((n)>>8 & 0xF)), \ - ('0' + ((n)>>4 & 0xF)), \ - ('0' + ((n) & 0xF)) - -/* Construct a string literal encoding the version number. */ -#ifdef COMPILER_VERSION -char const* info_version = "INFO" ":" "compiler_version[" COMPILER_VERSION "]"; - -/* Construct a string literal encoding the version number components. */ -#elif defined(COMPILER_VERSION_MAJOR) -char const info_version[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','[', - COMPILER_VERSION_MAJOR, -# ifdef COMPILER_VERSION_MINOR - '.', COMPILER_VERSION_MINOR, -# ifdef COMPILER_VERSION_PATCH - '.', COMPILER_VERSION_PATCH, -# ifdef COMPILER_VERSION_TWEAK - '.', COMPILER_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct a string literal encoding the internal version number. */ -#ifdef COMPILER_VERSION_INTERNAL -char const info_version_internal[] = { - 'I', 'N', 'F', 'O', ':', - 'c','o','m','p','i','l','e','r','_','v','e','r','s','i','o','n','_', - 'i','n','t','e','r','n','a','l','[', - COMPILER_VERSION_INTERNAL,']','\0'}; -#elif defined(COMPILER_VERSION_INTERNAL_STR) -char const* info_version_internal = "INFO" ":" "compiler_version_internal[" COMPILER_VERSION_INTERNAL_STR "]"; -#endif - -/* Construct a string literal encoding the version number components. */ -#ifdef SIMULATE_VERSION_MAJOR -char const info_simulate_version[] = { - 'I', 'N', 'F', 'O', ':', - 's','i','m','u','l','a','t','e','_','v','e','r','s','i','o','n','[', - SIMULATE_VERSION_MAJOR, -# ifdef SIMULATE_VERSION_MINOR - '.', SIMULATE_VERSION_MINOR, -# ifdef SIMULATE_VERSION_PATCH - '.', SIMULATE_VERSION_PATCH, -# ifdef SIMULATE_VERSION_TWEAK - '.', SIMULATE_VERSION_TWEAK, -# endif -# endif -# endif - ']','\0'}; -#endif - -/* Construct the string literal in pieces to prevent the source from - getting matched. Store it in a pointer rather than an array - because some compilers will just produce instructions to fill the - array rather than assigning a pointer to a static array. */ -char const* info_platform = "INFO" ":" "platform[" PLATFORM_ID "]"; -char const* info_arch = "INFO" ":" "arch[" ARCHITECTURE_ID "]"; - - - -#define CXX_STD_98 199711L -#define CXX_STD_11 201103L -#define CXX_STD_14 201402L -#define CXX_STD_17 201703L -#define CXX_STD_20 202002L -#define CXX_STD_23 202302L - -#if defined(__INTEL_COMPILER) && defined(_MSVC_LANG) -# if _MSVC_LANG > CXX_STD_17 -# define CXX_STD _MSVC_LANG -# elif _MSVC_LANG == CXX_STD_17 && defined(__cpp_aggregate_paren_init) -# define CXX_STD CXX_STD_20 -# elif _MSVC_LANG > CXX_STD_14 && __cplusplus > CXX_STD_17 -# define CXX_STD CXX_STD_20 -# elif _MSVC_LANG > CXX_STD_14 -# define CXX_STD CXX_STD_17 -# elif defined(__INTEL_CXX11_MODE__) && defined(__cpp_aggregate_nsdmi) -# define CXX_STD CXX_STD_14 -# elif defined(__INTEL_CXX11_MODE__) -# define CXX_STD CXX_STD_11 -# else -# define CXX_STD CXX_STD_98 -# endif -#elif defined(_MSC_VER) && defined(_MSVC_LANG) -# if _MSVC_LANG > __cplusplus -# define CXX_STD _MSVC_LANG -# else -# define CXX_STD __cplusplus -# endif -#elif defined(__NVCOMPILER) -# if __cplusplus == CXX_STD_17 && defined(__cpp_aggregate_paren_init) -# define CXX_STD CXX_STD_20 -# else -# define CXX_STD __cplusplus -# endif -#elif defined(__INTEL_COMPILER) || defined(__PGI) -# if __cplusplus == CXX_STD_11 && defined(__cpp_namespace_attributes) -# define CXX_STD CXX_STD_17 -# elif __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) -# define CXX_STD CXX_STD_14 -# else -# define CXX_STD __cplusplus -# endif -#elif (defined(__IBMCPP__) || defined(__ibmxl__)) && defined(__linux__) -# if __cplusplus == CXX_STD_11 && defined(__cpp_aggregate_nsdmi) -# define CXX_STD CXX_STD_14 -# else -# define CXX_STD __cplusplus -# endif -#elif __cplusplus == 1 && defined(__GXX_EXPERIMENTAL_CXX0X__) -# define CXX_STD CXX_STD_11 -#else -# define CXX_STD __cplusplus -#endif - -const char* info_language_standard_default = "INFO" ":" "standard_default[" -#if CXX_STD > CXX_STD_23 - "26" -#elif CXX_STD > CXX_STD_20 - "23" -#elif CXX_STD > CXX_STD_17 - "20" -#elif CXX_STD > CXX_STD_14 - "17" -#elif CXX_STD > CXX_STD_11 - "14" -#elif CXX_STD >= CXX_STD_11 - "11" -#else - "98" -#endif -"]"; - -const char* info_language_extensions_default = "INFO" ":" "extensions_default[" -#if (defined(__clang__) || defined(__GNUC__) || defined(__xlC__) || \ - defined(__TI_COMPILER_VERSION__) || defined(__RENESAS__)) && \ - !defined(__STRICT_ANSI__) - "ON" -#else - "OFF" -#endif -"]"; - -/*--------------------------------------------------------------------------*/ - -int main(int argc, char* argv[]) -{ - int require = 0; - require += info_compiler[argc]; - require += info_platform[argc]; - require += info_arch[argc]; -#ifdef COMPILER_VERSION_MAJOR - require += info_version[argc]; -#endif -#if defined(COMPILER_VERSION_INTERNAL) || defined(COMPILER_VERSION_INTERNAL_STR) - require += info_version_internal[argc]; -#endif -#ifdef SIMULATE_ID - require += info_simulate[argc]; -#endif -#ifdef SIMULATE_VERSION_MAJOR - require += info_simulate_version[argc]; -#endif -#if defined(__CRAYXT_COMPUTE_LINUX_TARGET) - require += info_cray[argc]; -#endif - require += info_language_standard_default[argc]; - require += info_language_extensions_default[argc]; - (void)argv; - return require; -} diff --git a/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out b/newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out deleted file mode 100755 index b9b2fb453a9e4bec85a4815557e6889af6d718c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33736 zcmeI5Uu@G=6vt1yPFMM}`X>tFLV0izA)|#UL{02;6Bg$-VbQt;uRqq`Mnl)mt`#;> zIt)0)=s-=T(S&F+G=T>Vnv96q3xpRi>;Z@-I${(^MB{@oi?IJ(Vh!(Q0V^ylPZf!$*!}=ES7K+|n z=(@_1JVU%tskVl2TVYu54;A{z*yZdN<&v~0m9n>`jKM>3z7bw1`A(Q6V#~R5;-O4# z&J(3N`%=khyxTa7^S!_imwZVR7du}Ha&v(5CE|TE1s3O%fNyMH_luF09M&l6` zjdvw@VR1g+O-_AblSJ&|n)36@dl=Dq>g(F-@**K~33${}G?uYbRKF`8m5Nv?izh~u zDxL4X?1GT9KWi3`Gxw~ivH8h{`o`=X$rRPaw#W%7hDGYh)+BZ5GIft_5Vb0~3NSEgU1)6z+xnm(7MYF$yGS3&er*k=rPiJDo?_9t9HJF0{2!H?xfB*=900@8p z2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?x zfB*=900@8p2!H?xfB*=900>;0fb(~pJ{r(}hwh_cGk#>oul0EC{fK}72!H?xfB*=9 z00@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*=900@8p z2!H?xfB*=900@8p2!H?xfB*=900@8p2!H?xfB*>mKLq@orq!rq%x}}3-&S0DiDyO6 zL)>gWl=T$uBbTBb5|YNz9vaTL_%owF_v_CQ{v`L+J*;VAamQ;~?4co9?UBCNG%wrR znr@dy+G(rXR&;N+kv2V5Mk8MCHLrR$D|?&WnNHbivu#D}BzdFpu7siuJytYM15Vwt zR^)Zo`P{sEg8$!voL|bWbm`9K+P+h4j`>1Pe2KB;{IWh^Y`?MB8+(DVlg6$v_Mq6j zQF?02em|)a6)Rn_KDIN>o!v2W07`HyT5%OsC!XV`G!>=Vn}RF#Q%&b^t}S1#{5W@< zE8fRGDO= diff --git a/newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml b/newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml deleted file mode 100644 index 2c2c118c9..000000000 --- a/newlinalg/build/CMakeFiles/CMakeConfigureLog.yaml +++ /dev/null @@ -1,2177 +0,0 @@ - ---- -events: - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineSystem.cmake:12 (find_program)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_UNAME" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "uname" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/uname" - - "/Users/timatherton/miniconda3/condabin/uname" - - "/opt/homebrew/bin/uname" - - "/opt/homebrew/sbin/uname" - - "/usr/local/bin/uname" - - "/System/Cryptexes/App/usr/bin/uname" - found: "/usr/bin/uname" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineSystem.cmake:212 (message)" - - "CMakeLists.txt:3 (project)" - message: | - The system is: Darwin - 24.3.0 - arm64 - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeUnixFindMake.cmake:5 (find_program)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_MAKE_PROGRAM" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "gmake" - - "make" - - "smake" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/gmake" - - "/Users/timatherton/miniconda3/condabin/gmake" - - "/opt/homebrew/bin/gmake" - - "/opt/homebrew/sbin/gmake" - - "/usr/local/bin/gmake" - - "/System/Cryptexes/App/usr/bin/gmake" - - "/usr/bin/gmake" - - "/bin/gmake" - - "/usr/sbin/gmake" - - "/sbin/gmake" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/gmake" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/gmake" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/gmake" - - "/Library/Apple/usr/bin/gmake" - - "/Library/TeX/texbin/gmake" - - "/Users/timatherton/miniconda3/bin/make" - - "/Users/timatherton/miniconda3/condabin/make" - - "/opt/homebrew/bin/make" - - "/opt/homebrew/sbin/make" - - "/usr/local/bin/make" - - "/System/Cryptexes/App/usr/bin/make" - found: "/usr/bin/make" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompiler.cmake:73 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:64 (_cmake_find_compiler)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_C_COMPILER" - description: "C compiler" - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "cc" - - "gcc" - - "cl" - - "bcc" - - "xlc" - - "icx" - - "clang" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/cc" - - "/Users/timatherton/miniconda3/condabin/cc" - - "/opt/homebrew/bin/cc" - - "/opt/homebrew/sbin/cc" - - "/usr/local/bin/cc" - - "/System/Cryptexes/App/usr/bin/cc" - found: "/usr/bin/cc" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:462 (find_file)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:500 (CMAKE_DETERMINE_COMPILER_ID_WRITE)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:122 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:3 (project)" - mode: "file" - variable: "src_in" - description: "Path to a file." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "CMakeCCompilerId.c.in" - candidate_directories: - - "/opt/homebrew/share/cmake/Modules/" - found: "/opt/homebrew/share/cmake/Modules/CMakeCCompilerId.c.in" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:122 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:3 (project)" - message: | - Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. - Compiler: /usr/bin/cc - Build flags: - Id flags: - - The output was: - 0 - - - Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out" - - The C compiler identification is AppleClang, found in: - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/4.1.0/CompilerIdC/a.out - - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:290 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:122 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:3 (project)" - message: | - Detecting C compiler apple sysroot: "/usr/bin/cc" "-E" "apple-sdk.c" - # 1 "apple-sdk.c" - # 1 "" 1 - # 1 "" 3 - # 465 "" 3 - # 1 "" 1 - # 1 "" 2 - # 1 "apple-sdk.c" 2 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 1 3 4 - # 89 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 - # 90 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h" 1 3 4 - # 91 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 - # 207 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 1 3 4 - # 196 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 - # 197 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 - # 33 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 - # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 2 3 4 - # 198 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 1 3 4 - # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 - # 35 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 2 3 4 - # 199 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 - # 208 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 - # 2 "apple-sdk.c" 2 - - - Found apple sysroot: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_AR" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "ar" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/usr/bin/ar" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_RANLIB" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "ranlib" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/usr/bin/ranlib" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_STRIP" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "strip" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/usr/bin/strip" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_LINKER" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "ld" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/usr/bin/ld" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_NM" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "nm" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/usr/bin/nm" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_OBJDUMP" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "objdump" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/usr/bin/objdump" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_OBJCOPY" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "objcopy" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/usr/bin/objcopy" - - "/Users/timatherton/miniconda3/bin/objcopy" - - "/Users/timatherton/miniconda3/condabin/objcopy" - - "/opt/homebrew/bin/objcopy" - - "/opt/homebrew/sbin/objcopy" - - "/usr/local/bin/objcopy" - - "/System/Cryptexes/App/usr/bin/objcopy" - - "/bin/objcopy" - - "/usr/sbin/objcopy" - - "/sbin/objcopy" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/objcopy" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/objcopy" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/objcopy" - - "/Library/Apple/usr/bin/objcopy" - - "/Library/TeX/texbin/objcopy" - found: false - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_READELF" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "readelf" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/usr/bin/readelf" - - "/Users/timatherton/miniconda3/bin/readelf" - - "/Users/timatherton/miniconda3/condabin/readelf" - - "/opt/homebrew/bin/readelf" - - "/opt/homebrew/sbin/readelf" - - "/usr/local/bin/readelf" - - "/System/Cryptexes/App/usr/bin/readelf" - - "/bin/readelf" - - "/usr/sbin/readelf" - - "/sbin/readelf" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/readelf" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/readelf" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/readelf" - - "/Library/Apple/usr/bin/readelf" - - "/Library/TeX/texbin/readelf" - found: false - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_DLLTOOL" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "dlltool" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/usr/bin/dlltool" - - "/Users/timatherton/miniconda3/bin/dlltool" - - "/Users/timatherton/miniconda3/condabin/dlltool" - - "/opt/homebrew/bin/dlltool" - - "/opt/homebrew/sbin/dlltool" - - "/usr/local/bin/dlltool" - - "/System/Cryptexes/App/usr/bin/dlltool" - - "/bin/dlltool" - - "/usr/sbin/dlltool" - - "/sbin/dlltool" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/dlltool" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/dlltool" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/dlltool" - - "/Library/Apple/usr/bin/dlltool" - - "/Library/TeX/texbin/dlltool" - found: false - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_ADDR2LINE" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "addr2line" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/usr/bin/addr2line" - - "/Users/timatherton/miniconda3/bin/addr2line" - - "/Users/timatherton/miniconda3/condabin/addr2line" - - "/opt/homebrew/bin/addr2line" - - "/opt/homebrew/sbin/addr2line" - - "/usr/local/bin/addr2line" - - "/System/Cryptexes/App/usr/bin/addr2line" - - "/bin/addr2line" - - "/usr/sbin/addr2line" - - "/sbin/addr2line" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/addr2line" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/addr2line" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/addr2line" - - "/Library/Apple/usr/bin/addr2line" - - "/Library/TeX/texbin/addr2line" - found: false - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeFindBinUtils.cmake:238 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCCompiler.cmake:200 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_TAPI" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: false - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: false - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "tapi" - candidate_directories: - - "/usr/bin/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/usr/bin/tapi" - - "/Users/timatherton/miniconda3/bin/tapi" - - "/Users/timatherton/miniconda3/condabin/tapi" - - "/opt/homebrew/bin/tapi" - - "/opt/homebrew/sbin/tapi" - - "/usr/local/bin/tapi" - - "/System/Cryptexes/App/usr/bin/tapi" - - "/bin/tapi" - - "/usr/sbin/tapi" - - "/sbin/tapi" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/tapi" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/tapi" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/tapi" - - "/Library/Apple/usr/bin/tapi" - - "/Library/TeX/texbin/tapi" - found: false - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompiler.cmake:54 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:69 (_cmake_find_compiler)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_CXX_COMPILER" - description: "CXX compiler" - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "c++" - - "g++" - - "cl" - - "bcc" - - "icpx" - - "icx" - - "clang++" - candidate_directories: - - "/usr/bin/" - found: "/usr/bin/c++" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:462 (find_file)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:500 (CMAKE_DETERMINE_COMPILER_ID_WRITE)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:8 (CMAKE_DETERMINE_COMPILER_ID_BUILD)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:125 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:3 (project)" - mode: "file" - variable: "src_in" - description: "Path to a file." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "CMakeCXXCompilerId.cpp.in" - candidate_directories: - - "/opt/homebrew/share/cmake/Modules/" - found: "/opt/homebrew/share/cmake/Modules/CMakeCXXCompilerId.cpp.in" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:17 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:64 (__determine_compiler_id_test)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:125 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:3 (project)" - message: | - Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. - Compiler: /usr/bin/c++ - Build flags: - Id flags: - - The output was: - 0 - - - Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "a.out" - - The CXX compiler identification is AppleClang, found in: - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/4.1.0/CompilerIdCXX/a.out - - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerId.cmake:290 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCXXCompiler.cmake:125 (CMAKE_DETERMINE_COMPILER_ID)" - - "CMakeLists.txt:3 (project)" - message: | - Detecting CXX compiler apple sysroot: "/usr/bin/c++" "-E" "apple-sdk.cpp" - # 1 "apple-sdk.cpp" - # 1 "" 1 - # 1 "" 3 - # 513 "" 3 - # 1 "" 1 - # 1 "" 2 - # 1 "apple-sdk.cpp" 2 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 1 3 4 - # 89 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 - # 90 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h" 1 3 4 - # 91 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 - # 207 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 1 3 4 - # 196 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 - # 197 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 - # 33 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h" 1 3 4 - # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 2 3 4 - # 198 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 1 3 4 - # 34 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 3 4 - # 1 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h" 1 3 4 - # 35 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h" 2 3 4 - # 199 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h" 2 3 4 - # 208 "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h" 2 3 4 - # 2 "apple-sdk.cpp" 2 - - - Found apple sysroot: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk - - - kind: "find-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/Platform/Darwin.cmake:76 (find_program)" - - "/opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:32 (include)" - - "CMakeLists.txt:3 (project)" - mode: "program" - variable: "CMAKE_INSTALL_NAME_TOOL" - description: "Path to a program." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "install_name_tool" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/install_name_tool" - - "/Users/timatherton/miniconda3/condabin/install_name_tool" - - "/opt/homebrew/bin/install_name_tool" - - "/opt/homebrew/sbin/install_name_tool" - - "/usr/local/bin/install_name_tool" - - "/System/Cryptexes/App/usr/bin/install_name_tool" - found: "/usr/bin/install_name_tool" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - CMAKE_INSTALL_PREFIX: "/usr/local" - - - kind: "try_compile-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:83 (try_compile)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - checks: - - "Detecting C compiler ABI info" - directories: - source: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx" - binary: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx" - cmakeVariables: - CMAKE_C_FLAGS: "" - CMAKE_C_FLAGS_DEBUG: "-g" - CMAKE_EXE_LINKER_FLAGS: "" - CMAKE_OSX_ARCHITECTURES: "" - CMAKE_OSX_DEPLOYMENT_TARGET: "" - CMAKE_OSX_SYSROOT: "" - buildResult: - variable: "CMAKE_C_ABI_COMPILED" - cached: true - stdout: | - Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx' - - Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_b1e75/fast - /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b1e75.dir/build.make CMakeFiles/cmTC_b1e75.dir/build - Building C object CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o - /usr/bin/cc -arch arm64 -v -Wl,-v -MD -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c - Apple clang version 17.0.0 (clang-1700.0.13.5) - Target: arm64-apple-darwin24.3.0 - Thread model: posix - InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - clang: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c - clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0 - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks" - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - #include "..." search starts here: - #include <...> search starts here: - /usr/local/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) - End of search list. - Linking C executable cmTC_b1e75 - /opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b1e75.dir/link.txt --verbose=1 - Apple clang version 17.0.0 (clang-1700.0.13.5) - Target: arm64-apple-darwin24.3.0 - Thread model: posix - InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_b1e75 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a - @(#)PROGRAM:ld PROJECT:ld-1167.5 - BUILD 01:45:05 Apr 30 2025 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) - Library search paths: - /usr/local/lib - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift - Framework search paths: - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks - /usr/bin/cc -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -o cmTC_b1e75 - - exitCode: 0 - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:122 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Effective list of requested architectures (possibly empty) : "" - Effective list of architectures found in the ABI info binary: "arm64" - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:217 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Parsed C implicit include dir info: rv=done - found start of include info - found start of implicit include info - add: [/usr/local/include] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] - add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - end of search list found - collapse include dir [/usr/local/include] ==> [/usr/local/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - implicit include dirs: [/usr/local/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - - - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:253 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Parsed C implicit link information: - link line regex: [^( *|.*[/\\])(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] - linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)))("|,| |$)] - ignore line: [Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx'] - ignore line: [] - ignore line: [Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_b1e75/fast] - ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_b1e75.dir/build.make CMakeFiles/cmTC_b1e75.dir/build] - ignore line: [Building C object CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o] - ignore line: [/usr/bin/cc -arch arm64 -v -Wl -v -MD -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] - ignore line: [Target: arm64-apple-darwin24.3.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - ignore line: [clang: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] - ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCCompilerABI.c -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-2SWJyx -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -x c /opt/homebrew/share/cmake/Modules/CMakeCCompilerABI.c] - ignore line: [clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /usr/local/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)] - ignore line: [End of search list.] - ignore line: [Linking C executable cmTC_b1e75] - ignore line: [/opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_b1e75.dir/link.txt --verbose=1] - ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] - ignore line: [Target: arm64-apple-darwin24.3.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_b1e75 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [arm64] ==> ignore - arg [-platform_version] ==> ignore - arg [macos] ==> ignore - arg [15.0.0] ==> ignore - arg [15.5] ==> ignore - arg [-syslibroot] ==> ignore - arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk] ==> ignore - arg [-mllvm] ==> ignore - arg [-enable-linkonceodr-outlining] ==> ignore - arg [-o] ==> ignore - arg [cmTC_b1e75] ==> ignore - arg [-L/usr/local/lib] ==> dir [/usr/local/lib] - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_b1e75.dir/CMakeCCompilerABI.c.o] ==> ignore - arg [-lSystem] ==> lib [System] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] - linker tool for 'C': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld - Library search paths: [;/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] - Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] - remove lib [System] - remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] - collapse library dir [/usr/local/lib] ==> [/usr/local/lib] - collapse library dir [/usr/local/lib] ==> [/usr/local/lib] - collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] - collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] - collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] - implicit libs: [] - implicit objs: [] - implicit dirs: [/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] - implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] - - - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:36 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:299 (cmake_determine_linker_id)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Running the C compiler's linker: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-v" - @(#)PROGRAM:ld PROJECT:ld-1167.5 - BUILD 01:45:05 Apr 30 2025 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) - - - kind: "try_compile-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:83 (try_compile)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - checks: - - "Detecting CXX compiler ABI info" - directories: - source: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i" - binary: "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i" - cmakeVariables: - CMAKE_CXX_FLAGS: "" - CMAKE_CXX_FLAGS_DEBUG: "-g" - CMAKE_CXX_SCAN_FOR_MODULES: "OFF" - CMAKE_EXE_LINKER_FLAGS: "" - CMAKE_OSX_ARCHITECTURES: "" - CMAKE_OSX_DEPLOYMENT_TARGET: "" - CMAKE_OSX_SYSROOT: "" - buildResult: - variable: "CMAKE_CXX_ABI_COMPILED" - cached: true - stdout: | - Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i' - - Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_22496/fast - /Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_22496.dir/build.make CMakeFiles/cmTC_22496.dir/build - Building CXX object CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o - /usr/bin/c++ -arch arm64 -v -Wl,-v -MD -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp - Apple clang version 17.0.0 (clang-1700.0.13.5) - Target: arm64-apple-darwin24.3.0 - Thread model: posix - InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - clang++: warning: -Wl,-v: 'linker' input unused [-Wunused-command-line-argument] - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1" - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp - clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0 - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include" - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks" - ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - #include "..." search starts here: - #include <...> search starts here: - /usr/local/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory) - End of search list. - Linking CXX executable cmTC_22496 - /opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_22496.dir/link.txt --verbose=1 - Apple clang version 17.0.0 (clang-1700.0.13.5) - Target: arm64-apple-darwin24.3.0 - Thread model: posix - InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin - "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_22496 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a - @(#)PROGRAM:ld PROJECT:ld-1167.5 - BUILD 01:45:05 Apr 30 2025 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) - Library search paths: - /usr/local/lib - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift - Framework search paths: - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks - /usr/bin/c++ -arch arm64 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -v -Wl,-v CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -o cmTC_22496 - - exitCode: 0 - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:122 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Effective list of requested architectures (possibly empty) : "" - Effective list of architectures found in the ABI info binary: "arm64" - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:217 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Parsed CXX implicit include dir info: rv=done - found start of include info - found start of implicit include info - add: [/usr/local/include] - add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] - add: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] - add: [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - end of search list found - collapse include dir [/usr/local/include] ==> [/usr/local/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] - collapse include dir [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] ==> [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - implicit include dirs: [/usr/local/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include;/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - - - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:253 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Parsed CXX implicit link information: - link line regex: [^( *|.*[/\\])(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\\]+-)?ld|collect2)[^/\\]*( |$)] - linker tool regex: [^[ ]*(->|")?[ ]*(([^"]*[/\\])?(ld[0-9]*(|\\.[a-rt-z][a-z]*|\\.s[a-np-z][a-z]*|\\.so[a-z]+)))("|,| |$)] - ignore line: [Change Dir: '/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i'] - ignore line: [] - ignore line: [Run Build Command(s): /opt/homebrew/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_22496/fast] - ignore line: [/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_22496.dir/build.make CMakeFiles/cmTC_22496.dir/build] - ignore line: [Building CXX object CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o] - ignore line: [/usr/bin/c++ -arch arm64 -v -Wl -v -MD -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -MF CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -c /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] - ignore line: [Target: arm64-apple-darwin24.3.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - ignore line: [clang++: warning: -Wl -v: 'linker' input unused [-Wunused-command-line-argument]] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1"] - ignore line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple arm64-apple-macosx15.0.0 -Wundef-prefix=TARGET_OS_ -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name CMakeCXXCompilerABI.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=non-leaf -fno-strict-return -ffp-contract=on -fno-rounding-math -funwind-tables=1 -fobjc-msgsend-selector-stubs -target-sdk-version=15.5 -fvisibility-inlines-hidden-static-local-var -fdefine-target-os-macros -fno-assume-unique-vtables -fno-modulemap-allow-subdirectory-search -target-cpu apple-m1 -target-feature +zcm -target-feature +zcz -target-feature +v8.5a -target-feature +aes -target-feature +altnzcv -target-feature +ccdp -target-feature +complxnum -target-feature +crc -target-feature +dotprod -target-feature +fp-armv8 -target-feature +fp16fml -target-feature +fptoint -target-feature +fullfp16 -target-feature +jsconv -target-feature +lse -target-feature +neon -target-feature +pauth -target-feature +perfmon -target-feature +predres -target-feature +ras -target-feature +rcpc -target-feature +rdm -target-feature +sb -target-feature +sha2 -target-feature +sha3 -target-feature +specrestrict -target-feature +ssbs -target-abi darwinpcs -debugger-tuning=lldb -fdebug-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -target-linker-version 1167.5 -v -fcoverage-compilation-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/CMakeScratch/TryCompile-KASR0i -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17 -dependency-file CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o.d -skip-unused-modulemap-deps -MT CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -sys-header-deps -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1 -internal-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include -internal-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -internal-externc-isystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-final-dtor-non-final-class -Wno-extra-semi-stmt -Wno-misleading-indentation -Wno-quoted-include-in-framework-header -Wno-implicit-fallthrough -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-elaborated-enum-base -Wno-reserved-identifier -Wno-gnu-folding-constant -fdeprecated-macro -ferror-limit 19 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fgnuc-version=4.2.1 -fno-cxx-modules -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fmax-type-align=16 -fcommon -clang-vendor-feature=+disableNonDependentMemberExprInCurrentInstantiation -fno-odr-hash-protocols -clang-vendor-feature=+enableAggressiveVLAFolding -clang-vendor-feature=+revert09abecef7bbf -clang-vendor-feature=+thisNoAlignAttr -clang-vendor-feature=+thisNoNullAttr -clang-vendor-feature=+disableAtImportPrivateFrameworkInImplementationError -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -x c++ /opt/homebrew/share/cmake/Modules/CMakeCXXCompilerABI.cpp] - ignore line: [clang -cc1 version 17.0.0 (clang-1700.0.13.5) default target arm64-apple-darwin24.3.0] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks"] - ignore line: [ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"] - ignore line: [#include "..." search starts here:] - ignore line: [#include <...> search starts here:] - ignore line: [ /usr/local/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include] - ignore line: [ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)] - ignore line: [End of search list.] - ignore line: [Linking CXX executable cmTC_22496] - ignore line: [/opt/homebrew/bin/cmake -E cmake_link_script CMakeFiles/cmTC_22496.dir/link.txt --verbose=1] - ignore line: [Apple clang version 17.0.0 (clang-1700.0.13.5)] - ignore line: [Target: arm64-apple-darwin24.3.0] - ignore line: [Thread model: posix] - ignore line: [InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin] - link line: [ "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 15.0.0 15.5 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mllvm -enable-linkonceodr-outlining -o cmTC_22496 -L/usr/local/lib -search_paths_first -headerpad_max_install_names -v CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld] ==> ignore - arg [-demangle] ==> ignore - arg [-lto_library] ==> ignore, skip following value - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib] ==> skip value of -lto_library - arg [-dynamic] ==> ignore - arg [-arch] ==> ignore - arg [arm64] ==> ignore - arg [-platform_version] ==> ignore - arg [macos] ==> ignore - arg [15.0.0] ==> ignore - arg [15.5] ==> ignore - arg [-syslibroot] ==> ignore - arg [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk] ==> ignore - arg [-mllvm] ==> ignore - arg [-enable-linkonceodr-outlining] ==> ignore - arg [-o] ==> ignore - arg [cmTC_22496] ==> ignore - arg [-L/usr/local/lib] ==> dir [/usr/local/lib] - arg [-search_paths_first] ==> ignore - arg [-headerpad_max_install_names] ==> ignore - arg [-v] ==> ignore - arg [CMakeFiles/cmTC_22496.dir/CMakeCXXCompilerABI.cpp.o] ==> ignore - arg [-lc++] ==> lib [c++] - arg [-lSystem] ==> lib [System] - arg [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] ==> lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] - linker tool for 'CXX': /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld - Library search paths: [;/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] - Framework search paths: [;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] - remove lib [System] - remove lib [/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/lib/darwin/libclang_rt.osx.a] - collapse library dir [/usr/local/lib] ==> [/usr/local/lib] - collapse library dir [/usr/local/lib] ==> [/usr/local/lib] - collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib] - collapse library dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] - collapse framework dir [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] ==> [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] - implicit libs: [c++] - implicit objs: [] - implicit dirs: [/usr/local/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/swift] - implicit fwks: [/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks] - - - - - kind: "message-v1" - backtrace: - - "/opt/homebrew/share/cmake/Modules/Internal/CMakeDetermineLinkerId.cmake:36 (message)" - - "/opt/homebrew/share/cmake/Modules/CMakeDetermineCompilerABI.cmake:299 (cmake_determine_linker_id)" - - "/opt/homebrew/share/cmake/Modules/CMakeTestCXXCompiler.cmake:26 (CMAKE_DETERMINE_COMPILER_ABI)" - - "CMakeLists.txt:3 (project)" - message: | - Running the CXX compiler's linker: "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-v" - @(#)PROGRAM:ld PROJECT:ld-1167.5 - BUILD 01:45:05 Apr 30 2025 - configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em - will use ld-classic for: armv6 armv7 armv7s i386 armv6m armv7k armv7m armv7em - LTO support using: LLVM version 17.0.0 (static support for 29, runtime is 29) - TAPI support using: Apple TAPI version 17.0.0 (tapi-1700.0.3.5) - - - kind: "find-v1" - backtrace: - - "CMakeLists.txt:19 (find_file)" - mode: "file" - variable: "MORPHO_HEADER" - description: "Path to a file." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "morpho.h" - candidate_directories: - - "/usr/local/opt/morpho/" - - "/opt/homebrew/opt/morpho/" - - "/usr/local/include/morpho/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/include/" - - "/opt/homebrew/" - - "/usr/local/include/" - - "/usr/local/" - - "/usr/include/" - - "/usr/" - - "/include/" - - "/usr/X11R6/include/" - - "/usr/X11R6/" - - "/usr/pkg/include/" - - "/usr/pkg/" - - "/opt/include/" - - "/opt/" - - "/sw/include/" - - "/sw/" - - "/opt/local/include/" - - "/opt/local/" - - "/usr/include/X11/" - - "/Users/timatherton/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/Network/Library/Frameworks/" - - "/System/Library/Frameworks/" - searched_directories: - - "/usr/local/opt/morpho/morpho.h" - - "/opt/homebrew/opt/morpho/morpho.h" - found: "/usr/local/include/morpho/morpho.h" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - CMAKE_INSTALL_PREFIX: "/usr/local" - CMAKE_SYSTEM_PREFIX_PATH: - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" - - "/opt/homebrew" - - "/usr/local" - - "/usr" - - "/" - - "/opt/homebrew" - - "/usr/local" - - "/usr/X11R6" - - "/usr/pkg" - - "/opt" - - "/sw" - - "/opt/local" - CMAKE_SYSTEM_INCLUDE_PATH: - - "/usr/include/X11" - CMAKE_SYSTEM_FRAMEWORK_PATH: - - "~/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" - - "/Library/Frameworks" - - "/Network/Library/Frameworks" - - "/System/Library/Frameworks" - - - kind: "find-v1" - backtrace: - - "CMakeLists.txt:47 (find_library)" - mode: "library" - variable: "MORPHO_LIBRARY" - description: "Path to a library." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "morpho" - - "libmorpho" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/lib/" - - "/opt/homebrew/" - - "/usr/local/lib/" - - "/usr/local/" - - "/usr/lib/" - - "/usr/" - - "/opt/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/System/Library/Frameworks/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/lib/" - - "/opt/homebrew/" - found: "/usr/local/lib/libmorpho.dylib" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - CMAKE_INSTALL_PREFIX: "/usr/local" - CMAKE_SYSTEM_PREFIX_PATH: - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" - - "/opt/homebrew" - - "/usr/local" - - "/usr" - - "/" - - "/opt/homebrew" - - "/usr/local" - - "/usr/X11R6" - - "/usr/pkg" - - "/opt" - - "/sw" - - "/opt/local" - CMAKE_SYSTEM_LIBRARY_PATH: - - "/usr/lib/X11" - CMAKE_SYSTEM_FRAMEWORK_PATH: - - "~/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" - - "/Library/Frameworks" - - "/Network/Library/Frameworks" - - "/System/Library/Frameworks" - - - kind: "find-v1" - backtrace: - - "CMakeLists.txt:61 (find_library)" - mode: "library" - variable: "LAPACK_LIBRARY" - description: "Path to a library." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "lapacke" - - "liblapacke" - - "lapack" - - "liblapack" - - "libopenblas" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/lib/" - - "/opt/homebrew/" - - "/usr/local/lib/" - - "/usr/local/" - - "/usr/lib/" - - "/usr/" - - "/opt/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/System/Library/Frameworks/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/lib/" - - "/opt/homebrew/" - - "/usr/local/lib/" - - "/usr/local/" - - "/usr/lib/" - - "/usr/" - - "/opt/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/System/Library/Frameworks/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/lib/" - - "/opt/homebrew/" - - "/usr/local/lib/" - - "/usr/local/" - - "/usr/lib/" - - "/usr/" - - "/opt/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/System/Library/Frameworks/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - CMAKE_INSTALL_PREFIX: "/usr/local" - CMAKE_SYSTEM_PREFIX_PATH: - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" - - "/opt/homebrew" - - "/usr/local" - - "/usr" - - "/" - - "/opt/homebrew" - - "/usr/local" - - "/usr/X11R6" - - "/usr/pkg" - - "/opt" - - "/sw" - - "/opt/local" - CMAKE_SYSTEM_LIBRARY_PATH: - - "/usr/lib/X11" - CMAKE_SYSTEM_FRAMEWORK_PATH: - - "~/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" - - "/Library/Frameworks" - - "/Network/Library/Frameworks" - - "/System/Library/Frameworks" - - - kind: "find-v1" - backtrace: - - "CMakeLists.txt:71 (find_library)" - mode: "library" - variable: "CBLAS_LIBRARY" - description: "Path to a library." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "cblas" - - "libcblas" - - "blas" - - "libblas" - - "openblas" - - "libopenblas" - candidate_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/lib/" - - "/opt/homebrew/" - - "/usr/local/lib/" - - "/usr/local/" - - "/usr/lib/" - - "/usr/" - - "/opt/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/System/Library/Frameworks/" - searched_directories: - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - found: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - CMAKE_INSTALL_PREFIX: "/usr/local" - CMAKE_SYSTEM_PREFIX_PATH: - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" - - "/opt/homebrew" - - "/usr/local" - - "/usr" - - "/" - - "/opt/homebrew" - - "/usr/local" - - "/usr/X11R6" - - "/usr/pkg" - - "/opt" - - "/sw" - - "/opt/local" - CMAKE_SYSTEM_LIBRARY_PATH: - - "/usr/lib/X11" - CMAKE_SYSTEM_FRAMEWORK_PATH: - - "~/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" - - "/Library/Frameworks" - - "/Network/Library/Frameworks" - - "/System/Library/Frameworks" - - - kind: "find-v1" - backtrace: - - "CMakeLists.txt:81 (find_path)" - mode: "path" - variable: "CBLAS_INCLUDE" - description: "Path to a file." - settings: - SearchFramework: "FIRST" - SearchAppBundle: "FIRST" - CMAKE_FIND_USE_CMAKE_PATH: true - CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH: true - CMAKE_FIND_USE_CMAKE_SYSTEM_PATH: true - CMAKE_FIND_USE_INSTALL_PREFIX: true - names: - - "cblas.h" - candidate_directories: - - "C:/Program Files/Morpho/include/lapack/" - - "/Users/timatherton/miniconda3/bin/" - - "/Users/timatherton/miniconda3/condabin/" - - "/opt/homebrew/bin/" - - "/opt/homebrew/sbin/" - - "/usr/local/bin/" - - "/System/Cryptexes/App/usr/bin/" - - "/usr/bin/" - - "/bin/" - - "/usr/sbin/" - - "/sbin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin/" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin/" - - "/Library/Apple/usr/bin/" - - "/Library/TeX/texbin/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/" - - "/opt/homebrew/include/" - - "/opt/homebrew/" - - "/usr/local/include/" - - "/usr/local/" - - "/usr/include/" - - "/usr/" - - "/include/" - - "/usr/X11R6/include/" - - "/usr/X11R6/" - - "/usr/pkg/include/" - - "/usr/pkg/" - - "/opt/include/" - - "/opt/" - - "/sw/include/" - - "/sw/" - - "/opt/local/include/" - - "/opt/local/" - - "/usr/include/X11/" - - "/Users/timatherton/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/" - - "/Library/Frameworks/" - - "/Network/Library/Frameworks/" - - "/System/Library/Frameworks/" - found: "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/" - search_context: - ENV{PATH}: - - "/Users/timatherton/miniconda3/bin" - - "/Users/timatherton/miniconda3/condabin" - - "/opt/homebrew/bin" - - "/opt/homebrew/sbin" - - "/usr/local/bin" - - "/System/Cryptexes/App/usr/bin" - - "/usr/bin" - - "/bin" - - "/usr/sbin" - - "/sbin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin" - - "/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin" - - "/Library/Apple/usr/bin" - - "/Library/TeX/texbin" - CMAKE_INSTALL_PREFIX: "/usr/local" - CMAKE_SYSTEM_PREFIX_PATH: - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr" - - "/opt/homebrew" - - "/usr/local" - - "/usr" - - "/" - - "/opt/homebrew" - - "/usr/local" - - "/usr/X11R6" - - "/usr/pkg" - - "/opt" - - "/sw" - - "/opt/local" - CMAKE_SYSTEM_INCLUDE_PATH: - - "/usr/include/X11" - CMAKE_SYSTEM_FRAMEWORK_PATH: - - "~/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks" - - "/Applications/Xcode.app/Contents/Developer/Library/Frameworks" - - "/Library/Frameworks" - - "/Network/Library/Frameworks" - - "/System/Library/Frameworks" -... diff --git a/newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake b/newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake deleted file mode 100644 index 18e20c210..000000000 --- a/newlinalg/build/CMakeFiles/CMakeDirectoryInformation.cmake +++ /dev/null @@ -1,16 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -# Relative path conversion top directories. -set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg") -set(CMAKE_RELATIVE_PATH_TOP_BINARY "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build") - -# Force unix paths in dependencies. -set(CMAKE_FORCE_UNIX_PATHS 1) - - -# The C and CXX include file regular expressions for this directory. -set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$") -set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$") -set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN}) -set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN}) diff --git a/newlinalg/build/CMakeFiles/InstallScripts.json b/newlinalg/build/CMakeFiles/InstallScripts.json deleted file mode 100644 index c0ac264c8..000000000 --- a/newlinalg/build/CMakeFiles/InstallScripts.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "InstallScripts" : - [ - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/cmake_install.cmake", - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/cmake_install.cmake" - ], - "Parallel" : false -} diff --git a/newlinalg/build/CMakeFiles/Makefile.cmake b/newlinalg/build/CMakeFiles/Makefile.cmake deleted file mode 100644 index 7db3d4466..000000000 --- a/newlinalg/build/CMakeFiles/Makefile.cmake +++ /dev/null @@ -1,62 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -# The generator used is: -set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles") - -# The top level Makefile was generated from the following files: -set(CMAKE_MAKEFILE_DEPENDS - "CMakeCache.txt" - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/CMakeLists.txt" - "CMakeFiles/4.1.0/CMakeCCompiler.cmake" - "CMakeFiles/4.1.0/CMakeCXXCompiler.cmake" - "CMakeFiles/4.1.0/CMakeSystem.cmake" - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/CMakeLists.txt" - "/opt/homebrew/share/cmake/Modules/CMakeCInformation.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeCXXInformation.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeCommonLanguageInclude.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeGenericSystem.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeInitializeConfigs.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeLanguageInformation.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInformation.cmake" - "/opt/homebrew/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake" - "/opt/homebrew/share/cmake/Modules/Compiler/AppleClang-C.cmake" - "/opt/homebrew/share/cmake/Modules/Compiler/AppleClang-CXX.cmake" - "/opt/homebrew/share/cmake/Modules/Compiler/CMakeCommonCompilerMacros.cmake" - "/opt/homebrew/share/cmake/Modules/Compiler/Clang.cmake" - "/opt/homebrew/share/cmake/Modules/Compiler/GNU.cmake" - "/opt/homebrew/share/cmake/Modules/Internal/CMakeCLinkerInformation.cmake" - "/opt/homebrew/share/cmake/Modules/Internal/CMakeCXXLinkerInformation.cmake" - "/opt/homebrew/share/cmake/Modules/Internal/CMakeCommonLinkerInformation.cmake" - "/opt/homebrew/share/cmake/Modules/Linker/AppleClang-C.cmake" - "/opt/homebrew/share/cmake/Modules/Linker/AppleClang-CXX.cmake" - "/opt/homebrew/share/cmake/Modules/Linker/AppleClang.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Apple-AppleClang-C.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Apple-AppleClang-CXX.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Apple-Clang-C.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Apple-Clang-CXX.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Apple-Clang.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Darwin-Initialize.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Darwin.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Linker/Apple-AppleClang-C.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Linker/Apple-AppleClang-CXX.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/Linker/Apple-AppleClang.cmake" - "/opt/homebrew/share/cmake/Modules/Platform/UnixPaths.cmake" - ) - -# The corresponding makefile is: -set(CMAKE_MAKEFILE_OUTPUTS - "Makefile" - "CMakeFiles/cmake.check_cache" - ) - -# Byproducts of CMake generate step: -set(CMAKE_MAKEFILE_PRODUCTS - "CMakeFiles/CMakeDirectoryInformation.cmake" - "src/CMakeFiles/CMakeDirectoryInformation.cmake" - ) - -# Dependency information for all targets: -set(CMAKE_DEPEND_INFO_FILES - "CMakeFiles/newlinalg.dir/DependInfo.cmake" - ) diff --git a/newlinalg/build/CMakeFiles/Makefile2 b/newlinalg/build/CMakeFiles/Makefile2 deleted file mode 100644 index c0b4a69f3..000000000 --- a/newlinalg/build/CMakeFiles/Makefile2 +++ /dev/null @@ -1,144 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -# Default target executed when no arguments are given to make. -default_target: all -.PHONY : default_target - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Disable VCS-based implicit rules. -% : %,v - -# Disable VCS-based implicit rules. -% : RCS/% - -# Disable VCS-based implicit rules. -% : RCS/%,v - -# Disable VCS-based implicit rules. -% : SCCS/s.% - -# Disable VCS-based implicit rules. -% : s.% - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /opt/homebrew/bin/cmake - -# The command to remove a file. -RM = /opt/homebrew/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build - -#============================================================================= -# Directory level rules for the build root directory - -# The main recursive "all" target. -all: CMakeFiles/newlinalg.dir/all -all: src/all -.PHONY : all - -# The main recursive "codegen" target. -codegen: CMakeFiles/newlinalg.dir/codegen -codegen: src/codegen -.PHONY : codegen - -# The main recursive "preinstall" target. -preinstall: src/preinstall -.PHONY : preinstall - -# The main recursive "clean" target. -clean: CMakeFiles/newlinalg.dir/clean -clean: src/clean -.PHONY : clean - -#============================================================================= -# Directory level rules for directory src - -# Recursive "all" directory target. -src/all: -.PHONY : src/all - -# Recursive "codegen" directory target. -src/codegen: -.PHONY : src/codegen - -# Recursive "preinstall" directory target. -src/preinstall: -.PHONY : src/preinstall - -# Recursive "clean" directory target. -src/clean: -.PHONY : src/clean - -#============================================================================= -# Target rules for target CMakeFiles/newlinalg.dir - -# All Build rule for target. -CMakeFiles/newlinalg.dir/all: - $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/depend - $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/build - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=1,2,3,4 "Built target newlinalg" -.PHONY : CMakeFiles/newlinalg.dir/all - -# Build rule for subdir invocation for target. -CMakeFiles/newlinalg.dir/rule: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles 4 - $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 CMakeFiles/newlinalg.dir/all - $(CMAKE_COMMAND) -E cmake_progress_start /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles 0 -.PHONY : CMakeFiles/newlinalg.dir/rule - -# Convenience name for target. -newlinalg: CMakeFiles/newlinalg.dir/rule -.PHONY : newlinalg - -# codegen rule for target. -CMakeFiles/newlinalg.dir/codegen: - $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/codegen - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=1,2,3,4 "Finished codegen for target newlinalg" -.PHONY : CMakeFiles/newlinalg.dir/codegen - -# clean rule for target. -CMakeFiles/newlinalg.dir/clean: - $(MAKE) $(MAKESILENT) -f CMakeFiles/newlinalg.dir/build.make CMakeFiles/newlinalg.dir/clean -.PHONY : CMakeFiles/newlinalg.dir/clean - -#============================================================================= -# Special targets to cleanup operation of make. - -# Special rule to run CMake to check the build system integrity. -# No rule that depends on this can have commands that come from listfiles -# because they might be regenerated. -cmake_check_build_system: - $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 -.PHONY : cmake_check_build_system - diff --git a/newlinalg/build/CMakeFiles/TargetDirectories.txt b/newlinalg/build/CMakeFiles/TargetDirectories.txt deleted file mode 100644 index 25891c150..000000000 --- a/newlinalg/build/CMakeFiles/TargetDirectories.txt +++ /dev/null @@ -1,13 +0,0 @@ -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/newlinalg.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/edit_cache.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/rebuild_cache.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/list_install_components.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/install.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/install/local.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/install/strip.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/edit_cache.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/rebuild_cache.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/list_install_components.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/install.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/install/local.dir -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/src/CMakeFiles/install/strip.dir diff --git a/newlinalg/build/CMakeFiles/cmake.check_cache b/newlinalg/build/CMakeFiles/cmake.check_cache deleted file mode 100644 index 3dccd7317..000000000 --- a/newlinalg/build/CMakeFiles/cmake.check_cache +++ /dev/null @@ -1 +0,0 @@ -# This file is generated by cmake for dependency checking of the CMakeCache.txt file diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake b/newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake deleted file mode 100644 index 47bc012d2..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake +++ /dev/null @@ -1,25 +0,0 @@ - -# Consider dependencies only in project. -set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF) - -# The set of languages for which implicit dependencies are needed: -set(CMAKE_DEPENDS_LANGUAGES - ) - -# The set of dependency files which are needed: -set(CMAKE_DEPENDS_DEPENDENCY_FILES - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c" "CMakeFiles/newlinalg.dir/src/newlinalg.c.o" "gcc" "CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d" - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c" "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" "gcc" "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d" - "/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c" "CMakeFiles/newlinalg.dir/src/xmatrix.c.o" "gcc" "CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d" - ) - -# Targets to which this target links which contain Fortran sources. -set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES - ) - -# Targets to which this target links which contain Fortran sources. -set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES - ) - -# Fortran module output directory. -set(CMAKE_Fortran_TARGET_MODULE_DIR "") diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/build.make b/newlinalg/build/CMakeFiles/newlinalg.dir/build.make deleted file mode 100644 index ad8e14e08..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/build.make +++ /dev/null @@ -1,148 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -# Delete rule output on recipe failure. -.DELETE_ON_ERROR: - -#============================================================================= -# Special targets provided by cmake. - -# Disable implicit rules so canonical targets will work. -.SUFFIXES: - -# Disable VCS-based implicit rules. -% : %,v - -# Disable VCS-based implicit rules. -% : RCS/% - -# Disable VCS-based implicit rules. -% : RCS/%,v - -# Disable VCS-based implicit rules. -% : SCCS/s.% - -# Disable VCS-based implicit rules. -% : s.% - -.SUFFIXES: .hpux_make_needs_suffix_list - -# Command-line flag to silence nested $(MAKE). -$(VERBOSE)MAKESILENT = -s - -#Suppress display of executed commands. -$(VERBOSE).SILENT: - -# A target that is always out of date. -cmake_force: -.PHONY : cmake_force - -#============================================================================= -# Set environment variables for the build. - -# The shell in which to execute make rules. -SHELL = /bin/sh - -# The CMake executable. -CMAKE_COMMAND = /opt/homebrew/bin/cmake - -# The command to remove a file. -RM = /opt/homebrew/bin/cmake -E rm -f - -# Escaping for special characters. -EQUALS = = - -# The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg - -# The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build - -# Include any dependencies generated for this target. -include CMakeFiles/newlinalg.dir/depend.make -# Include any dependencies generated by the compiler for this target. -include CMakeFiles/newlinalg.dir/compiler_depend.make - -# Include the progress variables for this target. -include CMakeFiles/newlinalg.dir/progress.make - -# Include the compile flags for this target's objects. -include CMakeFiles/newlinalg.dir/flags.make - -CMakeFiles/newlinalg.dir/codegen: -.PHONY : CMakeFiles/newlinalg.dir/codegen - -CMakeFiles/newlinalg.dir/src/newlinalg.c.o: CMakeFiles/newlinalg.dir/flags.make -CMakeFiles/newlinalg.dir/src/newlinalg.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c -CMakeFiles/newlinalg.dir/src/newlinalg.c.o: CMakeFiles/newlinalg.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object CMakeFiles/newlinalg.dir/src/newlinalg.c.o" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/newlinalg.dir/src/newlinalg.c.o -MF CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d -o CMakeFiles/newlinalg.dir/src/newlinalg.c.o -c /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c - -CMakeFiles/newlinalg.dir/src/newlinalg.c.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing C source to CMakeFiles/newlinalg.dir/src/newlinalg.c.i" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c > CMakeFiles/newlinalg.dir/src/newlinalg.c.i - -CMakeFiles/newlinalg.dir/src/newlinalg.c.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling C source to assembly CMakeFiles/newlinalg.dir/src/newlinalg.c.s" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c -o CMakeFiles/newlinalg.dir/src/newlinalg.c.s - -CMakeFiles/newlinalg.dir/src/xmatrix.c.o: CMakeFiles/newlinalg.dir/flags.make -CMakeFiles/newlinalg.dir/src/xmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c -CMakeFiles/newlinalg.dir/src/xmatrix.c.o: CMakeFiles/newlinalg.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building C object CMakeFiles/newlinalg.dir/src/xmatrix.c.o" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/newlinalg.dir/src/xmatrix.c.o -MF CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d -o CMakeFiles/newlinalg.dir/src/xmatrix.c.o -c /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c - -CMakeFiles/newlinalg.dir/src/xmatrix.c.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing C source to CMakeFiles/newlinalg.dir/src/xmatrix.c.i" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c > CMakeFiles/newlinalg.dir/src/xmatrix.c.i - -CMakeFiles/newlinalg.dir/src/xmatrix.c.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling C source to assembly CMakeFiles/newlinalg.dir/src/xmatrix.c.s" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c -o CMakeFiles/newlinalg.dir/src/xmatrix.c.s - -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: CMakeFiles/newlinalg.dir/flags.make -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: CMakeFiles/newlinalg.dir/compiler_depend.ts - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -MD -MT CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -MF CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d -o CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -c /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c - -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.i: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing C source to CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.i" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -E /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c > CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.i - -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.s: cmake_force - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling C source to assembly CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.s" - /usr/bin/cc $(C_DEFINES) $(C_INCLUDES) $(C_FLAGS) -S /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c -o CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.s - -# Object files for target newlinalg -newlinalg_OBJECTS = \ -"CMakeFiles/newlinalg.dir/src/newlinalg.c.o" \ -"CMakeFiles/newlinalg.dir/src/xmatrix.c.o" \ -"CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" - -# External object files for target newlinalg -newlinalg_EXTERNAL_OBJECTS = - -newlinalg.so: CMakeFiles/newlinalg.dir/src/newlinalg.c.o -newlinalg.so: CMakeFiles/newlinalg.dir/src/xmatrix.c.o -newlinalg.so: CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -newlinalg.so: CMakeFiles/newlinalg.dir/build.make -newlinalg.so: /usr/local/lib/libmorpho.dylib -newlinalg.so: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd -newlinalg.so: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd -newlinalg.so: CMakeFiles/newlinalg.dir/link.txt - @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Linking C shared module newlinalg.so" - $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/newlinalg.dir/link.txt --verbose=$(VERBOSE) - -# Rule to build all files generated by this target. -CMakeFiles/newlinalg.dir/build: newlinalg.so -.PHONY : CMakeFiles/newlinalg.dir/build - -CMakeFiles/newlinalg.dir/clean: - $(CMAKE_COMMAND) -P CMakeFiles/newlinalg.dir/cmake_clean.cmake -.PHONY : CMakeFiles/newlinalg.dir/clean - -CMakeFiles/newlinalg.dir/depend: - cd /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /Users/timatherton/Documents/Programs/packages/morpho-newlinalg /Users/timatherton/Documents/Programs/packages/morpho-newlinalg /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/build/CMakeFiles/newlinalg.dir/DependInfo.cmake "--color=$(COLOR)" -.PHONY : CMakeFiles/newlinalg.dir/depend - diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake b/newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake deleted file mode 100644 index 30588d57d..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/cmake_clean.cmake +++ /dev/null @@ -1,15 +0,0 @@ -file(REMOVE_RECURSE - "CMakeFiles/newlinalg.dir/src/newlinalg.c.o" - "CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d" - "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o" - "CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d" - "CMakeFiles/newlinalg.dir/src/xmatrix.c.o" - "CMakeFiles/newlinalg.dir/src/xmatrix.c.o.d" - "newlinalg.pdb" - "newlinalg.so" -) - -# Per-language clean rules from dependency scanning. -foreach(lang C) - include(CMakeFiles/newlinalg.dir/cmake_clean_${lang}.cmake OPTIONAL) -endforeach() diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal deleted file mode 100644 index fec9c810e..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.internal +++ /dev/null @@ -1,1193 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -CMakeFiles/newlinalg.dir/src/newlinalg.c.o - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h - /usr/local/include/morpho/array.h - /usr/local/include/morpho/bool.h - /usr/local/include/morpho/build.h - /usr/local/include/morpho/builtin.h - /usr/local/include/morpho/cfunction.h - /usr/local/include/morpho/classes.h - /usr/local/include/morpho/closure.h - /usr/local/include/morpho/clss.h - /usr/local/include/morpho/cmplx.h - /usr/local/include/morpho/dict.h - /usr/local/include/morpho/dictionary.h - /usr/local/include/morpho/err.h - /usr/local/include/morpho/error.h - /usr/local/include/morpho/flt.h - /usr/local/include/morpho/function.h - /usr/local/include/morpho/instance.h - /usr/local/include/morpho/int.h - /usr/local/include/morpho/invocation.h - /usr/local/include/morpho/json.h - /usr/local/include/morpho/list.h - /usr/local/include/morpho/matrix.h - /usr/local/include/morpho/memory.h - /usr/local/include/morpho/metafunction.h - /usr/local/include/morpho/morpho.h - /usr/local/include/morpho/nil.h - /usr/local/include/morpho/object.h - /usr/local/include/morpho/platform.h - /usr/local/include/morpho/range.h - /usr/local/include/morpho/signature.h - /usr/local/include/morpho/strng.h - /usr/local/include/morpho/tuple.h - /usr/local/include/morpho/upvalue.h - /usr/local/include/morpho/value.h - /usr/local/include/morpho/varray.h - /usr/local/include/morpho/version.h - -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h - /usr/local/include/morpho/array.h - /usr/local/include/morpho/bool.h - /usr/local/include/morpho/build.h - /usr/local/include/morpho/builtin.h - /usr/local/include/morpho/cfunction.h - /usr/local/include/morpho/classes.h - /usr/local/include/morpho/closure.h - /usr/local/include/morpho/clss.h - /usr/local/include/morpho/cmplx.h - /usr/local/include/morpho/dict.h - /usr/local/include/morpho/dictionary.h - /usr/local/include/morpho/err.h - /usr/local/include/morpho/error.h - /usr/local/include/morpho/flt.h - /usr/local/include/morpho/function.h - /usr/local/include/morpho/instance.h - /usr/local/include/morpho/int.h - /usr/local/include/morpho/invocation.h - /usr/local/include/morpho/json.h - /usr/local/include/morpho/list.h - /usr/local/include/morpho/matrix.h - /usr/local/include/morpho/memory.h - /usr/local/include/morpho/metafunction.h - /usr/local/include/morpho/morpho.h - /usr/local/include/morpho/nil.h - /usr/local/include/morpho/object.h - /usr/local/include/morpho/platform.h - /usr/local/include/morpho/range.h - /usr/local/include/morpho/signature.h - /usr/local/include/morpho/strng.h - /usr/local/include/morpho/tuple.h - /usr/local/include/morpho/upvalue.h - /usr/local/include/morpho/value.h - /usr/local/include/morpho/varray.h - /usr/local/include/morpho/version.h - -CMakeFiles/newlinalg.dir/src/xmatrix.c.o - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h - /usr/local/include/morpho/array.h - /usr/local/include/morpho/bool.h - /usr/local/include/morpho/build.h - /usr/local/include/morpho/builtin.h - /usr/local/include/morpho/cfunction.h - /usr/local/include/morpho/classes.h - /usr/local/include/morpho/closure.h - /usr/local/include/morpho/clss.h - /usr/local/include/morpho/cmplx.h - /usr/local/include/morpho/dict.h - /usr/local/include/morpho/dictionary.h - /usr/local/include/morpho/err.h - /usr/local/include/morpho/error.h - /usr/local/include/morpho/flt.h - /usr/local/include/morpho/function.h - /usr/local/include/morpho/instance.h - /usr/local/include/morpho/int.h - /usr/local/include/morpho/invocation.h - /usr/local/include/morpho/json.h - /usr/local/include/morpho/list.h - /usr/local/include/morpho/matrix.h - /usr/local/include/morpho/memory.h - /usr/local/include/morpho/metafunction.h - /usr/local/include/morpho/morpho.h - /usr/local/include/morpho/nil.h - /usr/local/include/morpho/object.h - /usr/local/include/morpho/platform.h - /usr/local/include/morpho/range.h - /usr/local/include/morpho/signature.h - /usr/local/include/morpho/strng.h - /usr/local/include/morpho/tuple.h - /usr/local/include/morpho/upvalue.h - /usr/local/include/morpho/value.h - /usr/local/include/morpho/varray.h - /usr/local/include/morpho/version.h - diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make deleted file mode 100644 index 562519edb..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.make +++ /dev/null @@ -1,2860 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -CMakeFiles/newlinalg.dir/src/newlinalg.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ - /usr/local/include/morpho/array.h \ - /usr/local/include/morpho/bool.h \ - /usr/local/include/morpho/build.h \ - /usr/local/include/morpho/builtin.h \ - /usr/local/include/morpho/cfunction.h \ - /usr/local/include/morpho/classes.h \ - /usr/local/include/morpho/closure.h \ - /usr/local/include/morpho/clss.h \ - /usr/local/include/morpho/cmplx.h \ - /usr/local/include/morpho/dict.h \ - /usr/local/include/morpho/dictionary.h \ - /usr/local/include/morpho/err.h \ - /usr/local/include/morpho/error.h \ - /usr/local/include/morpho/flt.h \ - /usr/local/include/morpho/function.h \ - /usr/local/include/morpho/instance.h \ - /usr/local/include/morpho/int.h \ - /usr/local/include/morpho/invocation.h \ - /usr/local/include/morpho/json.h \ - /usr/local/include/morpho/list.h \ - /usr/local/include/morpho/matrix.h \ - /usr/local/include/morpho/memory.h \ - /usr/local/include/morpho/metafunction.h \ - /usr/local/include/morpho/morpho.h \ - /usr/local/include/morpho/nil.h \ - /usr/local/include/morpho/object.h \ - /usr/local/include/morpho/platform.h \ - /usr/local/include/morpho/range.h \ - /usr/local/include/morpho/signature.h \ - /usr/local/include/morpho/strng.h \ - /usr/local/include/morpho/tuple.h \ - /usr/local/include/morpho/upvalue.h \ - /usr/local/include/morpho/value.h \ - /usr/local/include/morpho/varray.h \ - /usr/local/include/morpho/version.h - -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ - /usr/local/include/morpho/array.h \ - /usr/local/include/morpho/bool.h \ - /usr/local/include/morpho/build.h \ - /usr/local/include/morpho/builtin.h \ - /usr/local/include/morpho/cfunction.h \ - /usr/local/include/morpho/classes.h \ - /usr/local/include/morpho/closure.h \ - /usr/local/include/morpho/clss.h \ - /usr/local/include/morpho/cmplx.h \ - /usr/local/include/morpho/dict.h \ - /usr/local/include/morpho/dictionary.h \ - /usr/local/include/morpho/err.h \ - /usr/local/include/morpho/error.h \ - /usr/local/include/morpho/flt.h \ - /usr/local/include/morpho/function.h \ - /usr/local/include/morpho/instance.h \ - /usr/local/include/morpho/int.h \ - /usr/local/include/morpho/invocation.h \ - /usr/local/include/morpho/json.h \ - /usr/local/include/morpho/list.h \ - /usr/local/include/morpho/matrix.h \ - /usr/local/include/morpho/memory.h \ - /usr/local/include/morpho/metafunction.h \ - /usr/local/include/morpho/morpho.h \ - /usr/local/include/morpho/nil.h \ - /usr/local/include/morpho/object.h \ - /usr/local/include/morpho/platform.h \ - /usr/local/include/morpho/range.h \ - /usr/local/include/morpho/signature.h \ - /usr/local/include/morpho/strng.h \ - /usr/local/include/morpho/tuple.h \ - /usr/local/include/morpho/upvalue.h \ - /usr/local/include/morpho/value.h \ - /usr/local/include/morpho/varray.h \ - /usr/local/include/morpho/version.h - -CMakeFiles/newlinalg.dir/src/xmatrix.c.o: /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ - /usr/local/include/morpho/array.h \ - /usr/local/include/morpho/bool.h \ - /usr/local/include/morpho/build.h \ - /usr/local/include/morpho/builtin.h \ - /usr/local/include/morpho/cfunction.h \ - /usr/local/include/morpho/classes.h \ - /usr/local/include/morpho/closure.h \ - /usr/local/include/morpho/clss.h \ - /usr/local/include/morpho/cmplx.h \ - /usr/local/include/morpho/dict.h \ - /usr/local/include/morpho/dictionary.h \ - /usr/local/include/morpho/err.h \ - /usr/local/include/morpho/error.h \ - /usr/local/include/morpho/flt.h \ - /usr/local/include/morpho/function.h \ - /usr/local/include/morpho/instance.h \ - /usr/local/include/morpho/int.h \ - /usr/local/include/morpho/invocation.h \ - /usr/local/include/morpho/json.h \ - /usr/local/include/morpho/list.h \ - /usr/local/include/morpho/matrix.h \ - /usr/local/include/morpho/memory.h \ - /usr/local/include/morpho/metafunction.h \ - /usr/local/include/morpho/morpho.h \ - /usr/local/include/morpho/nil.h \ - /usr/local/include/morpho/object.h \ - /usr/local/include/morpho/platform.h \ - /usr/local/include/morpho/range.h \ - /usr/local/include/morpho/signature.h \ - /usr/local/include/morpho/strng.h \ - /usr/local/include/morpho/tuple.h \ - /usr/local/include/morpho/upvalue.h \ - /usr/local/include/morpho/value.h \ - /usr/local/include/morpho/varray.h \ - /usr/local/include/morpho/version.h - - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h: - -/usr/local/include/morpho/nil.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vecLib.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h: - -/usr/local/include/morpho/value.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h: - -/usr/local/include/morpho/tuple.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h: - -/usr/local/include/morpho/cfunction.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h: - -/usr/local/include/morpho/matrix.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h: - -/usr/local/include/morpho/build.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h: - -/usr/local/include/morpho/dictionary.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h: - -/usr/local/include/morpho/memory.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h: - -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h: - -/usr/local/include/morpho/morpho.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h: - -/usr/local/include/morpho/function.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h: - -/usr/local/include/morpho/bool.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h: - -/usr/local/include/morpho/version.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h: - -/usr/local/include/morpho/range.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h: - -/usr/local/include/morpho/signature.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h: - -/usr/local/include/morpho/invocation.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h: - -/usr/local/include/morpho/instance.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h: - -/usr/local/include/morpho/error.h: - -/usr/local/include/morpho/err.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h: - -/usr/local/include/morpho/cmplx.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h: - -/usr/local/include/morpho/clss.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h: - -/usr/local/include/morpho/closure.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h: - -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h: - -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h: - -/usr/local/include/morpho/list.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h: - -/usr/local/include/morpho/upvalue.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h: - -/usr/local/include/morpho/builtin.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h: - -/usr/local/include/morpho/dict.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h: - -/usr/local/include/morpho/object.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h: - -/usr/local/include/morpho/strng.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h: - -/usr/local/include/morpho/classes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h: - -/usr/local/include/morpho/varray.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h: - -/usr/local/include/morpho/flt.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h: - -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h: - -/usr/local/include/morpho/array.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h: - -/usr/local/include/morpho/json.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h: - -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h: - -/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h: - -/usr/local/include/morpho/int.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h: - -/usr/local/include/morpho/metafunction.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h: - -/Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.c: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h: - -/usr/local/include/morpho/platform.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h: - -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h: diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts b/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts deleted file mode 100644 index a8f2c5b19..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/compiler_depend.ts +++ /dev/null @@ -1,2 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Timestamp file for compiler generated dependencies management for newlinalg. diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/depend.make b/newlinalg/build/CMakeFiles/newlinalg.dir/depend.make deleted file mode 100644 index 617758b7a..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/depend.make +++ /dev/null @@ -1,2 +0,0 @@ -# Empty dependencies file for newlinalg. -# This may be replaced when dependencies are built. diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/flags.make b/newlinalg/build/CMakeFiles/newlinalg.dir/flags.make deleted file mode 100644 index 19dd03f60..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/flags.make +++ /dev/null @@ -1,12 +0,0 @@ -# CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 4.1 - -# compile C with /usr/bin/cc -C_DEFINES = -Dnewlinalg_EXPORTS - -C_INCLUDES = -I/usr/local/include/morpho -I/opt/homebrew/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers - -C_FLAGSarm64 = -arch arm64 -fPIC - -C_FLAGS = -arch arm64 -fPIC - diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/link.txt b/newlinalg/build/CMakeFiles/newlinalg.dir/link.txt deleted file mode 100644 index 268e50489..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/link.txt +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/cc -arch arm64 -bundle -Wl,-headerpad_max_install_names -o newlinalg.so CMakeFiles/newlinalg.dir/src/newlinalg.c.o CMakeFiles/newlinalg.dir/src/xmatrix.c.o CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o -Wl,-rpath,/usr/local/lib /usr/local/lib/libmorpho.dylib /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libcblas.tbd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/liblapack.tbd diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/progress.make b/newlinalg/build/CMakeFiles/newlinalg.dir/progress.make deleted file mode 100644 index a69a57e8e..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/progress.make +++ /dev/null @@ -1,5 +0,0 @@ -CMAKE_PROGRESS_1 = 1 -CMAKE_PROGRESS_2 = 2 -CMAKE_PROGRESS_3 = 3 -CMAKE_PROGRESS_4 = 4 - diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o b/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o deleted file mode 100644 index e5ec20a2627bd3d800164001654318eea029ac95..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3288 zcmds(Piz!b9LHbnUz9&ZO9TaZm@1NB?Lx(3e6d9|Z89xYdgy^$WZ*{gRANqQsSz9+bCf2R6sWFl)^t3&@`xT$zUmN3-X^O_OzRo_ZJOCq6gu7{n``sMc{(`X8M?4k zV>@w>&o2a4HZsfJ3CGKsrg1o##NZn~ew@v@7JY4J)+N{YK+1iH+lsEsvPp<$bTkSg ze-6hz15Q6C#2A7AF@jEw=BZQdo@N67sr~(-`2POMhD-O~5VOmz;_j_hv9QwGx3JPE z76zI{4^G*!(%84q)+~z4O=2|B>qJpBr}PFUf=Xyq$Htr|NiH>UiyS zJlwN~)`y?PLmt)k{>lDJxF@rVjph&OdqdZRK7&5nFQ(tQaBb&2ej_u7_gLd*hs@ngKhY&uXgEAjM6CPryH=sVZO_bfl?VkmB;-T*X@t+0O^q&h5X zswMVsfJk9n*HnF)Es_b)e9J+6ZA6b74L2fT{C-30CjBKkwI^9Gv0jBo^FOivh4mk- zZ?bOS7qzchx3j*=`dQYWvOd82Eb9T*gM9vB*3YvJSZ`o`mNnIj);Guc7VFPgf6Mx3 z)}OOpWqpzLUfdLFAEQ&g5!N5DKE?WVKL1Co={{3@T+de0$Q{4$;Ws2U!He5r)|YV% zH5Z-c&vOiZ<8ZVk;SB_Qw_mQ6bnD%Sl2N8xm;N8N(pf41 diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d b/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d deleted file mode 100644 index 6a4ac92e6..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/src/newlinalg.c.o.d +++ /dev/null @@ -1,824 +0,0 @@ -CMakeFiles/newlinalg.dir/src/newlinalg.c.o: \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.c \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ - /usr/local/include/morpho/morpho.h /usr/local/include/morpho/build.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ - /usr/local/include/morpho/value.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ - /usr/local/include/morpho/varray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ - /usr/local/include/morpho/memory.h /usr/local/include/morpho/error.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ - /usr/local/include/morpho/dictionary.h \ - /usr/local/include/morpho/version.h \ - /usr/local/include/morpho/classes.h \ - /usr/local/include/morpho/builtin.h /usr/local/include/morpho/object.h \ - /usr/local/include/morpho/clss.h /usr/local/include/morpho/signature.h \ - /usr/local/include/morpho/upvalue.h \ - /usr/local/include/morpho/function.h \ - /usr/local/include/morpho/metafunction.h \ - /usr/local/include/morpho/cfunction.h \ - /usr/local/include/morpho/cmplx.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ - /usr/local/include/morpho/platform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ - /usr/local/include/morpho/closure.h \ - /usr/local/include/morpho/invocation.h \ - /usr/local/include/morpho/instance.h /usr/local/include/morpho/list.h \ - /usr/local/include/morpho/array.h /usr/local/include/morpho/range.h \ - /usr/local/include/morpho/strng.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ - /usr/local/include/morpho/dict.h /usr/local/include/morpho/tuple.h \ - /usr/local/include/morpho/err.h /usr/local/include/morpho/bool.h \ - /usr/local/include/morpho/flt.h /usr/local/include/morpho/int.h \ - /usr/local/include/morpho/nil.h /usr/local/include/morpho/json.h \ - /usr/local/include/morpho/matrix.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o deleted file mode 100644 index 894b74645848ba989b7bf8a70be7215f5bf70ac8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 26360 zcmeI4eSDPHb?5JBz#j1ugpm!HH`yk!gdyhDh}K#U5lKiYr^F^U#)y%S1d`F4^+H52 ziQ1tpal9?qZkHxbJT}-KVX~ncr#s4eYo&5p+S)C$orLZ>iFipWJ873R-p^;0pt9d{ z?|Gh?dBhOn?tbk)1qrYj)s6
      +I@iYTcnRu~@Er zHMhEij|vl>L(3d`f3^7@i9B^}E$y{+U9s-gPdByJ$6{6M{6qrD<&LVk%Hi-zC*P^{ z#;kBrIV>gnEI!T@(=Zeto)7XV;?w?dW6D7(B>9riXTTGij9L0VVcz(=0#`dJ7* z%!e$$_H(f^G&HtnLf=?8bTAQLkbWw>ARRI0KqM3$<wIEVA-xRgZH{cDW+vcC1VaA4Mnz2MYmPV+@$M&r2qppJk;n;UC zhNaGM-`Jozn4rGX)6D3Z$!2t9a&*+dSMr~p79D*W{t_NGW;OaMj+oxNA|Z2)e3Cz3 zP`-$`gvf%tHyCs9M$*q9r<6G}E!r<>mM1deJ_pJ|=AdgESW+`TwD$8~l)PRZGf*>M z=qsrkJLJ^;A?lX0r2!d5?&Qy7U~c-Y@T8+}lSAfb zCDR}NVj_Hfx)0rzh<)SNrxWq5_|}~C31eOmT}WBlge_*Kt?!!N*CZ@y&xG$!AC7Ov zUYpZLKm)1@5LtsY(5_y&7;lp(of^_hn;O) zzl+a-U$ynoWTk}fPxV#akF13|Y1BrmPvVluE4oaQCSe_opTm zMkf0{gRPy|cx?@E`P%-~QL8pATdcK#5) z4qvFIz1L;@0ba)X$_(od*yXiEe1`RhMEq{@&%ocdWbzYs{&P*1|6F79KNr3`{Ve)F z622$>RQywv{SNz|;qv!Z^r|0lB=@GBr zsh*RSX2>7|>ruu~`kvCxXC!SyI$7uPh~EA3s`tLQ87kHC_||J4ZOc>cYRW$wzAJqs z{z-iLlh}Gg`e=9qeR(78F++u~q4u`|G43B<8ANDAl$Q;i&Jo4O=^!;KTb2p}v1#XQd^H);y zPTpHMXL4xr3vk@DQj2CMaU~-$@ec_ zoGEi=<0PFw(S0O?_fDA;ef5?vl!hWZ z3yI68TWOcGb;e(9TN&SE9ht0*(FcpEm$l(#`hOz4F_p9CjLSIS=J>?mf)x9Q{xb{A z8jlD2sQ#x0W2rN&1xFS{*HohG3G6|{<}!X9;r50AGA`|?wEoc!#$ME3m!uD{r_(hl}fq1{avvT12U zn7B*rmxYJ750my?vYlBrmwn-B-RsGItpNRB%C_Df)88LnZEZU$Tg*-~?!qGvA(3*501X z-oE(E9cGQ)1HApRWEes9xg*IRQkX}*rgZ}lf>+CPFix)B`-585sLZ*&6r zgr2B)HTn>Gs-{m7{g7|6(D0okG$?bnjCD&wrhoB7yBFzy{;=*vSih8(nf`$(jH6R~ z?~-xv**ew<EZVZvOi+_2t5Dtl6kV*XMNBDjA9Fo_kSX+$knaF-9;|~eeMW<)t2aFp!ul4sa z)?0guFE5~<%v61Ve*7Hb17isN*6xjhV@}W~uBBb4DSL)-Me3X&ZGrbyf{ZiP<}&uE z%~=DCmKHku9>%UWV}l>*{xY|%A7(tyf3{}N9pEYZWZMq>+>>p;_Gu=D;UicB`798i=aVJ-v%sH38J{`Qo8Bm-vhqzr|xHBIK z!`q(uur?OI@1wsK{_oGS#=JgfjoBC9?9O|3yYrshwI*i{9 zH3nJ2Yl;k#sk)IV|Gm7oY>mRo})4@cx}aYUOPsl-QtVb z&zmP?4!>c7j>nQFW2wv`prox0XVPR`lk(&2k3B|c_xg}q(^>ng9%Nn0deuK8_jKav zN&KBxLDok|v+pIO?UGN<)^py2T*hBAy8Eovo%qPGCqwqRJpOEoTpn8od9u&ougpHK zd``JM_Q|mgb0_++KFc1$+Tw(#GjwG0s@+2RzJYfXV=}Lxi?P#_-8&9nhm>)ClJ&0W zGCHz-3O^Ankb3A(VaA=zJ|}Cf5*L5dHGuRZd`-^05C42#`H{2p%B`$2HhAj+3Dc&F z_*?Sl)#VZ0XWKr5oM%`&iL43F7WkOtmvb)9Kc%0^zEawkJPQwf2jlbbbcb!_T-e4F z$Ga=1Q{ttp_@ec7>PTjdNuFOx`=u^Vk7IkX)&swW{$vak{fQngsl#`{>ymt~(6_Sv z$Fqg+Z_@W^_kQ&^JAP)_WkBt6`LX-be&+9$(7)7S#|bbvPKaH2uV=>!d9T$NGT#sz zNS&bH_eGx((JLQ$Z^>D<9Sfv9@8_(o8G|1jnfc`PULN6-d2g8I$KkB`0GsE`$?)>$ zH+12Tnds^aYpIL0CwuP7(UG)8$En=8C~JPZLc7VnLiV_}pUd9D^K;G?7;pPe7nN#W_Qjj*x!6@K)Bl@Y&{xoIR8UE}4E_`Ej0Odt2= zq*5Ix#xbb5j4SM`bH){D@e#4T@9#Pe<+N{5>~R(MFhVk)^Dfuvk@48Ri;?q5#(3dn-}4Gj zFO4z3U*6v&y!e_4725OZ;W^lq zGaiq(v>#dhc|&}XJ2Y}9rr)!#jAL?Nz{|(ogaaSq9ZMWNo@GBK@||VRBzYunFyH0V zUEAM%d2{d#;6mexqSU@O*OXXBiwP(^NdRN?6PKLy~v!v$DaSYv#f02M9b1wUG8C%7FWxkj3%J)xfA?G#gb)J{?nx|iBm)9r7&b;ho zjOE=Ae9lPU6#u2~7BDYz<|KOv+dt9Q82h;~^fh)?*TZ%lsQo#2-<4U{QQv#ddm4C8 z1Mg|zJq^64fq%CKSVvsZbEWyNh}nCY-qXPUXAQhte`eixMNd`h+U6a1c6Ic8taVp& z{o0NlCM%|{rM+ugvuW>W?J~T`-QL#GQcLJ=`vrzFQ`_0uw4>FOR`Lym=7yd-Yl-hE zGj+{vtqmq8vV_unIiaD)i!LesSZh~V4z;)>JIXODDUB_Tm6^_lE>~JgNrXi&OqRtt zwIM=Vb9YOt$KK;*`NONyrCKH>fs(cL^}%9+964l3=_aq)fq0}0#C)Qu8J*SFcbLxZ zZSv_bE#1w*Tw171(mG6i(=PdRnA*BJgEE5RHnr|*=;&-Pt(eAqq`9rO3ze05AvD+B z;#D9v=<2AgYmmRKo$YND>u9KLHrfJfqn6qoD6jPa`)8w{uc@`Qp(De{Z*yCB7x4{E zI~rPd)i!rGbefIbxPq{Ny5IqsimQ{v#G7M)BN_f2O8?SJn5V{aw+R=m-er!rp}BXdX8cn zG0uK#J34B2mzff?#N1+4l}HT{@lGfuvhH(Z{7yQUw{Q@-Rz zmoS_s-Q4675_!gl#6p*D%~&*ke0x#TFXZ9>1m9QvmN82XfWHf_2l@Wkl64@iT@`g$ zQ3}S1zW_f;PlMd+s(Qy^#R2dyh<^m^A%4HZihUset9l()w1bkb8Kh}djSed|YJ3&A zhxqjlE7pOis4D8PVks!)7lZg*RjI>@g&?Y~Dsfm*1WLXs;7MbeBMz%4fFms z2qF1?3hpL;#9_rb5Z9_2c35!|lzcCPpCNw0Va1E!eCU+Jieunkk?#=rXW--Dr%6BH zuwp+*m#Nz4u%ZY2FXU?kv0+uc!-{h7Z;*SX!|J8rE96@Yex7`#4lCw@e@(tw4y%j7 zza(D~__xGQaaesGC5oNj1phlY0RA4hAB=+$Q0zJZ6uXMj!HV-JRmu&6-v(a+d%+rz zp=ZfL@LOOp_yRbLQvVT5f&T#ZfRgWakfCge0VV%=l)D#v1$+bS0VRDYDDoA9zXM)C zxsv~+TT>)RguFA?$5Y-9acXMO1T$!5sC_` zjytS421>c4!-{>N$lL3%dSs%L>zu>t6ew~X(fEYMZv_7b@#{e07j;h(&mQ~I5-tN*;i>L8Bi49|ONd`V-){!7A|Yz;z%ht>QhKV1=yX zUnIT=M3f~4lzi_PV^C$)d50B01yN1ah{K9EK*>j)vI(ks*9`!ml3uZy?>* z%7@zvR`=i!2T^e&xCyKQ$@{(y-~liS)`8{VHjw+(=1;&`U@ce#)_?|l8ayB2Hz~jo za4UEUd-7O@$13O(B&X)d|#=? zmw@*{7lD5a8jVk*z^ z&yIqJH2whiThP7W6JR^|aj+3w4{id#46X-121Yf0DcAyC0!qEJz>k6v@L^ECfcg>e zJosU77<>Rc3Elvn0M~)ipC1F0py)FJR)Pn>Ca@Qj{5=}q2tEqE3H(iPgT_a}FF`NW z_)_pg(6hi+FaoXxjmDp!zy&bqVNm#=0ww`E@u$G&pigN00QeuEkAq(T z6X5OOA&uV;c0u=m!oOYPYrrJ*22kW*ukq!e@F@j_PYGB77J-j|1{8VH1ulLB+zx#T z6#geQUdB7&a~u>t+$k}?0UiQ{&wfz&^lE%ND12%_;j>BO*Mt8Nx*QZamuh?oco@0} zTmweHa!@V=90Er`86Sqh)!<3+S#SWn4NQS6z$ADCJOr)+4`_TZ_zZMAxDssC_)Xv! zp}B)#mV;67R&Xi!r(g-V44kF$5m3grw2@;U>00RI!%3oZhCz%sBA{0g`UECn}!H-k}dI#>=)1DAqRK=PQ$UMA0Y? z%$BL(NCjZBLaoG5;! znDDhD*G3ACl^rjO6r5W0CXVynsTdUo-t!CWkxgHZeT8Psu+L8B6`>Og9sPZAB6RpD z&M(gzrT;|f{YpQs^xNWWAf(){O?{*vZ-9LAT*pW9d*`X|;BS(@hE6LFeaWVK=XI}& zK1uJ;^slIV-g((UmESwR>Qi~V^N=^S{8K8=9L?{YClz~iiPX-Rr0u&&^WUTNBCkD4 zmn*$S=?WPDc&2H6T}pq`v!~KO*7Q$m`9Dy4yVA>*en{!x5t=^X{Z80oP51QGqx3%2 z&rM2yUg^Kr`X5pHb4ov^^irjtQ2MmC=djX`D*bh(E0yk7`bI`FvCrQsJ*f4cRJv8^ zA1FOr>7Ob6verLQ_0z4i9Z=Ed2b8`})4!+n->CF{rEgPumdf)4{2TRQkBqA7+x1 zr&j5R($^?GMd?AUe}U3nO5d#X`;}g-^aPdfHl?4@`tMMBgVL2s|5EGwgwoF{y;13V zmENj!MCm%E`?da7r5{kbQ|UQM_bB}ft^fCx{*uyQ{*t+B^ThsI+&U z{{byuq~#AXUQ2%OJp1RG?w#LnW-O9)?|lb*E=zmwH)NeB>E8Q_tx9|ECw3@*?>zhj zHQ#`@Q#jvY(K2?|tHLXu5ZP|B$xNdtdjarhD(#9@h4H?*j|8 ze((L}XEeX}KJsOyz4v?nqW1OP7m9C)JZ?qFnq2kcz3;n2>dTrx*kjB3#($2Go=u-2 zZ#FIK`fU0%?aQWrh&3ak8TLF2x1M>VZkpIunM>fCD1=7z3>X-dk zcK%&~_U#Om-w~*PD3G5YmdWAw%Ru>;0{Zx6Apfxd{nbGG9}d*_T!7|`A*cR-4Wt(Y z=z##eIncfs{*tYqc>($5{2)91%|Q7-56~R}e*FRcJR6|@Dv9Q zo1foRkRSD}Z>XS)uZowfMKekV%jU+8D?uy#BA02YpGO1y zY;l$z{M20bas@7neQu&$pv#+Rb(n`MSMajRd790Q9aq&QN+3X1tkY zxwu%@%tgsu8=F|0y|flnpIuN2EYZ;1z{SK&Gqe&|`6(@J9qo;6F?(UM zt8Ken+RX5_y)6)DojDMvcX2&GqUK!3|Sc&xyl)f$sf<>?J$T3FI(3&)b2}F9FE>?VPCd?ty4tpNZ{IGlS`!-B-rZW)#qCiV602+6+1a&| z-+Axg2h=mI)Z5Lmm~@QolGA!*L$eKAQ`?X=ZFah=PhwmrS1r{yNK{Vea8WU<>rBOR zXVw65jpKj`E%+4cgk=7mAF)=*B z(VjNEyV!m!+^v1T1xn_K7VE65ZALh+Y9)0l+uqSIPKD^9j>udcXr#vl(HNB*I=0)a zo_um;97nK!vwU|)cWnm=+L1rqfm62DZ)1=%jHj}g!gXsqU`gTHo^6+RESZqU~}mJNh#_8aj6cA{ufcl;4hqj_#a%-K{$w?8uJsGq$u`B3e{8 zKDs^_jXc;gJEM)+9*B9cBR8hGwsl8CAP=g{j#2UI+q$}AOzf9VstY8!iQt2)*BA}m z=7(1Kp_P7Ug&$h(hnD#vKd`#oXXl4j`Jt75XoVkI?uVB7AwRHswa?BEt@1-F{m=?O zwA>FZ^Fx`yZ9Y3cw8{^y^g}EB&~iVt%n$j2)vJ7VerS~+TIq*Y_@U)~Xqg}K1FKj1 z?EKIwKeW;ht?)z3{m?Q$M4+pseTBzrwI90853TY;EB(+4KeXHrE%QSJV7lCA>W6Og zL#zDIN{I{% diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d deleted file mode 100644 index 917e684a5..000000000 --- a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o.d +++ /dev/null @@ -1,826 +0,0 @@ -CMakeFiles/newlinalg.dir/src/xcomplexmatrix.c.o: \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.c \ - /usr/local/include/morpho/platform.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdbool.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stddef.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_ptrdiff_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_null.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_max_align_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_offsetof.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/complex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_symbol_aliasing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_posix_availability.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrcheck.h \ - /usr/local/include/morpho/varray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdlib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityVersions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityInternalLegacy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_bounds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/wait.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_pid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/appleapiopts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/signal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_mcontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/_structs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_intptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uintptr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_attr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigaltstack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ucontext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_sigset_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_size_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/resource.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint8_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint16_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint32_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uint64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_intmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_uintmax_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/__endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/_OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/alloca.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ct_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rune_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wchar_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_null.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_malloc_type.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/malloc/_ptrcheck.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_abort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_dev_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mode_t.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stddef_rsize_t.h \ - /usr/local/include/morpho/memory.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/dirent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/sched.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/pthread_impl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_clock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_time_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timespec.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_cond_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_once_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_pthread/_pthread_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/qos.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_mach_port_t.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/newlinalg.h \ - /usr/local/include/morpho/morpho.h /usr/local/include/morpho/build.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/float.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/float.h \ - /usr/local/include/morpho/value.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h \ - /usr/local/include/morpho/error.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdarg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_header_macro.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___gnuc_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_arg.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg___va_copy.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/__stdarg_va_copy.h \ - /usr/local/include/morpho/dictionary.h \ - /usr/local/include/morpho/version.h \ - /usr/local/include/morpho/classes.h \ - /usr/local/include/morpho/builtin.h /usr/local/include/morpho/object.h \ - /usr/local/include/morpho/clss.h /usr/local/include/morpho/signature.h \ - /usr/local/include/morpho/upvalue.h \ - /usr/local/include/morpho/function.h \ - /usr/local/include/morpho/metafunction.h \ - /usr/local/include/morpho/cfunction.h \ - /usr/local/include/morpho/cmplx.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_printf.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_seek_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctermid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_off_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ssize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_stdio.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_common.h \ - /usr/local/include/morpho/closure.h \ - /usr/local/include/morpho/invocation.h \ - /usr/local/include/morpho/instance.h /usr/local/include/morpho/list.h \ - /usr/local/include/morpho/array.h /usr/local/include/morpho/range.h \ - /usr/local/include/morpho/strng.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_string.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_rsize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_errno_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/secure/_string.h \ - /usr/local/include/morpho/dict.h /usr/local/include/morpho/tuple.h \ - /usr/local/include/morpho/err.h /usr/local/include/morpho/bool.h \ - /usr/local/include/morpho/flt.h /usr/local/include/morpho/int.h \ - /usr/local/include/morpho/nil.h /usr/local/include/morpho/json.h \ - /usr/local/include/morpho/matrix.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/Accelerate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Headers/../Frameworks/vecLib.framework/Headers/vecLib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vecLibTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/availability.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_neon.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_bf16.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/arm_vector_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/TargetConditionals.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBigNum.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vectorOps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vfp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vBasicOps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vDSP.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AvailabilityMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/thread_api.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/blas_new.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack_version.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/cblas_new.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/lapack.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/LinearAlgebra.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/matrix.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/vector.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/splat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/arithmetic.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/linear_systems.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/LinearAlgebra/norms.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Sparse.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/BLAS.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/Solve.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_limits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/log.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach-o/loader.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/boolean.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_prot.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/thread_state.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/thread_state.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/message.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/port.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/kern_return.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/architecture/byte_order.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/arm/OSByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_os_inline.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/arch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/trace_base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_timeval64.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_suseconds_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_setsize.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_clr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_isset.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_zero.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_copy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_select.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_char.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_short.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_u_int.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_caddr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blkcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_blksize_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_gid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_addr_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_in_port_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_ino64_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_key_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_nlink_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_useconds_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsblkcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsfilcnt_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/unistd.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_posix_vdisable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/select.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_uuid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/gethostuuid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/xpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fcntl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_sync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_o_dsync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_s_ifmt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_filesec_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/clock.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_interval.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/os/workgroup_parallel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/time.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/time_value.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/object.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/queue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/block.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/source.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/group.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/semaphore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/once.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/data.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/io.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/workloop.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/dispatch/dispatch_swift_shims.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/mman.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/uuid/uuid.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/bsm/audit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/machine/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/arm/_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/base.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/availability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/endpoint.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/debug.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/activity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/connection.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/rich_error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/session.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/xpc/listener.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/launch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/std_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_statistics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_notify.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/memory_object_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_sync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/exception_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/exception.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/exception.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_status.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/ipc_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_voucher_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/processor_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_inspect.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_special_ports.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_attributes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_inherit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_purgable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_behavior.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_region.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/vm_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/vm_param.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_page_size.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/kmod.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/dyld_kernel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_fsobj_id_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_interface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/clock_priv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/ndr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/notify.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_errors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mig_strncpy_zerofill_support.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_priv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/mach_debug_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/vm_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/zone_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/page_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/hash_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach_debug/lockgroup_info.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/host_security.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/processor_set.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/semaphore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/sync_policy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/task.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_act.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/vm_map.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_port.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_init.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_traps.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_host.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/thread_switch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/machine/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/arm/rpc.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/mach_error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/mach/error.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Sparse/SolveImplementationTyped.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Quadrature.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/Quadrature/Integration.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_constants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_structures.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/BNNS/bnns_graph.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/vecLib.framework/Headers/vForce.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Alpha.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Convolution.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Conversion.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Geometry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Histogram.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Morphology.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/BasicImageTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/Transform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_Utilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/Block.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/MacTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ConditionalMacros.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/ptrauth.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCGTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDictionary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFData.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFArray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_static_assert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ctype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_ctype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/runetype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_wint_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/errno.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/errno.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/locale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_locale.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_types/_locale_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/setjmp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/signal.h \ - /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/_inttypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBag.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBinaryHeap.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBitVector.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPreferences.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFSet.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringEncodingExt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFTree.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUUID.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMessagePort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPlugIn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFMachPort.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFAttributedString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURLEnumerator.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileSecurity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/acl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/kauth.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/_types/_guid_t.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStringTokenizer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFFileDescriptor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLNode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFXMLParser.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplay.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindow.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGWindowLevel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectPalette.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOReturn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/device/device_types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOMapTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitKeys.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/OSMessageNotification.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayFade.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEvent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRemoteOperation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOLLEvent.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/hidsystem/IOHIDTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomic.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSSpinLockDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libkern/OSAtomicQueue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/graphics/IOGraphicsTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOSharedLock.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEventSource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPSConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGSession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDirectDisplayMetal.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vImage.framework/Headers/vImage_CVUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVImageBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AE.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/FixMath.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Script.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/IntlResources.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UTCUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextCommon.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Collections.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MixedMode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Endian.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacMemory.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/strings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Math64.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/BackupCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DiskSpaceRecovery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Components.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Files.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/OSUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DateTimeUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DADisk.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/DiskArbitration.framework/Headers/DASession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_unistr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Resources.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CodeFragments.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Multiprocessing.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Aliases.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MacLocales.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/AssertMacros.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PLStringFuncs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverSynchronization.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/NumberFormatting.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/StringCompare.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/ToolUtils.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeUtilities.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/fp.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/fenv.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/UnicodeConverter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Threads.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Folders.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Timer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MultiprocessingInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/LowMem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AVLTree.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/PEFBinaryFormat.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/HFSVolumes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/hfs/hfs_format.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/AIFF.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/TextEncodingPlugin.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEDataModel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AppleEvents.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEPackObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEObjects.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AERegistry.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEUserTermTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEHelpers.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/AE.framework/Headers/AEMach.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFSocketStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHost.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFFTPStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPStream.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPAuthentication.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetDiagnostics.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFProxySupport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/DictionaryServices.framework/Headers/DictionaryServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LaunchServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/IconsCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/OSServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityAuthority.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmconfig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAsn1Types.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/x509defs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentity.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccessControl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKey.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicy.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRandom.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecImportExport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychain.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapple.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmerr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/certextensions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrust.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSharedCredential.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolOptions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolObject.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CipherSuite.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecProtocolMetadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssm.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmtype.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmapi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmaci.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcli.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmcspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmdli.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrapi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmkrspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/cssmtpi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/emmspi.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/mds_schema.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsalg.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsattr.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidsbase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscert.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oidscrl.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecACL.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCertificateOIDs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecIdentitySearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainSearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecPolicySearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustedApplication.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTrustSettings.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecStaticCode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CSCommon.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCodeHost.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecRequirement.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTask.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationTags.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthorizationDB.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSDecoder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/CMSEncoder.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecCustomTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDecodeTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncodeTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecDigestTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecEncryptTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecSignVerifyTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecReadTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecTransformReadTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/oids.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/DERItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libDER/libDER_config.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/CSIdentityQuery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/IconStorage.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/Power.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/SecurityCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/KeychainCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSMethodInvocation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/OSServices.framework/Headers/WSProtocolHandler.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSInfoDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpen.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSOpenDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/LSQuarantine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTCoreTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Headers/UTType.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/Metadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDItem.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDLabel.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDQuery.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDSchema.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Headers/MDImporter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SearchKit.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKDocument.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKAnalysis.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKIndex.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSearch.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SearchKit.framework/Headers/SKSummary.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/FSEvents.framework/Headers/FSEvents.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/SharedFileList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/SharedFileList.framework/Headers/LSSharedFileList.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATS.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSDefines.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTLayoutTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/ATSFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATS.framework/Headers/SFNTTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/SFNTTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSync.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncProfile.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncTransform.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncCMM.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ColorSync.framework/Headers/ColorSyncDevice.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontDescriptor.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontTraits.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTDefines.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontCollection.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManager.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFontManagerErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFrame.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTLine.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTGlyphInfo.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTParagraphStyle.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRubyAnnotation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRun.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTRunDelegate.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTStringAttributes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTextTab.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/HIShape.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Quickdraw.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/ColorSyncDeprecated.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Icons.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Processes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Pasteboard.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/TranslationServices.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/Accessibility.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXError.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXRoleConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXAttributeConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXActionConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXNotificationConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValueConstants.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXUIElement.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXValue.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/AXTextAttributedString.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/UniversalAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIO.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/ImageIOBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageSource.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageMetadata.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageDestination.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageProperties.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ImageIO.framework/Headers/CGImageAnimation.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PrintCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PDEPluginInterface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMDefinitions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMCore.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintAETypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintingDialogExtensions.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMPrintSettingsKeys.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Headers/PMErrors.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QD.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QDAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/Fonts.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicode.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSAvailability.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeGlyphs.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeFlattening.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/ATSUI.framework/Headers/ATSUnicodeDirectAccess.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/SpeechSynthesis.framework/Headers/SpeechSynthesis.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBuffer.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVReturn.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreVideo.framework/Headers/CVPixelBufferIOSurface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurface.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceAPI.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h \ - /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xmatrix.h \ - /Users/timatherton/Documents/Programs/packages/morpho-newlinalg/src/xcomplexmatrix.h \ - /usr/local/include/morpho/format.h diff --git a/newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o b/newlinalg/build/CMakeFiles/newlinalg.dir/src/xmatrix.c.o deleted file mode 100644 index 3d7324ce7dea7f0c03698f8bf077d9e7d0c32a45..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46992 zcmeIbeVmomdGCGi*(iGe6%`c(VN9?Y3@Run<~YfaAqkp^AxadL?aTlp5QZ6?84N~j z=5*VZMAKpsr^k*0o;m+rRzaKmGR!QIv}K>7Ud1%UAGE6@UDu z@K-Im%x}Txe8h{EX5zh`9t-I2bWcVN4V}%KI*kAt8kT-!+0p_Xp0+jmC-D=@!TX}< zW<89Fx_pfPx1nKW+xqowts$(TVbQ{+3j-BJL5?wnAjdC|uEK!;8yZ%0bQICW{3cty zsuCH~iS&tJ7m9oxo$YH|S6iCW`i6SGY1nPA4F1;>F64Xc_un_?1qi{)8B@sm7NV6TR*$DbyY({{i0-wIqN(%aE8YWniju_k3>*mdA|6ClP8}CUmJ)*UAu0|q@r{5H~9JJ+6&?1 zWcxwwm)}ml%Bbt6SH?$u)v2LtRJLTcy7+p0>yIuRB;Li1SKSI_xUkRHUW-wj6U$qN zUTBX&bX$3zbkp^G2E9jzqK8k?R!(>QYP*Ww6X>!#H)H4!dhE$H3`OWpx>o)H^a}s2 z7n}Y?i)ZTW+F_TbB>u#GAMQQbZ~P?#GE@J)!Ld=_{!}#2$vW1x@7>*@Jw#VVcXuV} zGorg2q3ITrdMdka8vIanE&g*-_38c@-At;saD3mS{TUzb+K;p=6BFkiHV~74?ZkyQ*&-qKw0&N5@)jx=T{yUV9qb>q%ea z+ABS!cDVc2=->|Yv8y9Gcqlz)w<|Y2?RZZvJJge#Hq?v$l5(nlE~E|diSi}ey3@-^ zyL@OyDth>7$~bY~U-r2EFp7;F#uvyoRG)voIeK{Tf{406Q>R09(C0!EUx8dl@fV6a zjpu>%>AR2c_wrTVZ>c}`MA3ZdH$z`nUq;4BuM*x1y@tOVQqkR+zx+bn&*^J@N&AW0 zA)Ow*9dgr$cBH2}Jvsg7F3O{mywf-O^ZGu&MBld*>3bIX{t$ZUO<&-2sr)|Q1ts}z zEt79Do_7}g_otrY$i@vL56X^?w_D9iP=~sEEKW%aTkoqe6eqPUt zdpx~t=$q+VhjylKAKIR~ZD@D;HhA1JgwHyt{`slD>}Yu08PV{r zozcNDmCbQRHXjn#-p+DJ#6+TpQm>1>A%qRp`QNR^S#mmW6)=89PFX&-IU$i z|F!(Wd)FS1_^ZIDRAg36zqoqE^qw4YpI!N23LnA*(fJnf$uJg*?`tPdUeME@%?CST z)^SsJ|9N?)B9j!(m~eLwVbOoza-qUi-|qfT(>EvOd(!lc^m*^xH~N>7_R}N!#__hl z=nekoWPhpsO&{u}KX1pzcF_NJ`u6ueAm`fO^_QMHJ>QYpW+UC$LwD{x^tHT@o@Z}U=Ot|FJZDqi%6)oBcC{;aD>}H9ytiOepN?&6H?}km zo7#Odh)wOzf!Ni~t5OHkW>?>QZ|dM_*w*3nY0jU?o_hMFCqHJ|vuocB?JM8fr1nkU zemoOxn(p+2t$5!$#rO5}IYoV}H+|FSeKvOvb)7<=eH;Cz&n?z(?%aZY)04b@bCU}C z3i{2R?eyjJ%d@k|+^0x?_UQV}O)Th_XQlsE`cp%X=avrbN-w3)-b~(`hj!;~qWmSX zj$MCMzeUHP-=2zoLtk=zw{D{KC8zgGXPR#eJ@8TCU zF8aUHF=t8s={k+!3ww{Zecz2Yu|LmMjP&RD^6mKY9rP>b7c`!x<7E=E~H;$Fb>eeV2J(I_>PZr!Jdc9Bi29;G?_^&&XHHXVzVqXL&Md7k#KZXZD)>*=^$zz7e~?t|-5k_)G7PrrJ3DNQ!k)7*EqY&!pTi<~g}Z@5+V$ zE0p^<{_mT#W2}GV(438V_(A!m9&Do;Keyuu^EYhfTiArlGF`@K5SoTANWZRPqv z&e!LRc${UkaSF*Kf&} zomckH$ZyZh$nU6|k>8n~k>B;^^aacx850}wtk0%0pUDRqGxyg%qBV(IKQdR=+HHG( zgPUiEwcY--&3WMQ3iJEwDa=RV<(@C%8Gi2hVz&+(cF*|9LDFX6XL*Ku-n?@G{nXi_ z;xsm@+zQGqwKeHPYl-CCRO|3CKj@~8tR?#n&xo!KK2d8*$$nUC!5OvJz85=UE_IIV zw`lE>;1lYoypkz}4-{75|Ags_SvMy54A`2eC*^gbG#S>u1L@3e%kS1qvd2<89$;Nm zEQi*Mr?Ib*df2UT@W(qCb9bhv=MQzT7Mc=|VKa`QdFKF#?ls?zZ z7<7m-50h_a`cCIlgKmQkw?xsODDTs(*%p8&S&utjti6N0ub!5Wm+&C($+V?S7i4?Y z>gMV|_~D$dN0<3C*@x10hu6`b3VY8F zFMTjdeds4~eM#@?iyZ$*eS_RCjC%YnVQOEkM-|si|2%QuN7y48x$X|@VeMlC+f1eW zen(em1L7j~Yb3w;Mk)4XurtOkx3AOl=8OgJr<`Avhy0g#sGO>lUyqN*leoBF&O(k# z$>U_H94A?*hqDXSUHu^`r^0&PY*;`Y&PlH6wcZJPKTap?les;DQS?$9$~V0nV$FJ( z{^Hs_3jGk5kDz!}7k99`*$}D1ULvuchUq{GMSnT-rw3BU1gt->K_HegAa! z#Zs*43UfNY-@&{r$2zC(qWqDo@UOY-kbDetzP`aL5_Bc>`|%HT+5Dj^(AWEG`;J^y z>+C4*o9E((=@*5*Ieq9_wOJuWT&=T-QN%=j%lIhmrDYQPv;5 zZnF*f59JAM5YHV-+ko!y8j_MPbyjHOz;s@+3>y*Tt&#i2_VXMMJ`UCvZnDxJ;g7%NYRcJlu!y4N1O z+E}u|Z-i{V{e4^+*>q0fc!c>Td7NDEJ7t@|kAyk2bmsh9vcB?HR^RtvtMcDPbJmjn z64wb?@axV$2Ays(Tc2fehxvZxlrGZwvm)QGy80?OH%hJnI3M$45H=F}lpBX^{pHFn zv8CWsUnkGH`zK6|ed@&4>GG@2*AbV|ycYgiOO~}S_RkV?^W)u&E7~hLbU}3DFk@=i zBk4`wITY%h3Ts2g9%pBMtaCaEHt5#5vH`_`s#DNc@C{YyOZ;h5)>d~8jUk=r(?I6A zoGaWpbUJkxjbta(dCZikZ{Gyg*=Ka! z6xPMXx+tF84qSk(oEx1u#5vYU){9}>c!l+a>hUUg17!z)R}tnC$#zs)e4^_78JkZq zXFtK(BOV_epNqT1=j*SY1*XP5s6Ff`(=63!qF*{W>4$#4Ko>&@{a}ebI64G4Cd>>fX;B-=5AMkLWwyxoP;n<;Nwr^0{** z(z|$2{ZjGrM~WBi`e}Jho_`0y_--`qgq{4K^0W8aIE34r5K~ z@0cHpx6az-cWjp74!Z-ReY(MVFhMb(*2jwg~_KVKfA)~_CSJIwS z(vPOXJWcys_?1xC((#c4_DPI!eTPXG#zW12RF2NY<+~Uc9fq;5n*9uocfWxR9OcYB zVqQ~R$3?x|J#hX$_7}NP&P>wWMF{>vdQa;d8-MYyzsY%XnKOiY{XGMnJNI%}#^l}Usd@KIf7s2L3ilx#eLZnE5OyhR3%?g%`$(@l zSDnWBSHsZuovDM{IggR9L<@It{)jA`fh==-65DBO`P**JQ(YfUzjGh%c4w~se5=>>Wq(h;`5S)J2k`FhjY)2+l#qpVt28I_lNyi`o|i34rw!! z7%K?hPMr>8E0P~xu0N`;_1GDI*f&!@l}!zXaGooWAJvFCq`mOF9m4>OTvUg`j8{cHBw2}IOKUd_LHg|Vr*wgj)i#<8}EgA0^ zGu%BHv)|%#I_^#6bO*!EzVN|2J2;>!cl$4;y>j z$>`65l6M{4I7%O4KW=n+iSu>24Y>-kyRdZDo!7ean;iWRyM#~qv)bHk<MF`8>0 z#-^Q*pzYk4PP--jyT&v5_bZTBwzbCgb3&fvx+#noMR6tkTwB0zD*Qr!&rHVdwRXiW z=@)K)f6&T3JCTlcq&xQrY19`bn{=tX?1M3XuBA@Czv=v@V9Sa7YoqvpAdC8Ya$V?j zf^MXfXKgN|J`UgbZX9#%(65VhSU8vD+E^!pR`JrFrSoqkd?hoVW|!q?RA7?XyRvO1pR&)E7@bK@ePQdczg zx^YNr(NodS4Ysz>o@^-d!?dG(O*tJs8_t%f&!{>&jdq2f#(>bS1L4jeyfcZjjQ63h zWZ7YFp;V7Ldl@YqZQ|Pxz0R_8?r}C>7%jc{mg@6+@Rp4yGh4g4fBe*z0z8S)<~+tP$%w z_4RUn;8klcr>lN^sLt{e_RoH%zXyPfmFUsgucaB1{TABU?Je7Sp|A3cXD`&cp0oLN zvX@f5{x9=u zU&H)xcQ~8C&(QDu86bLgXMlvo`|OE%dc;1X-MMsU1ZoeZe*(TC{S$Q!`FLJ$=_@bp z!r%D0Nb+vPAbDNCO-Fq%qK~3;uw=i@VN2N44(uu1`Hbs=uG}-S6rIm&zX_dI>h9(b zw%k5y8tqNsU$tLAyT3Lo%%us_9zbQ~vtQF5fZ}uq-L)a%nrFK(*)?UXNf&HHcLAJ? zI>RSj>Ws<4Jr?km&3)h4nt(_yBPzM*xC zc%98NYZcC*`*gl8|51TolT6w_bz=l|7G314lm4R&fAJK*L(KbsWuExr4Cl$(zmgs` zW{3GJ`{KL9K1q>`W%`=xG)SFN;%Rf3ic~G@W%(Ndv2*7)k;%<{ zgN(=~{u(1Q+{v%CHkJRNo#L@O!#faLPX6o-or!8+-uV~hD<>2A51CBz9cpvQd8&0z zmd%?i&v#LFQ9n-B?QPmrYtu}Lov6M&Vg10f^cLg`bN*A2)9H=5iEHbUb{JLWQs0A} z?_f<3bc<~d57hbhY9!NP$*J`MW$1o_d$x89?_)HE`xoR>o&k7h?LFE%D~D`+Q#)LY zPQo1y)m`fwg(vl{aLMEO>b}e=_Sv8l*_!%o!q(irApXJeWE??5p?d_RsLRWAU`xCVy}#6`61>Xal28^Bk$#o5PfL?-G{q5 zr&34R&|+H?E3fioGB)3pZE8IXf7cf1t*8z9H7^SH7JUEISPz|)7;+8SJyo|&X?ovvk@Nr#Q^<4 zcTZy3^^EN9JcWMY>dm~lx6box%R-m@KpsqdWO#jsGIJwIJJ!Kw7&LcZ5z1c#X9y?Ha-4W<{bNPZbcE4x%R@sYfuS0p2$K3%$POaB9hB+T*_P#&q>#=#I54t<$F;~9W%jM^U@E%PsN8s;t zbB6Etqv|CmADX!LiB9}GRRtf${F8QvhEF^uh{lJ?XSz7_ule5LtMH%LsT&WlKfP1x z_ARI zPfMI7zl-rN@Kjyp12SXm{Z*cm=jbVbe3|AX?E5*?7@$3eqHzE}sG_O**>R+1s+w*XR#;!!071^z| zne28{n|hnM{PsHTM5|7^2Lb=0Ic?Gw)ko|6{IEMc-JR!!G1b{)&f8zGM{JI9(B=SY z8=d28?*l!CwfV(iZLT=l!k=f;hU_IQOx*8v^@g9u!@;m$pT6_B<|o=Ww0JicDAEhI zs<_afU3-P}$W(TY>Dnw|mpS&WDWCfteTnyF3-4wp^c&v~Oe3$>8}v!ZurKm=XoF7F z2XsHw?cpP*?z5(7gR0s_*AB&Nl!V`Wn>Nw?lhV0jX*(!hG96-mD7m`QUM}fUwCX86 zhx>o(_uc54dBO?iIVUdWT|t-b9sIC#{;u_%&}Xubh+n~8e{-b0Ci49%?V!Gpn&|nL zZHGizZzrSLRQf9FS4ls|xaZcvwoZ!sl-faUqPD8@ZM84nKP{|%-96G^)8@121AC=^ zt!=O`_g=Sa5BX#BU&ZxGtfP{$CHj1+T{#-rTz^N_VAswMBe(18$Q91ZlBY!5H zC;HKdwqdQafHqLSalUnO({$uMq58)2JjK*6pkBt2`XIc*2mCA;@1eM` zuud?4726K}Nc^PlkT>2xp>7JpFBHG$@Gfm9_C3-o^6U@mPjnp5Rcx;Pj{e>1Q#9r# z<$8zy#<=Tk8d;o=r2nejLSK|V*pqVKF3|iksn5^{i#u&F-=0<7rRlk6t+Ro5}A>@ZRrI*T(2h`!JG6e~j}(S5pt!Y)`@llQtXe ztD2rU_W$0LO1*Eov)v2+=)&rBG#{tuYf!2AV(YPP%i1nuJnbx-AK+fU&Lrb+ca-tS>d=Su-HIId zHQ?cNWVoHPbhoF2{rU4t&cV}qKmQcIUBTTfy_f!u->zV;IGW#deagOLqBfLV=-sVD ziu!h9P8VAx~NA4Txdkb6aouD1qv0v{m&+C0|XB%OCj;+c!?Xd8$ zXGXn?#xu7DBkgwhD!=sNZCmeTFGq$`xPz3wjdUaLAjNvD8|Cg-jyvFWtkrWD4ed;$ zFZP;TpQZn~@0V~_s`&oavZ6k#`(N(6C%MV4A3C4gZ}&F)@8JDhzjyUT^VPjMzU9&X z^?Ycf_>L%PGrA*6-Z$9WaeQ*dCs*JT?nJ0vdvow{-~C{`Kdtse1^#(Q?gHiz7c$qF z%3R|P<`lOdclu;~(w)2YxWj08}uNn%HZzj(79@l zM41tHAvsHO^9+4Mh4;3H@bS*}RYyn9zwtY}$*(%n+h4`0-x$P<1MD`xiYOGZysJP05R|(^oq2uDa>{GjaW>OZuzS zWv%n6-o6U&puZV(4$o?hoAC8=+B@7G4U~1kJKq7SyS3;JP;7hsquCzcKB>D1+tZz^ z<>=3kN%H5xKGgT98{eVPohRv;bn4G_7t#k4-|cYyx%jT)ZoWq%TdvX_L;72lg6VcY74pjgC~e*d`Knbb06- z8rS_@%~SYR58s$6x}#aAF*&~f8{a`XVr$torFYO+-^J_0(7*8A@m`SDhwKGWN2fE_ z9{n@&v#E>LUq$>#o4hYvbgw4FmEkv8y3t$+-Ds_-xd3hL?z1hnGY#F74rwye+`8J| zZK4iGv=+2`qG7&)d~R>w>AhdyGfS*7lXDmBG~DMKQ77$*!Mm)E6j!EB@0X6KN0E-i zkFZhsNk@t+!%x03)Svl~n@g4ID4fGP8>@2b$D(_Enny90b925y=65>#DCnnfM)bD6 zj&ewcdkbGtaPzoT}+#d;3auS4g6);WZy#+wt@A5t@hT`($dzZv00N z{$_vdXXKM_%`2{&JUf&JUh>^L>Hn?|**=xR(OWzY=*(2_nt1>0eYN-5A#BD_qkMKQ z_-sFZ4~B82gkJ`Ju5A34lQnmd_u1(S+&xv5)f0R+&r0LkF`WqKISz+UA-(76>@!{B zHxuP}e#^Yy%xMkv%lplOy^k_KXH0wBc_p@8G_Rx%$+ciSuXOFN`GD@;j+|FM8~iVI z=w)8%-m61jvKdd$Qd@HOxiG&xrui1}@qCMZmz)QaUFo{gyV8a8W$YuqW34?I_l-E_NqiSZXGO!ocW^d3%pHSa?ic6|u{-~luWxdDL&+c`#@Hx-XzJB-J;*M*u&ac?<^IMX%H^?hDtVi&6P;<~%At+aE5+ zPjjYlZp^zceqB9c&x|u^I}_2IN$+QF;rp?C*J-!rNxj&b-4Wa!=1;Ca+x};{vi;tw z=*PGbiQ(Ze3F}_P?HKx``k~rpzug~?_t9*gS#(!9ow+nK_r~vJ zPW#k%l~s`Eo+aq zsP4=)O3!xVaY1!cTVapkyAY$*C!#)uZ?P2aZzO$_8-MVN+xr=RMmy`Xz8v%;f2_HY z(>djb@FKsAed!D)J|kgX{*FG8`FGK`saQvb`&iiLR{kEAod(%;S2#*VeWS&pr@r2u zlJlbc)70zf^z=Mq;PVt12t4ei<`DWB35jcp0v2CL&amhTHEfA&0m=*vn={oH;+Sc~fW zwel%JFQIg!7`MZEaQSn_BPXAO6=6o2u5fb~d-) z)wHs?YE|=HYg^ZLu5D}WxIDTp`e1ZNRa6yaFX@Q5)0d6vTNk#h{zPZ{rt4epX<4JwY6+q-&!cmaU*}74|f@>;?zy6Ruz)Qp>g3i zu5FoBh^JiAw?`ctSLm-jTEDSHf9=t#wf96#D_2I<4YLcp*S6l%+}_a~wW6O;L0DL| zsno{xQD-}?r+-^JHnfp;ZEI_Ddq@(?)3%Xzj+)o5Zf?D&sbynxN3?X~hL&cj(gk+h z+tJy)KI*t8SBr9nV=W8w>RBO>s@~N<+GyeS2eeG zuI;?nQb(7pj&6)@i5Ai`fBk#c8o-yI((gYy-6<9N>qNiSz^^s%wi@`4?w9}3{N7gh zMC7TKo5=F($9JKDQ`PgSrYjYJIqEO<>+-2N;wb)g8M#JS<^DHb7UE&hs6E0_;vY3Z zW-5N-$ox-Pe52y^e|szWO)~{Nr0`Ml_gMS`KHrG^vw4ABzw11Vh+kvzoFVErB7U32 zFDVm$)Z$GKBl16IA>C#2x3IX-Z?mt*i2SUL+;1u6OdLhN>$v2mANwczjmSTfgG&95 zdKeL(fvJ9rJ&cH7V)0wb#J_0q&-r#7k$)EpF8#DXHHJtlyLRXO#Fo?-0LyvNA@|OCCm)zhH`wC>KA87wh!vcK?p7|6YrK zv`l=xzKFoD*8Mv&|3emE&i*<%WYbUo&pm!4|s$6um zz{3dswH7~6ru?e+_>B7nqqNVU#qaXTM(}^=y*}b-nfMJeeZ;0ROzh}zuKU(eMGiBmmpXKAr*?)$Ed;MC<m!zwiC<>%_` zW%yrrm5(TAADMYRep8wJT^3(oCjL2#-&ZF7Ar9j8E7$(IkgZ?d!-)3TbB&L9vP}Cf zzt+buFOxrS@q5a|ulazFSW_ncfW;p#6aU%OkHrso zHY4J$p6qMeg5h) z{P&t;ttu1$!l!)xV`cb1v((4em&rfz79Vf(@DcLOUgqP=>1U6{Kj)K;$iMkEA5qS~ z%)Z^nHGV= zZ!J^)qZU6&%MdO(K2`duDtwt-5w6=dkFf5>CaCJWyHa+p}(;<088$Piw?%45w^ zQ2CdDPY_=3v1T#IRG@y5$C`Pd(#-+!4fV4<*31N%lGImuteFTZ-59W!@W^A$aoT+j z^pMAz*TEB{dl7sAd;xrn_yZnm_JdbIKjX0`5B_)3^?*##>UVjp*#vT*qovbhb_2Mb zbS>ZyNw>yh&2o^tM=i@dW|xBhM!F?nH|gp<*31SE5%+3T~CVY_o^KEb*$W-&P0s5Qr9RR-%J_&vk+zcvyBKQV40sIZ*$at)2!4D|k zGEjW41OF174E`C|jUUN?+d#!{0{=wupyVF|O1{Wr_N7~+=of@PWB8=uR#4@1fs$i0 zI0HF0d8}y!Ro{7_%9#xA1IK_$AAw4L9KQ(G90k8e_+C))dwh8PlNP_t;;TT(H_c=A z_@}+xgP_8XddzMCRsM2N_051kB7Tg=>?y9ZSLAG7dBEqo35FX99K0$gM` z+b{$EE8#;od%52NRj*?nYhDB;M~}ttviNR`-wMtqeiJA?EeD?k7lG14Ehv81d90ZU zN>4*KS$Uu<&tuJtpyD3_Ro^WhvqwMW>pS2vyBAb_wt?RUH-NIQZ8&I!ZvYiu4=Q{U z?OUk?5VxtDp&4l!R)J>K$| zeF0Sc_F4E-7QPw$7s4lll579Rqv-#D-JtBM1^fxPhxv*4Kj|^M85I9b9+`6G`tZ!s_WDd8`Hs&^jzWAGtRGCIUci_E%2E| zUd|qH7xWfT{2l;j!LQ3>%?42ECxK2s;LFfQnVIx12=$gfGyy3_^$C-GY9-v!mGfY;3QD@uOm2b1h>|%?*4pe=I=J@o3pyb(Q^fsff1J#b21PTva z;c=JYW0!k+-(~E56aNr66`V6WiuiWxW!2zh*tdBiXASThs+Ht|PsTF1Zva0>A+d92wFs{Cg>*6af>fPTtj%~nwP z9s*VF7LPS8pvqlf@$*2HJI7zb4%=oWXwZG4OS8GpPPi532ksQ1VQ&_~$P1 z^5jAB+v_pA1yuSj@JVnoC_9dJxB&bfcyy9aH{db51{@~55j;u$!@y)Vys1sQhC< z@sB)aUpgm>ULkxxsQ7)L_&?<_I}KDlCxD1_*}&Nz9|Kk2MIfv$n`7Z)jNUiV>v0RH zbhU;vLD@x>$L#B8`S$1p|2OF-f(OClXL>#AqqWa-=kFQt0O9rEKY>GMc>Z0W!rz+U z?d~b?AE8^oAEA#m9<$RdeE)bK{*1?LJqZ7n#U8UWL6twz!Y5ex-f9FMxPumd(18cm2Y##=iB75rV~`Y4IXQbkG1-G%svN74*ierCEs2P z9|Qg`!iP@x`QP$bvjIeP^(`K2)>!;1i?0PG*L5DV$4>L~>mIYZtg86EMsEgH?k11f zncx8B?iu6ddJI(jqaL#lfJcd642sVpkJ$;}pA-I8+NVF}F}oLhi|_|PRB+ic@SnkY zqo;w#peKWfTtCTU&4dac&bt~qw5uQEvF3OxihfS|*FohQ1j$l=)ML$y;1J=B;QvFo z_Fci6d7$iZj>qgX&iteLeI9GJfr{ViG1~&Z37<6}Mc1$LShE}y-=&82;H#u#Iz)Gh z>KAydnQieiJ=V~tT)v4$chSE0(X<=DyTCPIJGcz|9Jm;~8>|I4fOEhuunKGgCxfkE z21MpFWhd*wV<57hIRO4XcmSLW?zeFLk5YaQx(8ebc7vY*w}M{+yTH4^P2gHk_Vrb8 znT0O_(aD*$;BSI+EW8?A4LuqBJeaZY2yBLy9X<#SfLDSqg6QVN1bz`bHbxhX zqcaCVg}(^?4!9p&1nvXx0M#El!EW$&Q2pUHa0|E@+yvePZUC2ojo|&@5>WM3e^K}X z@OQy#Q0c3{TfvFo7BB*peh8z!1=PI;rGF7r`U4ie5Bx*uJr>>rej55w@GIaJ3-1E4 z)iXDM8^K2KQ{XZSUkv^M^a4=j&av<+Q0XUvN}mC52KB*-d%!_Z@(h3qKVaeeEIbb` zAzb%U#OF~^e70J67x-D|4WPR`-~jk#@BsL6Q2Wmc&x4PEJ>U&sw}o#7AAs%x7lS%a{s_1R%z?|mkAX`pycSe{ zoCAIothVsU;Jwfpa1j`Rb>K1j{U&e#{4n?;xDebA{%0@`)`EM$4}sm_Lm+*dYw@%v zSOdaCAJji{12_>}12Qz8*$7Smmx1HKCEz%axrd5Z2{4>^AH&Y&5JjtTK!Y2dJdW zZ`f_vW!Pv~YglC%84jQvm*244u*}=T%dpX~*09PjG917dTz}=T%dpX~*09PjG8~})yZnaThFyk@hP8%OhLPa_nO%Ov zZo@9aM#EaeD#OTdfd0ed>H7@34Z92*4Qman3;~xfQ}Ik@exk_~chod%gm`__fqaUsL!uQxAO;d|-EK%kEUiS#){?55Es$PiLaj z$v7|l4$(em^0%$gk__z$HYB%glE zE&g7MpNoAfKHM+-w3Qd`^L+)m6d&&IJ!$!$ZglLTPZ<4uqnF|@rN3v5-f8rHqqWXa z{4++MX7qnEdMtWXdEq|Oxug}n@AAm~{uFAElw$b0V`iA=iUo|?M-~WxZe>e~Sf$Up4wW zMqg&>vqoQM^qEH28~wDk$8w`L7`?)1jZ4zsrbbuYXp;1W&L>*``xD8NF7(G+Ouo<` zQ=+laF5~xAEB`$v?+r%3&*=YS?}qZb%`o6&z~<*zXMb4K4~^i-o;jQ%St z{~n|7HhQzs?=kuzqknAjeA(y+jQ)nvUov^VW%T7nf7j^0wetU~(Ho5ZGo#No`uj#d zW#vC-^lGCI8a>(QBS!y?$@5dAKWFrtM(0ePVWV|#T=uC&seVt2A7jv*b)Nnm;H(s9 z7K=Q66#pZ76_a)SUglZ!14e5-;Lbn`&Kj)MoV!_xHvzK8k<1ul9YDKiuDIGku2pdLI)% z>a0x^{Vr8~_zUC5pPGF=MLPYoPbB`28a-V!`NR0}vX$pka~5Lx!~OW1O~2uNgmXzK ze&K%qT+1Kcm-x8Fhx^MX&A!5Y|HAGi92 z`{uu8@`v{q?zHv~??VilJmLL^gC>6$eD#x>RKM_k!PQp(aG&~jt^b7kZGUd@;lBO{ zti8hhc8u+j6XbMHH*toWZkCd!z;qxbR&_JQm?%O7?Zy-8|5mNd3x;mGOOy=UVBrqzZ)W=7P0(|uf z34Fy6OHJ9{_Sr%!B6P9>QG>54qWF)_@XZ;%R4tVnC}b=lO;yr|OBQk!6&=S0W$FVcu_DXJTU6@mB6BN96Ei9> zp`n^vn)z4?LOWY;AafiNl`Iv&iG5h>`Oik4XWl{En;Cstw8U-sE*hssQ5k2tpZ3GEu3W+Hnb(zV;DF*1Ro zh?cdjO)abGA8R|%XnPw)nCjc<9ej(&0)wLbCxHrLxbFtVV*1Yr#j&mrb+)b8c-LLc zF!s%idNKJzs1>)igRcUuP_j@(TB&1Y6AchIG5VxU?rLva?@d#d88sx#bY)AkLX0I0 z?%LS8QeUSkaK(DOLoWo;G9d_ev}RpL=emYfP3@muOSVvN`?!=j)*zy*%3UODkiT;e zE~vT1J-aUIo?PQ6<9+=V;>|m7>{$Cb+*?VgJYFoWC(J1p#WXl0L>R-ECm(!@E26JI z#VU56h>D|%DaXXV@DyiQuTM|Kl>5Gu@3n=%j<%M2nmg7v@#&|SvvdBfYYD;mb~deC zCp9lQL!mcMg&Ih*&bF4O4P=cPoF8jxZe88ECTj3LEKm*M!A!t6P=x1q zqo5y2@Zfy1tf>W67sMVd%vA-M43j*aQ-~T?wQXF{(%ji*q#tJ1GEnL3R$-ut>0nHS z4`3BkId|iRRmn_nT~ph8=KlmWoGc%c6veUDh-T9t`Ghg+@=jp82bt)gLp7z z(KB!S$gTAYmn^LNcpR+xRx)_i>gJAnN&=dT0*v3Pw$7qtZSAY?Zcm0-y4B62hpt~g zN@A%#8H_YI`4J&^m4w{gUL4Y*`CUmG6qyL|!|~Iy!h#=`02{{X>R;fc(^)d z7eCF9pXS9+SH(|P#!qwOCmuT2ZA) zT^&EokDunnPgliHSH@3s<0l?qdR1V$Abz?ge!4n-njb&Si=VEFpRSCb=EhGv!2ZgZ zef)Gy{B(8vG(Uct7e8GUKV2C=&5fUUfc@N Date: Wed, 14 Jan 2026 12:17:41 -0500 Subject: [PATCH 193/473] Move files into a subfolder to stage the merge --- .gitattributes => newlinalg/.gitattributes | 0 .gitignore => newlinalg/.gitignore | 0 CMakeLists.txt => newlinalg/CMakeLists.txt | 0 {src => newlinalg/src}/CMakeLists.txt | 0 {src => newlinalg/src}/newlinalg.c | 0 {src => newlinalg/src}/newlinalg.h | 0 {src => newlinalg/src}/xcomplexmatrix.c | 0 {src => newlinalg/src}/xcomplexmatrix.h | 0 {src => newlinalg/src}/xmatrix.c | 0 {src => newlinalg/src}/xmatrix.h | 0 {test => newlinalg/test}/arithmetic/complexmatrix_acc.morpho | 0 .../test}/arithmetic/complexmatrix_add_complexmatrix.morpho | 0 .../test}/arithmetic/complexmatrix_add_matrix.morpho | 0 {test => newlinalg/test}/arithmetic/complexmatrix_add_nil.morpho | 0 .../test}/arithmetic/complexmatrix_add_scalar.morpho | 0 .../test}/arithmetic/complexmatrix_addr_matrix.morpho | 0 {test => newlinalg/test}/arithmetic/complexmatrix_addr_nil.morpho | 0 .../test}/arithmetic/complexmatrix_div_complexmatrix.morpho | 0 .../test}/arithmetic/complexmatrix_div_matrix.morpho | 0 .../test}/arithmetic/complexmatrix_div_scalar.morpho | 0 .../test}/arithmetic/complexmatrix_divr_matrix.morpho | 0 .../test}/arithmetic/complexmatrix_mul_complex.morpho | 0 .../test}/arithmetic/complexmatrix_mul_complexmatrix.morpho | 0 .../test}/arithmetic/complexmatrix_mul_matrix.morpho | 0 .../test}/arithmetic/complexmatrix_mul_scalar.morpho | 0 .../test}/arithmetic/complexmatrix_mulr_complex.xmorpho | 0 .../test}/arithmetic/complexmatrix_mulr_matrix.morpho | 0 .../test}/arithmetic/complexmatrix_sub_complexmatrix.morpho | 0 .../test}/arithmetic/complexmatrix_sub_matrix.morpho | 0 .../test}/arithmetic/complexmatrix_sub_scalar.morpho | 0 .../test}/arithmetic/complexmatrix_subr_matrix.morpho | 0 .../test}/arithmetic/complexmatrix_subr_scalar.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_acc.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_add_matrix.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_add_nil.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_add_scalar.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_addr_nil.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_addr_scalar.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_div_matrix.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_div_scalar.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_mul_matrix.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_mul_scalar.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_negate.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_sub_matrix.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_sub_scalar.morpho | 0 {test => newlinalg/test}/arithmetic/matrix_subr_scalar.morpho | 0 {test => newlinalg/test}/assign/complexmatrix_assign.morpho | 0 {test => newlinalg/test}/assign/complexmatrix_clone.morpho | 0 {test => newlinalg/test}/assign/matrix_assign.morpho | 0 .../test}/constructors/complexmatrix_array_constructor.morpho | 0 .../complexmatrix_array_constructor_invalid_dimensions.morpho | 0 .../test}/constructors/complexmatrix_constructor.morpho | 0 .../constructors/complexmatrix_constructor_edge_cases.morpho | 0 .../constructors/complexmatrix_constructor_invalid_args.morpho | 0 .../test}/constructors/complexmatrix_list_constructor.morpho | 0 .../constructors/complexmatrix_list_vector_constructor.morpho | 0 .../test}/constructors/complexmatrix_matrix_constructor.morpho | 0 .../constructors/complexmatrix_tuple_column_constructor.morpho | 0 .../test}/constructors/complexmatrix_tuple_constructor.morpho | 0 .../test}/constructors/complexmatrix_vector_constructor.morpho | 0 .../test}/constructors/matrix_array_constructor.morpho | 0 .../matrix_array_constructor_invalid_dimensions.morpho | 0 {test => newlinalg/test}/constructors/matrix_constructor.morpho | 0 .../test}/constructors/matrix_constructor_edge_cases.morpho | 0 .../test}/constructors/matrix_identity_constructor.morpho | 0 .../test}/constructors/matrix_list_constructor.morpho | 0 .../test}/constructors/matrix_list_vector_constructor.morpho | 0 .../test}/constructors/matrix_tuple_constructor.morpho | 0 .../test}/constructors/matrix_vector_constructor.morpho | 0 {test => newlinalg/test}/constructors/vector_constructor.morpho | 0 .../test}/errors/complexmatrix_incompatible_dimensions.morpho | 0 .../test}/errors/complexmatrix_index_out_of_bounds.morpho | 0 .../test}/errors/complexmatrix_non_square_error.morpho | 0 {test => newlinalg/test}/index/complexmatrix_getcolumn.morpho | 0 {test => newlinalg/test}/index/complexmatrix_getindex.morpho | 0 {test => newlinalg/test}/index/complexmatrix_setcolumn.morpho | 0 {test => newlinalg/test}/index/complexmatrix_setindex.morpho | 0 {test => newlinalg/test}/index/complexmatrix_setindex_real.morpho | 0 {test => newlinalg/test}/index/complexmatrix_setslice.morpho | 0 {test => newlinalg/test}/index/complexmatrix_slice.morpho | 0 {test => newlinalg/test}/index/matrix_getcolumn.morpho | 0 {test => newlinalg/test}/index/matrix_getindex.morpho | 0 {test => newlinalg/test}/index/matrix_setcolumn.morpho | 0 {test => newlinalg/test}/index/matrix_setindex.morpho | 0 {test => newlinalg/test}/index/matrix_setslice.morpho | 0 {test => newlinalg/test}/index/matrix_slice.morpho | 0 {test => newlinalg/test}/index/matrix_slice_bounds.morpho | 0 {test => newlinalg/test}/index/matrix_slice_infinite_range.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_conj.morpho | 0 .../test}/methods/complexmatrix_conjTranspose.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_count.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_dimensions.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_eigensystem.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_eigenvalues.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_enumerate.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_format.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_imag.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_inner.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_inverse.morpho | 0 .../test}/methods/complexmatrix_inverse_singular.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_norm.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_outer.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_qr.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_real.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_reshape.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_roll.morpho | 0 .../test}/methods/complexmatrix_roll_negative.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_sum.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_svd.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_trace.morpho | 0 {test => newlinalg/test}/methods/complexmatrix_transpose.morpho | 0 {test => newlinalg/test}/methods/matrix_count.morpho | 0 {test => newlinalg/test}/methods/matrix_dimensions.morpho | 0 {test => newlinalg/test}/methods/matrix_eigensystem.morpho | 0 {test => newlinalg/test}/methods/matrix_eigenvalues.morpho | 0 {test => newlinalg/test}/methods/matrix_enumerate.morpho | 0 {test => newlinalg/test}/methods/matrix_format.morpho | 0 {test => newlinalg/test}/methods/matrix_inner.morpho | 0 {test => newlinalg/test}/methods/matrix_inverse.morpho | 0 {test => newlinalg/test}/methods/matrix_inverse_singular.morpho | 0 {test => newlinalg/test}/methods/matrix_norm.morpho | 0 {test => newlinalg/test}/methods/matrix_outer.morpho | 0 {test => newlinalg/test}/methods/matrix_qr.morpho | 0 {test => newlinalg/test}/methods/matrix_reshape.morpho | 0 {test => newlinalg/test}/methods/matrix_roll.morpho | 0 {test => newlinalg/test}/methods/matrix_sum.morpho | 0 {test => newlinalg/test}/methods/matrix_svd.morpho | 0 {test => newlinalg/test}/methods/matrix_trace.morpho | 0 {test => newlinalg/test}/methods/matrix_transpose.morpho | 0 {test => newlinalg/test}/test.py | 0 130 files changed, 0 insertions(+), 0 deletions(-) rename .gitattributes => newlinalg/.gitattributes (100%) rename .gitignore => newlinalg/.gitignore (100%) rename CMakeLists.txt => newlinalg/CMakeLists.txt (100%) rename {src => newlinalg/src}/CMakeLists.txt (100%) rename {src => newlinalg/src}/newlinalg.c (100%) rename {src => newlinalg/src}/newlinalg.h (100%) rename {src => newlinalg/src}/xcomplexmatrix.c (100%) rename {src => newlinalg/src}/xcomplexmatrix.h (100%) rename {src => newlinalg/src}/xmatrix.c (100%) rename {src => newlinalg/src}/xmatrix.h (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_acc.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_add_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_addr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_addr_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_div_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_div_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_div_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_divr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_complex.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mul_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mulr_complex.xmorpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_mulr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_sub_complexmatrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_sub_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_sub_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_subr_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/complexmatrix_subr_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_acc.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_add_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_add_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_add_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_addr_nil.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_addr_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_div_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_div_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_mul_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_mul_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_negate.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_sub_matrix.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_sub_scalar.morpho (100%) rename {test => newlinalg/test}/arithmetic/matrix_subr_scalar.morpho (100%) rename {test => newlinalg/test}/assign/complexmatrix_assign.morpho (100%) rename {test => newlinalg/test}/assign/complexmatrix_clone.morpho (100%) rename {test => newlinalg/test}/assign/matrix_assign.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_array_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_constructor_edge_cases.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_constructor_invalid_args.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_list_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_list_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_matrix_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_tuple_column_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_tuple_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/complexmatrix_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_array_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_array_constructor_invalid_dimensions.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_constructor_edge_cases.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_identity_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_list_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_list_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_tuple_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/matrix_vector_constructor.morpho (100%) rename {test => newlinalg/test}/constructors/vector_constructor.morpho (100%) rename {test => newlinalg/test}/errors/complexmatrix_incompatible_dimensions.morpho (100%) rename {test => newlinalg/test}/errors/complexmatrix_index_out_of_bounds.morpho (100%) rename {test => newlinalg/test}/errors/complexmatrix_non_square_error.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_getcolumn.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_getindex.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setcolumn.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setindex.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setindex_real.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_setslice.morpho (100%) rename {test => newlinalg/test}/index/complexmatrix_slice.morpho (100%) rename {test => newlinalg/test}/index/matrix_getcolumn.morpho (100%) rename {test => newlinalg/test}/index/matrix_getindex.morpho (100%) rename {test => newlinalg/test}/index/matrix_setcolumn.morpho (100%) rename {test => newlinalg/test}/index/matrix_setindex.morpho (100%) rename {test => newlinalg/test}/index/matrix_setslice.morpho (100%) rename {test => newlinalg/test}/index/matrix_slice.morpho (100%) rename {test => newlinalg/test}/index/matrix_slice_bounds.morpho (100%) rename {test => newlinalg/test}/index/matrix_slice_infinite_range.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_conj.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_conjTranspose.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_count.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_dimensions.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_eigensystem.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_eigenvalues.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_enumerate.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_format.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_imag.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_inner.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_inverse.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_inverse_singular.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_norm.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_outer.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_qr.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_real.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_reshape.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_roll.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_roll_negative.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_sum.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_svd.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_trace.morpho (100%) rename {test => newlinalg/test}/methods/complexmatrix_transpose.morpho (100%) rename {test => newlinalg/test}/methods/matrix_count.morpho (100%) rename {test => newlinalg/test}/methods/matrix_dimensions.morpho (100%) rename {test => newlinalg/test}/methods/matrix_eigensystem.morpho (100%) rename {test => newlinalg/test}/methods/matrix_eigenvalues.morpho (100%) rename {test => newlinalg/test}/methods/matrix_enumerate.morpho (100%) rename {test => newlinalg/test}/methods/matrix_format.morpho (100%) rename {test => newlinalg/test}/methods/matrix_inner.morpho (100%) rename {test => newlinalg/test}/methods/matrix_inverse.morpho (100%) rename {test => newlinalg/test}/methods/matrix_inverse_singular.morpho (100%) rename {test => newlinalg/test}/methods/matrix_norm.morpho (100%) rename {test => newlinalg/test}/methods/matrix_outer.morpho (100%) rename {test => newlinalg/test}/methods/matrix_qr.morpho (100%) rename {test => newlinalg/test}/methods/matrix_reshape.morpho (100%) rename {test => newlinalg/test}/methods/matrix_roll.morpho (100%) rename {test => newlinalg/test}/methods/matrix_sum.morpho (100%) rename {test => newlinalg/test}/methods/matrix_svd.morpho (100%) rename {test => newlinalg/test}/methods/matrix_trace.morpho (100%) rename {test => newlinalg/test}/methods/matrix_transpose.morpho (100%) rename {test => newlinalg/test}/test.py (100%) diff --git a/.gitattributes b/newlinalg/.gitattributes similarity index 100% rename from .gitattributes rename to newlinalg/.gitattributes diff --git a/.gitignore b/newlinalg/.gitignore similarity index 100% rename from .gitignore rename to newlinalg/.gitignore diff --git a/CMakeLists.txt b/newlinalg/CMakeLists.txt similarity index 100% rename from CMakeLists.txt rename to newlinalg/CMakeLists.txt diff --git a/src/CMakeLists.txt b/newlinalg/src/CMakeLists.txt similarity index 100% rename from src/CMakeLists.txt rename to newlinalg/src/CMakeLists.txt diff --git a/src/newlinalg.c b/newlinalg/src/newlinalg.c similarity index 100% rename from src/newlinalg.c rename to newlinalg/src/newlinalg.c diff --git a/src/newlinalg.h b/newlinalg/src/newlinalg.h similarity index 100% rename from src/newlinalg.h rename to newlinalg/src/newlinalg.h diff --git a/src/xcomplexmatrix.c b/newlinalg/src/xcomplexmatrix.c similarity index 100% rename from src/xcomplexmatrix.c rename to newlinalg/src/xcomplexmatrix.c diff --git a/src/xcomplexmatrix.h b/newlinalg/src/xcomplexmatrix.h similarity index 100% rename from src/xcomplexmatrix.h rename to newlinalg/src/xcomplexmatrix.h diff --git a/src/xmatrix.c b/newlinalg/src/xmatrix.c similarity index 100% rename from src/xmatrix.c rename to newlinalg/src/xmatrix.c diff --git a/src/xmatrix.h b/newlinalg/src/xmatrix.h similarity index 100% rename from src/xmatrix.h rename to newlinalg/src/xmatrix.h diff --git a/test/arithmetic/complexmatrix_acc.morpho b/newlinalg/test/arithmetic/complexmatrix_acc.morpho similarity index 100% rename from test/arithmetic/complexmatrix_acc.morpho rename to newlinalg/test/arithmetic/complexmatrix_acc.morpho diff --git a/test/arithmetic/complexmatrix_add_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_add_complexmatrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_add_complexmatrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_add_complexmatrix.morpho diff --git a/test/arithmetic/complexmatrix_add_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_add_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho diff --git a/test/arithmetic/complexmatrix_add_nil.morpho b/newlinalg/test/arithmetic/complexmatrix_add_nil.morpho similarity index 100% rename from test/arithmetic/complexmatrix_add_nil.morpho rename to newlinalg/test/arithmetic/complexmatrix_add_nil.morpho diff --git a/test/arithmetic/complexmatrix_add_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_add_scalar.morpho similarity index 100% rename from test/arithmetic/complexmatrix_add_scalar.morpho rename to newlinalg/test/arithmetic/complexmatrix_add_scalar.morpho diff --git a/test/arithmetic/complexmatrix_addr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_addr_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho diff --git a/test/arithmetic/complexmatrix_addr_nil.morpho b/newlinalg/test/arithmetic/complexmatrix_addr_nil.morpho similarity index 100% rename from test/arithmetic/complexmatrix_addr_nil.morpho rename to newlinalg/test/arithmetic/complexmatrix_addr_nil.morpho diff --git a/test/arithmetic/complexmatrix_div_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_div_complexmatrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_div_complexmatrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_div_complexmatrix.morpho diff --git a/test/arithmetic/complexmatrix_div_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_div_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho diff --git a/test/arithmetic/complexmatrix_div_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_div_scalar.morpho similarity index 100% rename from test/arithmetic/complexmatrix_div_scalar.morpho rename to newlinalg/test/arithmetic/complexmatrix_div_scalar.morpho diff --git a/test/arithmetic/complexmatrix_divr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_divr_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho diff --git a/test/arithmetic/complexmatrix_mul_complex.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_complex.morpho similarity index 100% rename from test/arithmetic/complexmatrix_mul_complex.morpho rename to newlinalg/test/arithmetic/complexmatrix_mul_complex.morpho diff --git a/test/arithmetic/complexmatrix_mul_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_complexmatrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_mul_complexmatrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_mul_complexmatrix.morpho diff --git a/test/arithmetic/complexmatrix_mul_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_mul_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho diff --git a/test/arithmetic/complexmatrix_mul_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_scalar.morpho similarity index 100% rename from test/arithmetic/complexmatrix_mul_scalar.morpho rename to newlinalg/test/arithmetic/complexmatrix_mul_scalar.morpho diff --git a/test/arithmetic/complexmatrix_mulr_complex.xmorpho b/newlinalg/test/arithmetic/complexmatrix_mulr_complex.xmorpho similarity index 100% rename from test/arithmetic/complexmatrix_mulr_complex.xmorpho rename to newlinalg/test/arithmetic/complexmatrix_mulr_complex.xmorpho diff --git a/test/arithmetic/complexmatrix_mulr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_mulr_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho diff --git a/test/arithmetic/complexmatrix_sub_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_complexmatrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_sub_complexmatrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_sub_complexmatrix.morpho diff --git a/test/arithmetic/complexmatrix_sub_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_sub_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho diff --git a/test/arithmetic/complexmatrix_sub_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_scalar.morpho similarity index 100% rename from test/arithmetic/complexmatrix_sub_scalar.morpho rename to newlinalg/test/arithmetic/complexmatrix_sub_scalar.morpho diff --git a/test/arithmetic/complexmatrix_subr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho similarity index 100% rename from test/arithmetic/complexmatrix_subr_matrix.morpho rename to newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho diff --git a/test/arithmetic/complexmatrix_subr_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_subr_scalar.morpho similarity index 100% rename from test/arithmetic/complexmatrix_subr_scalar.morpho rename to newlinalg/test/arithmetic/complexmatrix_subr_scalar.morpho diff --git a/test/arithmetic/matrix_acc.morpho b/newlinalg/test/arithmetic/matrix_acc.morpho similarity index 100% rename from test/arithmetic/matrix_acc.morpho rename to newlinalg/test/arithmetic/matrix_acc.morpho diff --git a/test/arithmetic/matrix_add_matrix.morpho b/newlinalg/test/arithmetic/matrix_add_matrix.morpho similarity index 100% rename from test/arithmetic/matrix_add_matrix.morpho rename to newlinalg/test/arithmetic/matrix_add_matrix.morpho diff --git a/test/arithmetic/matrix_add_nil.morpho b/newlinalg/test/arithmetic/matrix_add_nil.morpho similarity index 100% rename from test/arithmetic/matrix_add_nil.morpho rename to newlinalg/test/arithmetic/matrix_add_nil.morpho diff --git a/test/arithmetic/matrix_add_scalar.morpho b/newlinalg/test/arithmetic/matrix_add_scalar.morpho similarity index 100% rename from test/arithmetic/matrix_add_scalar.morpho rename to newlinalg/test/arithmetic/matrix_add_scalar.morpho diff --git a/test/arithmetic/matrix_addr_nil.morpho b/newlinalg/test/arithmetic/matrix_addr_nil.morpho similarity index 100% rename from test/arithmetic/matrix_addr_nil.morpho rename to newlinalg/test/arithmetic/matrix_addr_nil.morpho diff --git a/test/arithmetic/matrix_addr_scalar.morpho b/newlinalg/test/arithmetic/matrix_addr_scalar.morpho similarity index 100% rename from test/arithmetic/matrix_addr_scalar.morpho rename to newlinalg/test/arithmetic/matrix_addr_scalar.morpho diff --git a/test/arithmetic/matrix_div_matrix.morpho b/newlinalg/test/arithmetic/matrix_div_matrix.morpho similarity index 100% rename from test/arithmetic/matrix_div_matrix.morpho rename to newlinalg/test/arithmetic/matrix_div_matrix.morpho diff --git a/test/arithmetic/matrix_div_scalar.morpho b/newlinalg/test/arithmetic/matrix_div_scalar.morpho similarity index 100% rename from test/arithmetic/matrix_div_scalar.morpho rename to newlinalg/test/arithmetic/matrix_div_scalar.morpho diff --git a/test/arithmetic/matrix_mul_matrix.morpho b/newlinalg/test/arithmetic/matrix_mul_matrix.morpho similarity index 100% rename from test/arithmetic/matrix_mul_matrix.morpho rename to newlinalg/test/arithmetic/matrix_mul_matrix.morpho diff --git a/test/arithmetic/matrix_mul_scalar.morpho b/newlinalg/test/arithmetic/matrix_mul_scalar.morpho similarity index 100% rename from test/arithmetic/matrix_mul_scalar.morpho rename to newlinalg/test/arithmetic/matrix_mul_scalar.morpho diff --git a/test/arithmetic/matrix_negate.morpho b/newlinalg/test/arithmetic/matrix_negate.morpho similarity index 100% rename from test/arithmetic/matrix_negate.morpho rename to newlinalg/test/arithmetic/matrix_negate.morpho diff --git a/test/arithmetic/matrix_sub_matrix.morpho b/newlinalg/test/arithmetic/matrix_sub_matrix.morpho similarity index 100% rename from test/arithmetic/matrix_sub_matrix.morpho rename to newlinalg/test/arithmetic/matrix_sub_matrix.morpho diff --git a/test/arithmetic/matrix_sub_scalar.morpho b/newlinalg/test/arithmetic/matrix_sub_scalar.morpho similarity index 100% rename from test/arithmetic/matrix_sub_scalar.morpho rename to newlinalg/test/arithmetic/matrix_sub_scalar.morpho diff --git a/test/arithmetic/matrix_subr_scalar.morpho b/newlinalg/test/arithmetic/matrix_subr_scalar.morpho similarity index 100% rename from test/arithmetic/matrix_subr_scalar.morpho rename to newlinalg/test/arithmetic/matrix_subr_scalar.morpho diff --git a/test/assign/complexmatrix_assign.morpho b/newlinalg/test/assign/complexmatrix_assign.morpho similarity index 100% rename from test/assign/complexmatrix_assign.morpho rename to newlinalg/test/assign/complexmatrix_assign.morpho diff --git a/test/assign/complexmatrix_clone.morpho b/newlinalg/test/assign/complexmatrix_clone.morpho similarity index 100% rename from test/assign/complexmatrix_clone.morpho rename to newlinalg/test/assign/complexmatrix_clone.morpho diff --git a/test/assign/matrix_assign.morpho b/newlinalg/test/assign/matrix_assign.morpho similarity index 100% rename from test/assign/matrix_assign.morpho rename to newlinalg/test/assign/matrix_assign.morpho diff --git a/test/constructors/complexmatrix_array_constructor.morpho b/newlinalg/test/constructors/complexmatrix_array_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_array_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_array_constructor.morpho diff --git a/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho b/newlinalg/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho similarity index 100% rename from test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho rename to newlinalg/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho diff --git a/test/constructors/complexmatrix_constructor.morpho b/newlinalg/test/constructors/complexmatrix_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_constructor.morpho diff --git a/test/constructors/complexmatrix_constructor_edge_cases.morpho b/newlinalg/test/constructors/complexmatrix_constructor_edge_cases.morpho similarity index 100% rename from test/constructors/complexmatrix_constructor_edge_cases.morpho rename to newlinalg/test/constructors/complexmatrix_constructor_edge_cases.morpho diff --git a/test/constructors/complexmatrix_constructor_invalid_args.morpho b/newlinalg/test/constructors/complexmatrix_constructor_invalid_args.morpho similarity index 100% rename from test/constructors/complexmatrix_constructor_invalid_args.morpho rename to newlinalg/test/constructors/complexmatrix_constructor_invalid_args.morpho diff --git a/test/constructors/complexmatrix_list_constructor.morpho b/newlinalg/test/constructors/complexmatrix_list_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_list_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_list_constructor.morpho diff --git a/test/constructors/complexmatrix_list_vector_constructor.morpho b/newlinalg/test/constructors/complexmatrix_list_vector_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_list_vector_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_list_vector_constructor.morpho diff --git a/test/constructors/complexmatrix_matrix_constructor.morpho b/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_matrix_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho diff --git a/test/constructors/complexmatrix_tuple_column_constructor.morpho b/newlinalg/test/constructors/complexmatrix_tuple_column_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_tuple_column_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_tuple_column_constructor.morpho diff --git a/test/constructors/complexmatrix_tuple_constructor.morpho b/newlinalg/test/constructors/complexmatrix_tuple_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_tuple_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_tuple_constructor.morpho diff --git a/test/constructors/complexmatrix_vector_constructor.morpho b/newlinalg/test/constructors/complexmatrix_vector_constructor.morpho similarity index 100% rename from test/constructors/complexmatrix_vector_constructor.morpho rename to newlinalg/test/constructors/complexmatrix_vector_constructor.morpho diff --git a/test/constructors/matrix_array_constructor.morpho b/newlinalg/test/constructors/matrix_array_constructor.morpho similarity index 100% rename from test/constructors/matrix_array_constructor.morpho rename to newlinalg/test/constructors/matrix_array_constructor.morpho diff --git a/test/constructors/matrix_array_constructor_invalid_dimensions.morpho b/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho similarity index 100% rename from test/constructors/matrix_array_constructor_invalid_dimensions.morpho rename to newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho diff --git a/test/constructors/matrix_constructor.morpho b/newlinalg/test/constructors/matrix_constructor.morpho similarity index 100% rename from test/constructors/matrix_constructor.morpho rename to newlinalg/test/constructors/matrix_constructor.morpho diff --git a/test/constructors/matrix_constructor_edge_cases.morpho b/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho similarity index 100% rename from test/constructors/matrix_constructor_edge_cases.morpho rename to newlinalg/test/constructors/matrix_constructor_edge_cases.morpho diff --git a/test/constructors/matrix_identity_constructor.morpho b/newlinalg/test/constructors/matrix_identity_constructor.morpho similarity index 100% rename from test/constructors/matrix_identity_constructor.morpho rename to newlinalg/test/constructors/matrix_identity_constructor.morpho diff --git a/test/constructors/matrix_list_constructor.morpho b/newlinalg/test/constructors/matrix_list_constructor.morpho similarity index 100% rename from test/constructors/matrix_list_constructor.morpho rename to newlinalg/test/constructors/matrix_list_constructor.morpho diff --git a/test/constructors/matrix_list_vector_constructor.morpho b/newlinalg/test/constructors/matrix_list_vector_constructor.morpho similarity index 100% rename from test/constructors/matrix_list_vector_constructor.morpho rename to newlinalg/test/constructors/matrix_list_vector_constructor.morpho diff --git a/test/constructors/matrix_tuple_constructor.morpho b/newlinalg/test/constructors/matrix_tuple_constructor.morpho similarity index 100% rename from test/constructors/matrix_tuple_constructor.morpho rename to newlinalg/test/constructors/matrix_tuple_constructor.morpho diff --git a/test/constructors/matrix_vector_constructor.morpho b/newlinalg/test/constructors/matrix_vector_constructor.morpho similarity index 100% rename from test/constructors/matrix_vector_constructor.morpho rename to newlinalg/test/constructors/matrix_vector_constructor.morpho diff --git a/test/constructors/vector_constructor.morpho b/newlinalg/test/constructors/vector_constructor.morpho similarity index 100% rename from test/constructors/vector_constructor.morpho rename to newlinalg/test/constructors/vector_constructor.morpho diff --git a/test/errors/complexmatrix_incompatible_dimensions.morpho b/newlinalg/test/errors/complexmatrix_incompatible_dimensions.morpho similarity index 100% rename from test/errors/complexmatrix_incompatible_dimensions.morpho rename to newlinalg/test/errors/complexmatrix_incompatible_dimensions.morpho diff --git a/test/errors/complexmatrix_index_out_of_bounds.morpho b/newlinalg/test/errors/complexmatrix_index_out_of_bounds.morpho similarity index 100% rename from test/errors/complexmatrix_index_out_of_bounds.morpho rename to newlinalg/test/errors/complexmatrix_index_out_of_bounds.morpho diff --git a/test/errors/complexmatrix_non_square_error.morpho b/newlinalg/test/errors/complexmatrix_non_square_error.morpho similarity index 100% rename from test/errors/complexmatrix_non_square_error.morpho rename to newlinalg/test/errors/complexmatrix_non_square_error.morpho diff --git a/test/index/complexmatrix_getcolumn.morpho b/newlinalg/test/index/complexmatrix_getcolumn.morpho similarity index 100% rename from test/index/complexmatrix_getcolumn.morpho rename to newlinalg/test/index/complexmatrix_getcolumn.morpho diff --git a/test/index/complexmatrix_getindex.morpho b/newlinalg/test/index/complexmatrix_getindex.morpho similarity index 100% rename from test/index/complexmatrix_getindex.morpho rename to newlinalg/test/index/complexmatrix_getindex.morpho diff --git a/test/index/complexmatrix_setcolumn.morpho b/newlinalg/test/index/complexmatrix_setcolumn.morpho similarity index 100% rename from test/index/complexmatrix_setcolumn.morpho rename to newlinalg/test/index/complexmatrix_setcolumn.morpho diff --git a/test/index/complexmatrix_setindex.morpho b/newlinalg/test/index/complexmatrix_setindex.morpho similarity index 100% rename from test/index/complexmatrix_setindex.morpho rename to newlinalg/test/index/complexmatrix_setindex.morpho diff --git a/test/index/complexmatrix_setindex_real.morpho b/newlinalg/test/index/complexmatrix_setindex_real.morpho similarity index 100% rename from test/index/complexmatrix_setindex_real.morpho rename to newlinalg/test/index/complexmatrix_setindex_real.morpho diff --git a/test/index/complexmatrix_setslice.morpho b/newlinalg/test/index/complexmatrix_setslice.morpho similarity index 100% rename from test/index/complexmatrix_setslice.morpho rename to newlinalg/test/index/complexmatrix_setslice.morpho diff --git a/test/index/complexmatrix_slice.morpho b/newlinalg/test/index/complexmatrix_slice.morpho similarity index 100% rename from test/index/complexmatrix_slice.morpho rename to newlinalg/test/index/complexmatrix_slice.morpho diff --git a/test/index/matrix_getcolumn.morpho b/newlinalg/test/index/matrix_getcolumn.morpho similarity index 100% rename from test/index/matrix_getcolumn.morpho rename to newlinalg/test/index/matrix_getcolumn.morpho diff --git a/test/index/matrix_getindex.morpho b/newlinalg/test/index/matrix_getindex.morpho similarity index 100% rename from test/index/matrix_getindex.morpho rename to newlinalg/test/index/matrix_getindex.morpho diff --git a/test/index/matrix_setcolumn.morpho b/newlinalg/test/index/matrix_setcolumn.morpho similarity index 100% rename from test/index/matrix_setcolumn.morpho rename to newlinalg/test/index/matrix_setcolumn.morpho diff --git a/test/index/matrix_setindex.morpho b/newlinalg/test/index/matrix_setindex.morpho similarity index 100% rename from test/index/matrix_setindex.morpho rename to newlinalg/test/index/matrix_setindex.morpho diff --git a/test/index/matrix_setslice.morpho b/newlinalg/test/index/matrix_setslice.morpho similarity index 100% rename from test/index/matrix_setslice.morpho rename to newlinalg/test/index/matrix_setslice.morpho diff --git a/test/index/matrix_slice.morpho b/newlinalg/test/index/matrix_slice.morpho similarity index 100% rename from test/index/matrix_slice.morpho rename to newlinalg/test/index/matrix_slice.morpho diff --git a/test/index/matrix_slice_bounds.morpho b/newlinalg/test/index/matrix_slice_bounds.morpho similarity index 100% rename from test/index/matrix_slice_bounds.morpho rename to newlinalg/test/index/matrix_slice_bounds.morpho diff --git a/test/index/matrix_slice_infinite_range.morpho b/newlinalg/test/index/matrix_slice_infinite_range.morpho similarity index 100% rename from test/index/matrix_slice_infinite_range.morpho rename to newlinalg/test/index/matrix_slice_infinite_range.morpho diff --git a/test/methods/complexmatrix_conj.morpho b/newlinalg/test/methods/complexmatrix_conj.morpho similarity index 100% rename from test/methods/complexmatrix_conj.morpho rename to newlinalg/test/methods/complexmatrix_conj.morpho diff --git a/test/methods/complexmatrix_conjTranspose.morpho b/newlinalg/test/methods/complexmatrix_conjTranspose.morpho similarity index 100% rename from test/methods/complexmatrix_conjTranspose.morpho rename to newlinalg/test/methods/complexmatrix_conjTranspose.morpho diff --git a/test/methods/complexmatrix_count.morpho b/newlinalg/test/methods/complexmatrix_count.morpho similarity index 100% rename from test/methods/complexmatrix_count.morpho rename to newlinalg/test/methods/complexmatrix_count.morpho diff --git a/test/methods/complexmatrix_dimensions.morpho b/newlinalg/test/methods/complexmatrix_dimensions.morpho similarity index 100% rename from test/methods/complexmatrix_dimensions.morpho rename to newlinalg/test/methods/complexmatrix_dimensions.morpho diff --git a/test/methods/complexmatrix_eigensystem.morpho b/newlinalg/test/methods/complexmatrix_eigensystem.morpho similarity index 100% rename from test/methods/complexmatrix_eigensystem.morpho rename to newlinalg/test/methods/complexmatrix_eigensystem.morpho diff --git a/test/methods/complexmatrix_eigenvalues.morpho b/newlinalg/test/methods/complexmatrix_eigenvalues.morpho similarity index 100% rename from test/methods/complexmatrix_eigenvalues.morpho rename to newlinalg/test/methods/complexmatrix_eigenvalues.morpho diff --git a/test/methods/complexmatrix_enumerate.morpho b/newlinalg/test/methods/complexmatrix_enumerate.morpho similarity index 100% rename from test/methods/complexmatrix_enumerate.morpho rename to newlinalg/test/methods/complexmatrix_enumerate.morpho diff --git a/test/methods/complexmatrix_format.morpho b/newlinalg/test/methods/complexmatrix_format.morpho similarity index 100% rename from test/methods/complexmatrix_format.morpho rename to newlinalg/test/methods/complexmatrix_format.morpho diff --git a/test/methods/complexmatrix_imag.morpho b/newlinalg/test/methods/complexmatrix_imag.morpho similarity index 100% rename from test/methods/complexmatrix_imag.morpho rename to newlinalg/test/methods/complexmatrix_imag.morpho diff --git a/test/methods/complexmatrix_inner.morpho b/newlinalg/test/methods/complexmatrix_inner.morpho similarity index 100% rename from test/methods/complexmatrix_inner.morpho rename to newlinalg/test/methods/complexmatrix_inner.morpho diff --git a/test/methods/complexmatrix_inverse.morpho b/newlinalg/test/methods/complexmatrix_inverse.morpho similarity index 100% rename from test/methods/complexmatrix_inverse.morpho rename to newlinalg/test/methods/complexmatrix_inverse.morpho diff --git a/test/methods/complexmatrix_inverse_singular.morpho b/newlinalg/test/methods/complexmatrix_inverse_singular.morpho similarity index 100% rename from test/methods/complexmatrix_inverse_singular.morpho rename to newlinalg/test/methods/complexmatrix_inverse_singular.morpho diff --git a/test/methods/complexmatrix_norm.morpho b/newlinalg/test/methods/complexmatrix_norm.morpho similarity index 100% rename from test/methods/complexmatrix_norm.morpho rename to newlinalg/test/methods/complexmatrix_norm.morpho diff --git a/test/methods/complexmatrix_outer.morpho b/newlinalg/test/methods/complexmatrix_outer.morpho similarity index 100% rename from test/methods/complexmatrix_outer.morpho rename to newlinalg/test/methods/complexmatrix_outer.morpho diff --git a/test/methods/complexmatrix_qr.morpho b/newlinalg/test/methods/complexmatrix_qr.morpho similarity index 100% rename from test/methods/complexmatrix_qr.morpho rename to newlinalg/test/methods/complexmatrix_qr.morpho diff --git a/test/methods/complexmatrix_real.morpho b/newlinalg/test/methods/complexmatrix_real.morpho similarity index 100% rename from test/methods/complexmatrix_real.morpho rename to newlinalg/test/methods/complexmatrix_real.morpho diff --git a/test/methods/complexmatrix_reshape.morpho b/newlinalg/test/methods/complexmatrix_reshape.morpho similarity index 100% rename from test/methods/complexmatrix_reshape.morpho rename to newlinalg/test/methods/complexmatrix_reshape.morpho diff --git a/test/methods/complexmatrix_roll.morpho b/newlinalg/test/methods/complexmatrix_roll.morpho similarity index 100% rename from test/methods/complexmatrix_roll.morpho rename to newlinalg/test/methods/complexmatrix_roll.morpho diff --git a/test/methods/complexmatrix_roll_negative.morpho b/newlinalg/test/methods/complexmatrix_roll_negative.morpho similarity index 100% rename from test/methods/complexmatrix_roll_negative.morpho rename to newlinalg/test/methods/complexmatrix_roll_negative.morpho diff --git a/test/methods/complexmatrix_sum.morpho b/newlinalg/test/methods/complexmatrix_sum.morpho similarity index 100% rename from test/methods/complexmatrix_sum.morpho rename to newlinalg/test/methods/complexmatrix_sum.morpho diff --git a/test/methods/complexmatrix_svd.morpho b/newlinalg/test/methods/complexmatrix_svd.morpho similarity index 100% rename from test/methods/complexmatrix_svd.morpho rename to newlinalg/test/methods/complexmatrix_svd.morpho diff --git a/test/methods/complexmatrix_trace.morpho b/newlinalg/test/methods/complexmatrix_trace.morpho similarity index 100% rename from test/methods/complexmatrix_trace.morpho rename to newlinalg/test/methods/complexmatrix_trace.morpho diff --git a/test/methods/complexmatrix_transpose.morpho b/newlinalg/test/methods/complexmatrix_transpose.morpho similarity index 100% rename from test/methods/complexmatrix_transpose.morpho rename to newlinalg/test/methods/complexmatrix_transpose.morpho diff --git a/test/methods/matrix_count.morpho b/newlinalg/test/methods/matrix_count.morpho similarity index 100% rename from test/methods/matrix_count.morpho rename to newlinalg/test/methods/matrix_count.morpho diff --git a/test/methods/matrix_dimensions.morpho b/newlinalg/test/methods/matrix_dimensions.morpho similarity index 100% rename from test/methods/matrix_dimensions.morpho rename to newlinalg/test/methods/matrix_dimensions.morpho diff --git a/test/methods/matrix_eigensystem.morpho b/newlinalg/test/methods/matrix_eigensystem.morpho similarity index 100% rename from test/methods/matrix_eigensystem.morpho rename to newlinalg/test/methods/matrix_eigensystem.morpho diff --git a/test/methods/matrix_eigenvalues.morpho b/newlinalg/test/methods/matrix_eigenvalues.morpho similarity index 100% rename from test/methods/matrix_eigenvalues.morpho rename to newlinalg/test/methods/matrix_eigenvalues.morpho diff --git a/test/methods/matrix_enumerate.morpho b/newlinalg/test/methods/matrix_enumerate.morpho similarity index 100% rename from test/methods/matrix_enumerate.morpho rename to newlinalg/test/methods/matrix_enumerate.morpho diff --git a/test/methods/matrix_format.morpho b/newlinalg/test/methods/matrix_format.morpho similarity index 100% rename from test/methods/matrix_format.morpho rename to newlinalg/test/methods/matrix_format.morpho diff --git a/test/methods/matrix_inner.morpho b/newlinalg/test/methods/matrix_inner.morpho similarity index 100% rename from test/methods/matrix_inner.morpho rename to newlinalg/test/methods/matrix_inner.morpho diff --git a/test/methods/matrix_inverse.morpho b/newlinalg/test/methods/matrix_inverse.morpho similarity index 100% rename from test/methods/matrix_inverse.morpho rename to newlinalg/test/methods/matrix_inverse.morpho diff --git a/test/methods/matrix_inverse_singular.morpho b/newlinalg/test/methods/matrix_inverse_singular.morpho similarity index 100% rename from test/methods/matrix_inverse_singular.morpho rename to newlinalg/test/methods/matrix_inverse_singular.morpho diff --git a/test/methods/matrix_norm.morpho b/newlinalg/test/methods/matrix_norm.morpho similarity index 100% rename from test/methods/matrix_norm.morpho rename to newlinalg/test/methods/matrix_norm.morpho diff --git a/test/methods/matrix_outer.morpho b/newlinalg/test/methods/matrix_outer.morpho similarity index 100% rename from test/methods/matrix_outer.morpho rename to newlinalg/test/methods/matrix_outer.morpho diff --git a/test/methods/matrix_qr.morpho b/newlinalg/test/methods/matrix_qr.morpho similarity index 100% rename from test/methods/matrix_qr.morpho rename to newlinalg/test/methods/matrix_qr.morpho diff --git a/test/methods/matrix_reshape.morpho b/newlinalg/test/methods/matrix_reshape.morpho similarity index 100% rename from test/methods/matrix_reshape.morpho rename to newlinalg/test/methods/matrix_reshape.morpho diff --git a/test/methods/matrix_roll.morpho b/newlinalg/test/methods/matrix_roll.morpho similarity index 100% rename from test/methods/matrix_roll.morpho rename to newlinalg/test/methods/matrix_roll.morpho diff --git a/test/methods/matrix_sum.morpho b/newlinalg/test/methods/matrix_sum.morpho similarity index 100% rename from test/methods/matrix_sum.morpho rename to newlinalg/test/methods/matrix_sum.morpho diff --git a/test/methods/matrix_svd.morpho b/newlinalg/test/methods/matrix_svd.morpho similarity index 100% rename from test/methods/matrix_svd.morpho rename to newlinalg/test/methods/matrix_svd.morpho diff --git a/test/methods/matrix_trace.morpho b/newlinalg/test/methods/matrix_trace.morpho similarity index 100% rename from test/methods/matrix_trace.morpho rename to newlinalg/test/methods/matrix_trace.morpho diff --git a/test/methods/matrix_transpose.morpho b/newlinalg/test/methods/matrix_transpose.morpho similarity index 100% rename from test/methods/matrix_transpose.morpho rename to newlinalg/test/methods/matrix_transpose.morpho diff --git a/test/test.py b/newlinalg/test/test.py similarity index 100% rename from test/test.py rename to newlinalg/test/test.py From 21bd64220ca8e07fb76737179579b4067a059f18 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 12:42:25 -0500 Subject: [PATCH 194/473] Change xmatrix_ and xcomplexmatrix_ in newlinalg to correct filenames --- newlinalg/src/CMakeLists.txt | 4 ++-- newlinalg/src/{xcomplexmatrix.c => complexmatrix.c} | 6 +++--- newlinalg/src/{xcomplexmatrix.h => complexmatrix.h} | 6 +++--- newlinalg/src/{xmatrix.c => matrix.c} | 2 +- newlinalg/src/{xmatrix.h => matrix.h} | 6 +++--- newlinalg/src/newlinalg.h | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) rename newlinalg/src/{xcomplexmatrix.c => complexmatrix.c} (99%) rename newlinalg/src/{xcomplexmatrix.h => complexmatrix.h} (83%) rename newlinalg/src/{xmatrix.c => matrix.c} (99%) rename newlinalg/src/{xmatrix.h => matrix.h} (99%) diff --git a/newlinalg/src/CMakeLists.txt b/newlinalg/src/CMakeLists.txt index 9fd5edf22..e69c0c5c1 100644 --- a/newlinalg/src/CMakeLists.txt +++ b/newlinalg/src/CMakeLists.txt @@ -1,6 +1,6 @@ target_sources(newlinalg PRIVATE newlinalg.c newlinalg.h - xmatrix.c xmatrix.h - xcomplexmatrix.c xcomplexmatrix.h + matrix.c matrix.h + complexmatrix.c complexmatrix.h ) \ No newline at end of file diff --git a/newlinalg/src/xcomplexmatrix.c b/newlinalg/src/complexmatrix.c similarity index 99% rename from newlinalg/src/xcomplexmatrix.c rename to newlinalg/src/complexmatrix.c index 3a860f77c..5f85e8dce 100644 --- a/newlinalg/src/xcomplexmatrix.c +++ b/newlinalg/src/complexmatrix.c @@ -1,4 +1,4 @@ -/** @file xcomplexmatrix.c +/** @file complexmatrix.c * @author T J Atherton * * @brief New linear algebra library @@ -10,8 +10,8 @@ #include #include "newlinalg.h" -#include "xmatrix.h" -#include "xcomplexmatrix.h" +#include "matrix.h" +#include "complexmatrix.h" #include "format.h" #include "cmplx.h" diff --git a/newlinalg/src/xcomplexmatrix.h b/newlinalg/src/complexmatrix.h similarity index 83% rename from newlinalg/src/xcomplexmatrix.h rename to newlinalg/src/complexmatrix.h index a048eda9f..cdb7bdd89 100644 --- a/newlinalg/src/xcomplexmatrix.h +++ b/newlinalg/src/complexmatrix.h @@ -1,11 +1,11 @@ -/** @file xcomplexmatrix.h +/** @file complexmatrix.h * @author T J Atherton * * @brief New linear algebra library */ -#ifndef xcomplexmatrix_h -#define xcomplexmatrix_h +#ifndef complexmatrix_h +#define complexmatrix_h /* ------------------------------------------------------- * ComplexMatrix veneer class diff --git a/newlinalg/src/xmatrix.c b/newlinalg/src/matrix.c similarity index 99% rename from newlinalg/src/xmatrix.c rename to newlinalg/src/matrix.c index b470ab7e6..823f8726f 100644 --- a/newlinalg/src/xmatrix.c +++ b/newlinalg/src/matrix.c @@ -1,4 +1,4 @@ -/** @file xmatrix.c +/** @file matrix.c * @author T J Atherton * * @brief New matrices diff --git a/newlinalg/src/xmatrix.h b/newlinalg/src/matrix.h similarity index 99% rename from newlinalg/src/xmatrix.h rename to newlinalg/src/matrix.h index dcac09311..b91b016fd 100644 --- a/newlinalg/src/xmatrix.h +++ b/newlinalg/src/matrix.h @@ -1,11 +1,11 @@ -/** @file xmatrix.h +/** @file matrix.h * @author T J Atherton * * @brief New linear algebra library */ -#ifndef xmatrix_h -#define xmatrix_h +#ifndef matrix_h +#define matrix_h #define LINALG_MAXMATRIXDEFNS 4 diff --git a/newlinalg/src/newlinalg.h b/newlinalg/src/newlinalg.h index 70d3f2372..c579c7465 100644 --- a/newlinalg/src/newlinalg.h +++ b/newlinalg/src/newlinalg.h @@ -87,7 +87,7 @@ void linalg_raiseerror(vm *v, linalgError_t err); * Include the rest of the library * ------------------------------------------------------- */ -#include "xmatrix.h" -#include "xcomplexmatrix.h" +#include "matrix.h" +#include "complexmatrix.h" #endif From 2122542c6f39626f4c495e1a71609af44dcb873d Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:00:48 -0500 Subject: [PATCH 195/473] Update function and type names for xmatrix integration --- newlinalg/src/complexmatrix.c | 44 +++--- newlinalg/src/matrix.c | 288 +++++++++++++++++----------------- newlinalg/src/matrix.h | 90 +++++------ newlinalg/src/newlinalg.c | 2 +- 4 files changed, 212 insertions(+), 212 deletions(-) diff --git a/newlinalg/src/complexmatrix.c b/newlinalg/src/complexmatrix.c index 5f85e8dce..572df16b6 100644 --- a/newlinalg/src/complexmatrix.c +++ b/newlinalg/src/complexmatrix.c @@ -57,8 +57,8 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { } /** Evaluate norms */ -static double _normfn(objectxmatrix *a, xmatrix_norm_t nrm) { - char cnrm = xmatrix_normtolapack(nrm); +static double _normfn(objectxmatrix *a, matrix_norm_t nrm) { + char cnrm = matrix_normtolapack(nrm); int nrows=a->nrows, ncols=a->ncols; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -167,7 +167,7 @@ static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { // Extract R (upper triangle of a) into r // Copy entire matrix first then zero out below the diagonal - xmatrix_copy(a, r); + matrix_copy(a, r); __LAPACK_double_complex *relems = (__LAPACK_double_complex *) r->elements; for (int j = 0; j < n && j < m - 1; j++) { memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(__LAPACK_double_complex)); @@ -221,7 +221,7 @@ matrixinterfacedefn complexmatrixdefn = { /** Create a new complex matrix */ objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { - return (objectcomplexmatrix *) xmatrix_newwithtype(OBJECT_COMPLEXMATRIX, nrows, ncols, 2, zero); + return (objectcomplexmatrix *) matrix_newwithtype(OBJECT_COMPLEXMATRIX, nrows, ncols, 2, zero); } /* ---------------------- @@ -281,7 +281,7 @@ linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxm } /** Scales a matrix x <- scale * x >*/ -void complexmatrix_scale(objectxmatrix *a, MorphoComplex scale) { +void complematrix_scale(objectxmatrix *a, MorphoComplex scale) { cblas_zscal(a->nrows * a->ncols, (__LAPACK_double_complex *) &scale, (__LAPACK_double_complex *) a->elements, 1); } @@ -357,7 +357,7 @@ value complexmatrix_constructor__int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -value complexmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { +value complematrix_constructor__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); @@ -367,7 +367,7 @@ value complexmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { /** Constructs a complexmatrix from a list of lists or tuples */ value complexmatrix_constructor__list(vm *v, int nargs, value *args) { - objectxmatrix *new = xmatrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); + objectxmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); return morpho_wrapandbind(v, (object *) new); } @@ -376,7 +376,7 @@ value complexmatrix_constructor__array(vm *v, int nargs, value *args) { objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - objectxmatrix *new = xmatrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); + objectxmatrix *new = matrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); return morpho_wrapandbind(v, (object *) new); } @@ -398,7 +398,7 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); if (new) { complexmatrix_promote(b, new); - xmatrix_axpy(alpha, a, new); + matrix_axpy(alpha, a, new); } out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); @@ -411,7 +411,7 @@ value ComplexMatrix_add__xmatrix(vm *v, int nargs, value *args) { value ComplexMatrix_sub__xmatrix(vm *v, int nargs, value *args) { value out = _axpy(v, nargs, args, -1.0); - if (xmatrix_isamatrix(out)) xmatrix_scale(MORPHO_GETXMATRIX(out), -1.0); // -(-A + B) + if (matrix_isamatrix(out)) matrix_scale(MORPHO_GETXMATRIX(out), -1.0); // -(-A + B) return out; } @@ -422,8 +422,8 @@ value ComplexMatrix_subr__xmatrix(vm *v, int nargs, value *args) { value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new = xmatrix_clone(a); - if (new) complexmatrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); + objectxmatrix *new = matrix_clone(a); + if (new) complematrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); return morpho_wrapandbind(v, (object *) new); } @@ -464,14 +464,14 @@ value ComplexMatrix_mulr__xmatrix(vm *v, int nargs, value *args) { value ComplexMatrix_div__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; - objectxmatrix *new=xmatrix_clone(b); - if (new && _promote(v, A, &ap)) xmatrix_solve(ap, new); + objectxmatrix *new=matrix_clone(b); + if (new && _promote(v, A, &ap)) matrix_solve(ap, new); return morpho_wrapandbind(v, (object *) new); } value ComplexMatrix_divr__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *A=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; - if (_promote(v, b, &bp)) xmatrix_solve(A, bp); // Promote the matrix that will contain the solution anyway + if (_promote(v, b, &bp)) matrix_solve(A, bp); // Promote the matrix that will contain the solution anyway return morpho_wrapandbind(v, (object *) bp); } @@ -489,7 +489,7 @@ value ComplexMatrix_inverse(vm *v, int nargs, value *args) { objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value out=MORPHO_NIL; - objectcomplexmatrix *new = xmatrix_clone(a); + objectcomplexmatrix *new = matrix_clone(a); out = morpho_wrapandbind(v, (object *) new); if (new) LINALG_ERRCHECKVM(complexmatrix_inverse(new)); @@ -498,7 +498,7 @@ value ComplexMatrix_inverse(vm *v, int nargs, value *args) { static value _realimag(vm *v, int nargs, value *args, bool imag) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=xmatrix_new(a->nrows, a->ncols, false); + objectxmatrix *new=matrix_new(a->nrows, a->ncols, false); if (new) complexmatrix_demote(a, new, imag); return morpho_wrapandbind(v, (object *) new); } @@ -515,9 +515,9 @@ value ComplexMatrix_imag(vm *v, int nargs, value *args) { static value _conj(vm *v, int nargs, value *args, bool trans) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=xmatrix_clone(a); + objectxmatrix *new=matrix_clone(a); if (new) { - if (trans) xmatrix_transpose(a, new); + if (trans) matrix_transpose(a, new); cblas_dscal(a->nrows*a->ncols, -1.0, new->elements+1, new->nvals); } return morpho_wrapandbind(v, (object *) new); @@ -631,7 +631,7 @@ MORPHO_ENDCLASS void complexmatrix_initialize(void) { objectcomplexmatrixtype=object_addtype(&objectxmatrixdefn); - xmatrix_addinterface(&complexmatrixdefn); + matrix_addinterface(&complexmatrixdefn); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); @@ -641,8 +641,8 @@ void complexmatrix_initialize(void) { morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int)", complexmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complexmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", matrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complematrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/newlinalg/src/matrix.c b/newlinalg/src/matrix.c index 823f8726f..cae32415e 100644 --- a/newlinalg/src/matrix.c +++ b/newlinalg/src/matrix.c @@ -18,21 +18,21 @@ static matrixinterfacedefn _matrixdefn[LINALG_MAXMATRIXDEFNS]; objecttype matrixinterfacedefnnext=0; /** Type of the next object definition */ -void xmatrix_addinterface(matrixinterfacedefn *defn) { +void matrix_addinterface(matrixinterfacedefn *defn) { if (matrixinterfacedefnnextobj.type-OBJECT_XMATRIX; if (iindxtype-OBJECT_XMATRIX; return iindx>=0 && iindxnels; } -void objectxmatrix_printfn(object *obj, void *v) { +void objectmatrix_printfn(object *obj, void *v) { objectclass *klass=object_getveneerclass(obj->type); morpho_printf(v, "<"); morpho_printvalue(v, klass->name); @@ -57,7 +57,7 @@ void objectxmatrix_printfn(object *obj, void *v) { } objecttypedefn objectxmatrixdefn = { - .printfn=objectxmatrix_printfn, + .printfn=objectmatrix_printfn, .markfn=NULL, .freefn=NULL, .sizefn=objectxmatrix_sizefn, @@ -91,8 +91,8 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { return LINALGERR_OK; } -/** Convert xmatrix_norm_t to a character for use with lapack routines */ -char xmatrix_normtolapack(xmatrix_norm_t norm) { +/** Convert matrix_norm_t to a character for use with lapack routines */ +char matrix_normtolapack(matrix_norm_t norm) { switch (norm) { case XMATRIX_NORM_MAX: return 'M'; case XMATRIX_NORM_L1: return '1'; @@ -103,8 +103,8 @@ char xmatrix_normtolapack(xmatrix_norm_t norm) { } /** Evaluate norms */ -static double _normfn(objectxmatrix *a, xmatrix_norm_t nrm) { - char cnrm = xmatrix_normtolapack(nrm); +static double _normfn(objectxmatrix *a, matrix_norm_t nrm) { + char cnrm = matrix_normtolapack(nrm); int nrows=a->nrows, ncols=a->ncols; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -206,7 +206,7 @@ static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { // Extract R (upper triangle of a) into r // Copy entire matrix first, then zero out below the diagonal - xmatrix_copy(a, r); + matrix_copy(a, r); // Only process columns where there are rows below the diagonal (j < m - 1) for (int j = 0; j < n && j < m - 1; j++) { memset(&r->elements[j * m + (j + 1)], 0, (m - j - 1) * sizeof(double)); @@ -256,7 +256,7 @@ matrixinterfacedefn xmatrixdefn = { * ---------------------- */ /** Create a generic matrix with given type and layout */ -objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { +objectxmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { MatrixCount_t nels = nrows*ncols*nvals; objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), type); @@ -273,13 +273,13 @@ objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx } /** Create a new real matrix */ -objectxmatrix *xmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { - return xmatrix_newwithtype(OBJECT_XMATRIX, nrows, ncols, 1, zero); +objectxmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { + return matrix_newwithtype(OBJECT_XMATRIX, nrows, ncols, 1, zero); } /** Clone a matrix */ -objectxmatrix *xmatrix_clone(objectxmatrix *in) { - objectxmatrix *new = xmatrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); +objectxmatrix *matrix_clone(objectxmatrix *in) { + objectxmatrix *new = matrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); if (new) cblas_dcopy((__LAPACK_int) in->nels, in->elements, 1, new->elements, 1); return new; @@ -308,7 +308,7 @@ static bool _length(value v, int *len) { } /** Create a matrix from a list of lists (or tuples) */ -objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals) { +objectxmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals) { value iel, jel; int nrows=0, ncols=0, rlen; @@ -321,14 +321,14 @@ objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, Matrix } } - objectxmatrix *new=xmatrix_newwithtype(type, nrows, ncols, nvals, true); + objectxmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); if (!new) return NULL; for (int i=0; isetelfn(v, jel, new->elements+(j*nrows + i)*new->nvals); + matrix_getinterface(new)->setelfn(v, jel, new->elements+(j*nrows + i)*new->nvals); } } } @@ -337,11 +337,11 @@ objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, Matrix } /** Construct a matrix from an array */ -objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals) { +objectxmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals) { int nrows = MORPHO_GETINTEGERVALUE(a->dimensions[0]); int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); - objectxmatrix *new=xmatrix_newwithtype(type, nrows, ncols, nvals, true); + objectxmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); if (!new) return NULL; for (int i=0; isetelfn(v, el, new->elements+(j*nrows + i)*new->nvals); + matrix_getinterface(new)->setelfn(v, el, new->elements+(j*nrows + i)*new->nvals); } } } @@ -362,7 +362,7 @@ objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, /** @brief Sets a matrix element. @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { +linalgError_t matrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; @@ -371,7 +371,7 @@ linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixI /** @brief Gets a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { +linalgError_t matrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; @@ -380,7 +380,7 @@ linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixI /** @brief Gets a pointer to a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { +linalgError_t matrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); @@ -388,7 +388,7 @@ linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, Matr } /** Copies the column col of matrix a into the column vector b */ -linalgError_t xmatrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { +linalgError_t matrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; @@ -397,7 +397,7 @@ linalgError_t xmatrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix } /** Copies the column vector b into column col of matrix a */ -linalgError_t xmatrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { +linalgError_t matrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; @@ -410,7 +410,7 @@ linalgError_t xmatrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix * ---------------------- */ /** Vector addition: Performs y <- alpha*x + y */ -linalgError_t xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { +linalgError_t matrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); @@ -418,7 +418,7 @@ linalgError_t xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { } /** Copies a matrix y <- x */ -linalgError_t xmatrix_copy(objectxmatrix *x, objectxmatrix *y) { +linalgError_t matrix_copy(objectxmatrix *x, objectxmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); @@ -426,12 +426,12 @@ linalgError_t xmatrix_copy(objectxmatrix *x, objectxmatrix *y) { } /** Scales a matrix x <- scale * x >*/ -void xmatrix_scale(objectxmatrix *x, double scale) { +void matrix_scale(objectxmatrix *x, double scale) { cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); } /** Loads the identity matrix a <- I(n) */ -linalgError_t xmatrix_identity(objectxmatrix *x) { +linalgError_t matrix_identity(objectxmatrix *x) { if (x->ncols!=x->nrows) return LINALGERR_NOT_SQUARE; memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; @@ -439,7 +439,7 @@ linalgError_t xmatrix_identity(objectxmatrix *x) { } /** Performs z <- alpha*(x*y) + beta*z */ -linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z) { +linalgError_t matrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z) { if (!(x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols)) return LINALGERR_INCOMPATIBLE_DIM; cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); @@ -447,7 +447,7 @@ linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, dou } /** Performs x <- alpha*x + beta */ -linalgError_t xmatrix_addscalar(objectxmatrix *x, double alpha, double beta) { +linalgError_t matrix_addscalar(objectxmatrix *x, double alpha, double beta) { for (MatrixCount_t i=0; incols*x->nrows; i++) { for (int k=0; knvals; k++) { x->elements[i*x->nvals+k]*=alpha; @@ -458,7 +458,7 @@ linalgError_t xmatrix_addscalar(objectxmatrix *x, double alpha, double beta) { } /** Performs y <- x^T>*/ -linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y) { +linalgError_t matrix_transpose(objectxmatrix *x, objectxmatrix *y) { if (!(x->ncols==y->nrows && x->nrows==y->ncols)) return LINALGERR_INCOMPATIBLE_DIM; for (MatrixCount_t i=0; incols; i++) { @@ -476,12 +476,12 @@ linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y) { * ---------------------- */ /** Computes various matrix norms */ -double xmatrix_norm(objectxmatrix *a, xmatrix_norm_t norm) { - return xmatrix_getinterface(a)->normfn(a, norm); +double matrix_norm(objectxmatrix *a, matrix_norm_t norm) { + return matrix_getinterface(a)->normfn(a, norm); } /** Computes the sum of all elements in a matrix */ -void xmatrix_sum(objectxmatrix *a, double *sum) { +void matrix_sum(objectxmatrix *a, double *sum) { double c[a->nvals], y, t; for (int i=0; invals; i++) { sum[i]=0; c[i]=0; } @@ -496,7 +496,7 @@ void xmatrix_sum(objectxmatrix *a, double *sum) { } /** Calculate the trace of a matrix */ -linalgError_t xmatrix_trace(objectxmatrix *a, double *out) { +linalgError_t matrix_trace(objectxmatrix *a, double *out) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; *out = 0.0; for (int i = 0; i < a->nrows; i++) { @@ -511,7 +511,7 @@ linalgError_t xmatrix_trace(objectxmatrix *a, double *out) { * ---------------------- */ /** Finds the Frobenius inner product of two matrices */ -linalgError_t xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { +linalgError_t matrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); @@ -519,7 +519,7 @@ linalgError_t xmatrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { } /** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ -linalgError_t xmatrix_r1update(double alpha, objectxmatrix *a, objectxmatrix *b, objectxmatrix *c) { +linalgError_t matrix_r1update(double alpha, objectxmatrix *a, objectxmatrix *b, objectxmatrix *c) { MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; @@ -528,21 +528,21 @@ linalgError_t xmatrix_r1update(double alpha, objectxmatrix *a, objectxmatrix *b, } /** Solve the linear system a.x = b using stack allocated memory for temporary */ -linalgError_t xmatrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { +linalgError_t matrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { int pivot[a->nrows]; double els[a->nels]; objectxmatrix A = MORPHO_STATICXMATRIX(els, a->nrows, a->ncols); - xmatrix_copy(a, &A); - return (xmatrix_getinterface(a)->solvefn) (&A, b, pivot); + matrix_copy(a, &A); + return (matrix_getinterface(a)->solvefn) (&A, b, pivot); } /** Solve the linear system a.x = b using heap allocated memory for temporary */ -linalgError_t xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { +linalgError_t matrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); - objectxmatrix *A = xmatrix_clone(a); + objectxmatrix *A = matrix_clone(a); linalgError_t out = LINALGERR_ALLOC; if (pivot && A) { - out = (xmatrix_getinterface(a)->solvefn) (A, b, pivot); + out = (matrix_getinterface(a)->solvefn) (A, b, pivot); } if (A) object_free((object *) A); if (pivot) MORPHO_FREE(pivot); @@ -553,15 +553,15 @@ linalgError_t xmatrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { * @param[in] a lhs * @param[in|out] b rhs — overwritten by the solution * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b) { - if (MATRIX_ISSMALL(a)) return xmatrix_solvesmall(a, b); - else return xmatrix_solvelarge(a, b); +linalgError_t matrix_solve(objectxmatrix *a, objectxmatrix *b) { + if (MATRIX_ISSMALL(a)) return matrix_solvesmall(a, b); + else return matrix_solvelarge(a, b); } /** Inverts the matrix a * @param[in] a matrix to be inverted * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t xmatrix_inverse(objectxmatrix *a) { +linalgError_t matrix_inverse(objectxmatrix *a) { int nrows=a->nrows, ncols=a->ncols, info; int pivot[nrows]; @@ -583,14 +583,14 @@ linalgError_t xmatrix_inverse(objectxmatrix *a) { } /** Interface to eigensystem */ -linalgError_t xmatrix_eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { +linalgError_t matrix_eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - xmatrix_eigenfn_t efn = xmatrix_getinterface(a)->eigenfn; + matrix_eigenfn_t efn = matrix_getinterface(a)->eigenfn; if (!efn) return LINALGERR_NOT_SUPPORTED; - objectxmatrix *temp = xmatrix_clone(a); + objectxmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; return efn(temp, w, vec); @@ -601,13 +601,13 @@ linalgError_t xmatrix_eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v * ---------------------- */ /** Prints a matrix */ -void xmatrix_print(vm *v, objectxmatrix *m) { - matrixinterfacedefn *interface=xmatrix_getinterface(m); +void matrix_print(vm *v, objectxmatrix *m) { + matrixinterfacedefn *interface=matrix_getinterface(m); double *elptr; for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - xmatrix_getelementptr(m, i, j, &elptr); + matrix_getelementptr(m, i, j, &elptr); (*interface->printelfn) (v, elptr); morpho_printf(v, " "); } @@ -616,14 +616,14 @@ void xmatrix_print(vm *v, objectxmatrix *m) { } /** Prints a matrix to a buffer */ -bool xmatrix_printtobuffer(objectxmatrix *m, char *format, varray_char *out) { - matrixinterfacedefn *interface=xmatrix_getinterface(m); +bool matrix_printtobuffer(objectxmatrix *m, char *format, varray_char *out) { + matrixinterfacedefn *interface=matrix_getinterface(m); double *elptr; for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m varray_charadd(out, "[ ", 2); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - xmatrix_getelementptr(m, i, j, &elptr); + matrix_getelementptr(m, i, j, &elptr); if (!(*interface->printeltobufffn) (out, format, elptr)) return false; varray_charadd(out, " ", 1); } @@ -660,7 +660,7 @@ static void _copyrow(objectxmatrix *a, MatrixIdx_t arow, objectxmatrix *b, Matri } /** Rolls a list by a number of elements along a given axis; stores the result in b */ -linalgError_t xmatrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatrix *b) { +linalgError_t matrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatrix *b) { if (!(a->nrows==b->nrows && a->ncols==b->ncols && a->nvals==b->nvals)) return LINALGERR_INCOMPATIBLE_DIM; switch(axis) { @@ -682,53 +682,53 @@ linalgError_t xmatrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatri * XMatrix constructors * ********************************************************************** */ -value xmatrix_constructor__int_int(vm *v, int nargs, value *args) { +value matrix_constructor__int_int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - objectxmatrix *new=xmatrix_new(nrows, ncols, true); + objectxmatrix *new=matrix_new(nrows, ncols, true); return morpho_wrapandbind(v, (object *) new); } -value xmatrix_constructor__int(vm *v, int nargs, value *args) { +value matrix_constructor__int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - objectxmatrix *new=xmatrix_new(nrows, 1, true); + objectxmatrix *new=matrix_new(nrows, 1, true); return morpho_wrapandbind(v, (object *) new); } /** Clones a matrix */ -value xmatrix_constructor__xmatrix(vm *v, int nargs, value *args) { +value matrix_constructor__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - return morpho_wrapandbind(v, (object *) xmatrix_clone(a)); + return morpho_wrapandbind(v, (object *) matrix_clone(a)); } /** Constructs a matrix from a list of lists or tuples */ -value xmatrix_constructor__list(vm *v, int nargs, value *args) { - objectxmatrix *new = xmatrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_XMATRIX, 1); +value matrix_constructor__list(vm *v, int nargs, value *args) { + objectxmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_XMATRIX, 1); return morpho_wrapandbind(v, (object *) new); } /** Constructs a matrix from an array */ -value xmatrix_constructor__array(vm *v, int nargs, value *args) { +value matrix_constructor__array(vm *v, int nargs, value *args) { objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - objectxmatrix *new = xmatrix_arrayconstructor(v, a, OBJECT_XMATRIX, 1); + objectxmatrix *new = matrix_arrayconstructor(v, a, OBJECT_XMATRIX, 1); return morpho_wrapandbind(v, (object *) new); } -value xmatrix_constructor__err(vm *v, int nargs, value *args) { +value matrix_constructor__err(vm *v, int nargs, value *args) { morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); return MORPHO_NIL; } /** Creates an identity matrix */ -value xmatrix_identityconstructor(vm *v, int nargs, value *args) { +value matrix_identityconstructor(vm *v, int nargs, value *args) { MatrixIdx_t n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - objectxmatrix *new = xmatrix_new(n,n,false); - if (new) xmatrix_identity(new); + objectxmatrix *new = matrix_new(n,n,false); + if (new) matrix_identity(new); return morpho_wrapandbind(v, (object *) new); } @@ -744,7 +744,7 @@ value xmatrix_identityconstructor(vm *v, int nargs, value *args) { /** Prints a matrix */ value XMatrix_print(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - xmatrix_print(v, m); + matrix_print(v, m); return MORPHO_NIL; } @@ -754,7 +754,7 @@ value XMatrix_format(vm *v, int nargs, value *args) { varray_char str; varray_charinit(&str); - if (xmatrix_printtobuffer(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + if (matrix_printtobuffer(MORPHO_GETXMATRIX(MORPHO_SELF(args)), MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &str)) { out = object_stringfromvarraychar(&str); @@ -769,14 +769,14 @@ value XMatrix_format(vm *v, int nargs, value *args) { value XMatrix_assign(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - LINALG_ERRCHECKVM(xmatrix_copy(b, a)); + LINALG_ERRCHECKVM(matrix_copy(b, a)); return MORPHO_NIL; } /** Clones a matrix */ value XMatrix_clone(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=xmatrix_clone(a); + objectxmatrix *new=matrix_clone(a); return morpho_wrapandbind(v, (object *) new); } @@ -791,9 +791,9 @@ value XMatrix_index__int_int(vm *v, int nargs, value *args) { value out=MORPHO_NIL; double *elptr=NULL; - LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &elptr)); + LINALG_ERRCHECKVM(matrix_getelementptr(m, i, j, &elptr)); - if (elptr) out=xmatrix_getinterface(m)->getelfn(v, elptr); + if (elptr) out=matrix_getinterface(m)->getelfn(v, elptr); return out; } @@ -827,8 +827,8 @@ static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx for (MatrixIdx_t i=0; invals); else memcpy(bel, ael, sizeof(double)*b->nvals); } @@ -844,7 +844,7 @@ value XMatrix_index__x_x(vm *v, int nargs, value *args) { MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); - new=xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); + new=matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } linalgError_t err=_slice_copy(iv, jv, icnt, jcnt, m, new, false); @@ -860,8 +860,8 @@ value XMatrix_index__x_x(vm *v, int nargs, value *args) { static void _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { double *elptr=NULL; - LINALG_ERRCHECKVM(xmatrix_getelementptr(m, i, j, &elptr)); - if (elptr) LINALG_ERRCHECKVM(xmatrix_getinterface(m)->setelfn(v, in, elptr)); + LINALG_ERRCHECKVM(matrix_getelementptr(m, i, j, &elptr)); + if (elptr) LINALG_ERRCHECKVM(matrix_getinterface(m)->setelfn(v, in, elptr)); } value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { @@ -900,8 +900,8 @@ value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { value out=MORPHO_NIL; if (i>=0 && incols) { - objectxmatrix *new=xmatrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); - if (new) xmatrix_getcolumn(a, i, new); + objectxmatrix *new=matrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); + if (new) matrix_getcolumn(a, i, new); out=morpho_wrapandbind(v, (object *)new); } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); @@ -909,7 +909,7 @@ value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { } value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { - LINALG_ERRCHECKVM(xmatrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)))); return MORPHO_NIL; @@ -927,8 +927,8 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { value out=MORPHO_NIL; if (a->ncols==b->ncols && a->nrows==b->nrows) { - new=xmatrix_clone(a); - if (new) LINALG_ERRCHECKVM(xmatrix_axpy(alpha, b, new)); + new=matrix_clone(a); + if (new) LINALG_ERRCHECKVM(matrix_axpy(alpha, b, new)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); @@ -943,8 +943,8 @@ static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { double beta; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &beta)) { - new = xmatrix_clone(a); - if (new) LINALG_ERRCHECKVM(xmatrix_addscalar(new, sgna, beta*sgnb)); + new = matrix_clone(a); + if (new) LINALG_ERRCHECKVM(matrix_addscalar(new, sgna, beta*sgnb)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INVLDARGS); @@ -960,7 +960,7 @@ value XMatrix_add__nil(vm *v, int nargs, value *args) { } value XMatrix_add__x(vm *v, int nargs, value *args) { - if (xmatrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to addr + if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to addr return _xpa(v,nargs,args,1.0,1.0); } @@ -969,7 +969,7 @@ value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { } value XMatrix_sub__x(vm *v, int nargs, value *args) { - if (xmatrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr + if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr return _xpa(v,nargs,args,1.0,-1.0); } @@ -983,8 +983,8 @@ value XMatrix_mul__float(vm *v, int nargs, value *args) { double scale; if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; - objectxmatrix *new = xmatrix_clone(a); - if (new) xmatrix_scale(new, scale); + objectxmatrix *new = matrix_clone(a); + if (new) matrix_scale(new, scale); return morpho_wrapandbind(v, (object *) new); } @@ -994,8 +994,8 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { value out=MORPHO_NIL; if (a->ncols==b->nrows) { - objectxmatrix *new = xmatrix_new(a->nrows, b->ncols, false); - if (new) LINALG_ERRCHECKVM(xmatrix_mmul(1.0, a, b, 0.0, new)); + objectxmatrix *new = matrix_new(a->nrows, b->ncols, false); + if (new) LINALG_ERRCHECKVM(matrix_mmul(1.0, a, b, 0.0, new)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; @@ -1009,8 +1009,8 @@ value XMatrix_div__float(vm *v, int nargs, value *args) { scale = 1.0/scale; if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); - objectxmatrix *new = xmatrix_clone(a); - if (new) xmatrix_scale(new, scale); + objectxmatrix *new = matrix_clone(a); + if (new) matrix_scale(new, scale); return morpho_wrapandbind(v, (object *) new); } @@ -1018,8 +1018,8 @@ value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument - objectxmatrix *sol = xmatrix_clone(b); - if (sol) LINALG_ERRCHECKVM(xmatrix_solve(a, sol)); + objectxmatrix *sol = matrix_clone(b); + if (sol) LINALG_ERRCHECKVM(matrix_solve(a, sol)); return morpho_wrapandbind(v, (object *) sol); } @@ -1032,7 +1032,7 @@ value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args) { double alpha=1.0; if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, MATRIX_ARITHARGS); return MORPHO_NIL; } - LINALG_ERRCHECKVM(xmatrix_axpy(alpha, b, a)); + LINALG_ERRCHECKVM(matrix_axpy(alpha, b, a)); return MORPHO_NIL; } @@ -1047,9 +1047,9 @@ value XMatrix_norm__x(vm *v, int nargs, value *args) { if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { if (fabs(n-1.0)nvals]; - xmatrix_sum(a, sum); - return xmatrix_getinterface(a)->getelfn(v, sum); + matrix_sum(a, sum); + return matrix_getinterface(a)->getelfn(v, sum); } /** Computes the trace */ value XMatrix_trace(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); double out=0.0; - LINALG_ERRCHECKVM(xmatrix_trace(a, &out)); + LINALG_ERRCHECKVM(matrix_trace(a, &out)); return MORPHO_FLOAT(out); } /** Inverts a matrix */ value XMatrix_transpose(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new = xmatrix_clone(a); + objectxmatrix *new = matrix_clone(a); if (new) { new->ncols=a->nrows; new->nrows=a->ncols; - LINALG_ERRCHECKVM(xmatrix_transpose(a, new)); + LINALG_ERRCHECKVM(matrix_transpose(a, new)); } return morpho_wrapandbind(v, (object *) new); } @@ -1094,8 +1094,8 @@ value XMatrix_transpose(vm *v, int nargs, value *args) { /** Inverts a matrix */ value XMatrix_inverse(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new = xmatrix_clone(a); - if (new) LINALG_ERRCHECKVM(xmatrix_inverse(new)); + objectxmatrix *new = matrix_clone(a); + if (new) LINALG_ERRCHECKVM(matrix_inverse(new)); return morpho_wrapandbind(v, (object *) new); } @@ -1135,7 +1135,7 @@ value XMatrix_eigenvalues(vm *v, int nargs, value *args) { MatrixIdx_t n=a->ncols; MorphoComplex w[n]; - linalgError_t err=xmatrix_eigen(a, w, NULL); + linalgError_t err=matrix_eigen(a, w, NULL); if (err==LINALGERR_OK) { if (_processeigenvalues(v, n, w, &out)) { morpho_bindobjects(v, 1, &out); @@ -1158,10 +1158,10 @@ value XMatrix_eigensystem(vm *v, int nargs, value *args) { MatrixIdx_t n=a->ncols; MorphoComplex w[n]; - evec=xmatrix_clone(a); + evec=matrix_clone(a); _CHK(evec); - linalgError_t err=xmatrix_eigen(a, w, evec); + linalgError_t err=matrix_eigen(a, w, evec); if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto _eigensystem_cleanup; } _CHK(_processeigenvalues(v, n, w, &ev)); @@ -1191,14 +1191,14 @@ value XMatrix_eigensystem(vm *v, int nargs, value *args) { * ---------------- */ /** Interface to SVD */ -linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { +linalgError_t matrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { if (u && ((a->nrows != u->nrows) || (a->nrows != u->ncols))) return LINALGERR_INCOMPATIBLE_DIM; if (vt && ((a->ncols != vt->nrows) || (a->ncols != vt->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - objectxmatrix *temp = xmatrix_clone(a); + objectxmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; - linalgError_t err = xmatrix_getinterface(a)->svdfn (temp, s, u, vt); + linalgError_t err = matrix_getinterface(a)->svdfn (temp, s, u, vt); object_free((object *) temp); return err; } @@ -1208,14 +1208,14 @@ linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx * ---------------- */ /** Interface to QR decomposition */ -linalgError_t xmatrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { +linalgError_t matrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { if (q && ((a->nrows != q->nrows) || (a->nrows != q->ncols))) return LINALGERR_INCOMPATIBLE_DIM; if (r && ((a->nrows != r->nrows) || (a->ncols != r->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - objectxmatrix *temp = xmatrix_clone(a); + objectxmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; - linalgError_t err = xmatrix_getinterface(a)->qrfn (temp, q, r); + linalgError_t err = matrix_getinterface(a)->qrfn (temp, q, r); object_free((object *) temp); return err; } @@ -1247,13 +1247,13 @@ value XMatrix_svd(vm *v, int nargs, value *args) { double singular_values[minmn]; // Allocate U (m×m) and VT (n×n) matrices - u = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); + u = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); _CHK_SVD(u); - vt = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), n, n, a->nvals, false); + vt = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), n, n, a->nvals, false); _CHK_SVD(vt); - linalgError_t err = xmatrix_svd(a, singular_values, u, vt); + linalgError_t err = matrix_svd(a, singular_values, u, vt); if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _svd_cleanup; } _CHK_SVD(_processsingularvalues(v, minmn, singular_values, &s)); @@ -1290,13 +1290,13 @@ value XMatrix_qr(vm *v, int nargs, value *args) { MatrixIdx_t m = a->nrows, n = a->ncols; // Allocate Q (m×m) and R (m×n) matrices - q = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); + q = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); _CHK_QR(q); - r = xmatrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, n, a->nvals, false); + r = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, n, a->nvals, false); _CHK_QR(r); - linalgError_t err = xmatrix_qr(a, q, r); + linalgError_t err = matrix_qr(a, q, r); if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _qr_cleanup; } value outtuple[2] = { MORPHO_OBJECT(q), MORPHO_OBJECT(r) }; @@ -1324,7 +1324,7 @@ value XMatrix_inner(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); double prod=0.0; - LINALG_ERRCHECKVM(xmatrix_inner(a, b, &prod)); + LINALG_ERRCHECKVM(matrix_inner(a, b, &prod)); return MORPHO_FLOAT(prod); } @@ -1334,8 +1334,8 @@ value XMatrix_outer(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); - objectxmatrix *new=xmatrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); - if (new) LINALG_ERRCHECKVM(xmatrix_r1update(1.0, a, b, new)); + objectxmatrix *new=matrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); + if (new) LINALG_ERRCHECKVM(matrix_r1update(1.0, a, b, new)); return morpho_wrapandbind(v, (object *) new); } @@ -1359,8 +1359,8 @@ value XMatrix_reshape(vm *v, int nargs, value *args) { } static value _roll(vm *v, objectxmatrix *a, int roll, int axis) { - objectxmatrix *new = xmatrix_clone(a); - if (new) xmatrix_roll(a, roll, axis, new); + objectxmatrix *new = matrix_clone(a); + if (new) matrix_roll(a, roll, axis, new); return morpho_wrapandbind(v, (object *) new); } @@ -1388,7 +1388,7 @@ value XMatrix_enumerate(vm *v, int nargs, value *args) { if (i<0) { out=MORPHO_INTEGER(a->ncols*a->nrows); } else if (incols*a->nrows) { - out=xmatrix_getinterface(a)->getelfn(v, a->elements+i*a->nvals); + out=matrix_getinterface(a)->getelfn(v, a->elements+i*a->nvals); } else { linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); } @@ -1464,9 +1464,9 @@ MORPHO_ENDCLASS * Initialization * ********************************************************************** */ -void xmatrix_initialize(void) { +void matrix_initialize(void) { objectxmatrixtype=object_addtype(&objectxmatrixdefn); - xmatrix_addinterface(&xmatrixdefn); + matrix_addinterface(&xmatrixdefn); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); @@ -1474,15 +1474,15 @@ void xmatrix_initialize(void) { value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), objclass); object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", xmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int)", xmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (XMatrix)", xmatrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Tuple)", xmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Array)", xmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "(...)", xmatrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (XMatrix)", matrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", xmatrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(XMATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); - complexmatrix_initialize(); + complematrix_initialize(); } diff --git a/newlinalg/src/matrix.h b/newlinalg/src/matrix.h index b91b016fd..4ceb4c65c 100644 --- a/newlinalg/src/matrix.h +++ b/newlinalg/src/matrix.h @@ -56,47 +56,47 @@ typedef struct { * ------------------------------------------------------- */ /** Function that prints a single matrix element */ -typedef void (*xmatrix_printelfn_t) (vm *, double *); +typedef void (*matrix_printelfn_t) (vm *, double *); /** Function that prints a single matrix element to a text buffer * @param[in] out - buffer to write to * @param[in] format - format string * @param[in] el - pointer to matrix element data * @returns true on success */ -typedef bool (*xmatrix_printeltobufffn_t) (varray_char *out, char *format, double *el); +typedef bool (*matrix_printeltobufffn_t) (varray_char *out, char *format, double *el); /** Function that materializes a value from a pointer to an element */ -typedef value (*xmatrix_getelfn_t) (vm *, double *); +typedef value (*matrix_getelfn_t) (vm *, double *); /** Function that sets the an element given a value */ -typedef linalgError_t (*xmatrix_setelfn_t) (vm *, value, double *); +typedef linalgError_t (*matrix_setelfn_t) (vm *, value, double *); typedef enum { XMATRIX_NORM_MAX, XMATRIX_NORM_L1, XMATRIX_NORM_INF, XMATRIX_NORM_FROBENIUS, -} xmatrix_norm_t; +} matrix_norm_t; -/** Convert xmatrix_norm_t to a character for use with lapack routines */ -char xmatrix_normtolapack(xmatrix_norm_t norm); +/** Convert matrix_norm_t to a character for use with lapack routines */ +char matrix_normtolapack(matrix_norm_t norm); /** Compute various matrix norms */ -typedef double (*xmatrix_normfn_t) (objectxmatrix *a, xmatrix_norm_t nrm); +typedef double (*matrix_normfn_t) (objectxmatrix *a, matrix_norm_t nrm); /** Function that solves the linear system a.x = b * @param[in|out] a - lhs; overwritten by LU decomposition * @param[in|out] b - rhs; overwritten by solution * @param[out] pivot - you must provide an array with the same number of rows as a. * @returns a matrix error code */ -typedef linalgError_t (*xmatrix_solvefn_t) (objectxmatrix *a, objectxmatrix *b, int *pivot); +typedef linalgError_t (*matrix_solvefn_t) (objectxmatrix *a, objectxmatrix *b, int *pivot); /** Function that finds the eigenvalues of a matrix * @param[in|out] a - matrix to diagonalize; overwritten * @param[out] w - eigenvalues; dimension N * @param[out] vec - right eigenvectors. Can be NULL if only eigenvalues requested * @returns a matrix error code */ -typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec); +typedef linalgError_t (*matrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec); /** Function that finds the svd of a matrix * @param[in|out] a - overwritten @@ -104,29 +104,29 @@ typedef linalgError_t (*xmatrix_eigenfn_t) (objectxmatrix *a, MorphoComplex *w, * @param[out] u - left singular vectors * @param[out] v - right singular vectors (transposed so columns contain singular vectors) * @returns a matrix error code */ -typedef linalgError_t (*xmatrix_svdfn_t) (objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); +typedef linalgError_t (*matrix_svdfn_t) (objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); /** Function that finds the QR decomposition of a matrix * @param[in|out] a - overwritten with R in upper triangle and reflectors below * @param[out] q - orthogonal matrix Q * @param[out] r - upper triangular matrix R * @returns a matrix error code */ -typedef linalgError_t (*xmatrix_qrfn_t) (objectxmatrix *a, objectxmatrix *q, objectxmatrix *r); +typedef linalgError_t (*matrix_qrfn_t) (objectxmatrix *a, objectxmatrix *q, objectxmatrix *r); typedef struct { - xmatrix_printelfn_t printelfn; - xmatrix_printeltobufffn_t printeltobufffn; - xmatrix_getelfn_t getelfn; - xmatrix_setelfn_t setelfn; - xmatrix_normfn_t normfn; - xmatrix_solvefn_t solvefn; - xmatrix_eigenfn_t eigenfn; - xmatrix_svdfn_t svdfn; - xmatrix_qrfn_t qrfn; + matrix_printelfn_t printelfn; + matrix_printeltobufffn_t printeltobufffn; + matrix_getelfn_t getelfn; + matrix_setelfn_t setelfn; + matrix_normfn_t normfn; + matrix_solvefn_t solvefn; + matrix_eigenfn_t eigenfn; + matrix_svdfn_t svdfn; + matrix_qrfn_t qrfn; } matrixinterfacedefn; -void xmatrix_addinterface(matrixinterfacedefn *defn); -matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); +void matrix_addinterface(matrixinterfacedefn *defn); +matrixinterfacedefn *matrix_getinterface(objectxmatrix *a); /* ------------------------------------------------------- * Matrix veneer class @@ -152,11 +152,11 @@ matrixinterfacedefn *xmatrix_getinterface(objectxmatrix *a); #define XMATRIX_IDENTITYCONSTRUCTOR "IdentityXMatrix" -void xmatrix_initialize(void); +void matrix_initialize(void); #define IMPLEMENTATIONFN(fn) value fn (vm *v, int nargs, value *args) -IMPLEMENTATIONFN(xmatrix_constructor__xmatrix); +IMPLEMENTATIONFN(matrix_constructor__xmatrix); IMPLEMENTATIONFN(XMatrix_print); IMPLEMENTATIONFN(XMatrix_format); @@ -205,32 +205,32 @@ IMPLEMENTATIONFN(XMatrix_dimensions); * Interface * ------------------------------------------------------- */ -bool xmatrix_isamatrix(value val); +bool matrix_isamatrix(value val); -objectxmatrix *xmatrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); -objectxmatrix *xmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero); -objectxmatrix *xmatrix_clone(objectxmatrix *in); -objectxmatrix *xmatrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals); -objectxmatrix *xmatrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals); +objectxmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero); +objectxmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero); +objectxmatrix *matrix_clone(objectxmatrix *in); +objectxmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals); +objectxmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals); -linalgError_t xmatrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y); -linalgError_t xmatrix_copy(objectxmatrix *x, objectxmatrix *y); -void xmatrix_scale(objectxmatrix *x, double scale); -linalgError_t xmatrix_identity(objectxmatrix *x); -linalgError_t xmatrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z); -linalgError_t xmatrix_addscalar(objectxmatrix *x, double alpha, double beta); -linalgError_t xmatrix_transpose(objectxmatrix *x, objectxmatrix *y); +linalgError_t matrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y); +linalgError_t matrix_copy(objectxmatrix *x, objectxmatrix *y); +void matrix_scale(objectxmatrix *x, double scale); +linalgError_t matrix_identity(objectxmatrix *x); +linalgError_t matrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z); +linalgError_t matrix_addscalar(objectxmatrix *x, double alpha, double beta); +linalgError_t matrix_transpose(objectxmatrix *x, objectxmatrix *y); -linalgError_t xmatrix_solve(objectxmatrix *a, objectxmatrix *b); +linalgError_t matrix_solve(objectxmatrix *a, objectxmatrix *b); -linalgError_t xmatrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); +linalgError_t matrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt); -linalgError_t xmatrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r); +linalgError_t matrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r); -linalgError_t xmatrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); -linalgError_t xmatrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); -linalgError_t xmatrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); +linalgError_t matrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); +linalgError_t matrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); +linalgError_t matrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); -void xmatrix_print(vm *v, objectxmatrix *m); +void matrix_print(vm *v, objectxmatrix *m); #endif diff --git a/newlinalg/src/newlinalg.c b/newlinalg/src/newlinalg.c index 4caadffb6..81beb96b8 100644 --- a/newlinalg/src/newlinalg.c +++ b/newlinalg/src/newlinalg.c @@ -34,7 +34,7 @@ void linalg_raiseerror(vm *v, linalgError_t err) { * ------------------------------------------------------- */ void newlinalg_initialize(void) { - xmatrix_initialize(); + matrix_initialize(); morpho_defineerror(LINALG_INCOMPATIBLEMATRICES, ERROR_HALT, LINALG_INCOMPATIBLEMATRICES_MSG); morpho_defineerror(LINALG_INDICESOUTSIDEBOUNDS, ERROR_HALT, LINALG_INDICESOUTSIDEBOUNDS_MSG); From 1523bd927402d1e98606ec598a82d1b96ef70c6e Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:14:12 -0500 Subject: [PATCH 196/473] Update macros and method implementations --- newlinalg/src/complexmatrix.c | 124 ++++++++++----------- newlinalg/src/matrix.c | 204 +++++++++++++++++----------------- newlinalg/src/matrix.h | 130 +++++++++++----------- 3 files changed, 229 insertions(+), 229 deletions(-) diff --git a/newlinalg/src/complexmatrix.c b/newlinalg/src/complexmatrix.c index 572df16b6..ecb8a4558 100644 --- a/newlinalg/src/complexmatrix.c +++ b/newlinalg/src/complexmatrix.c @@ -357,7 +357,7 @@ value complexmatrix_constructor__int(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -value complematrix_constructor__xmatrix(vm *v, int nargs, value *args) { +value complematrix_constructor__matrix(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); @@ -405,17 +405,17 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { return out; } -value ComplexMatrix_add__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_add__matrix(vm *v, int nargs, value *args) { return _axpy(v, nargs, args, 1.0); } -value ComplexMatrix_sub__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_sub__matrix(vm *v, int nargs, value *args) { value out = _axpy(v, nargs, args, -1.0); if (matrix_isamatrix(out)) matrix_scale(MORPHO_GETXMATRIX(out), -1.0); // -(-A + B) return out; } -value ComplexMatrix_subr__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_subr__matrix(vm *v, int nargs, value *args) { return _axpy(v, nargs, args, -1.0); } @@ -454,22 +454,22 @@ value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), false, false); } -value ComplexMatrix_mul__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_mul__matrix(vm *v, int nargs, value *args) { return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, false); } -value ComplexMatrix_mulr__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_mulr__matrix(vm *v, int nargs, value *args) { return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, true); } -value ComplexMatrix_div__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_div__matrix(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; objectxmatrix *new=matrix_clone(b); if (new && _promote(v, A, &ap)) matrix_solve(ap, new); return morpho_wrapandbind(v, (object *) new); } -value ComplexMatrix_divr__xmatrix(vm *v, int nargs, value *args) { +value ComplexMatrix_divr__matrix(vm *v, int nargs, value *args) { objectxmatrix *A=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; if (_promote(v, b, &bp)) matrix_solve(A, bp); // Promote the matrix that will contain the solution anyway return morpho_wrapandbind(v, (object *) bp); @@ -564,65 +564,65 @@ value ComplexMatrix_outer(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(ComplexMatrix) -MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", XMatrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", XMatrix_index__x_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", XMatrix_setindex__x_x_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_subr__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index_x_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mulr__xmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_divr__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", XMatrix_sum, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "XMatrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "XMatrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_SVD_METHOD, "Tuple ()", XMatrix_svd, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_QR_METHOD, "Tuple ()", XMatrix_qr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** @@ -641,8 +641,8 @@ void complexmatrix_initialize(void) { morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int)", complexmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", matrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complematrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complematrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/newlinalg/src/matrix.c b/newlinalg/src/matrix.c index cae32415e..3c6cb68c8 100644 --- a/newlinalg/src/matrix.c +++ b/newlinalg/src/matrix.c @@ -94,10 +94,10 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { /** Convert matrix_norm_t to a character for use with lapack routines */ char matrix_normtolapack(matrix_norm_t norm) { switch (norm) { - case XMATRIX_NORM_MAX: return 'M'; - case XMATRIX_NORM_L1: return '1'; - case XMATRIX_NORM_INF: return 'I'; - case XMATRIX_NORM_FROBENIUS: return 'F'; + case MATRIX_NORM_MAX: return 'M'; + case MATRIX_NORM_L1: return '1'; + case MATRIX_NORM_INF: return 'I'; + case MATRIX_NORM_FROBENIUS: return 'F'; } return '\0'; } @@ -698,7 +698,7 @@ value matrix_constructor__int(vm *v, int nargs, value *args) { } /** Clones a matrix */ -value matrix_constructor__xmatrix(vm *v, int nargs, value *args) { +value matrix_constructor__matrix(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); return morpho_wrapandbind(v, (object *) matrix_clone(a)); } @@ -742,14 +742,14 @@ value matrix_identityconstructor(vm *v, int nargs, value *args) { * ---------------------- */ /** Prints a matrix */ -value XMatrix_print(vm *v, int nargs, value *args) { +value Matrix_print(vm *v, int nargs, value *args) { objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); matrix_print(v, m); return MORPHO_NIL; } /** Formatted conversion to a string */ -value XMatrix_format(vm *v, int nargs, value *args) { +value Matrix_format(vm *v, int nargs, value *args) { value out=MORPHO_NIL; varray_char str; varray_charinit(&str); @@ -766,7 +766,7 @@ value XMatrix_format(vm *v, int nargs, value *args) { } /** Copies the contents of one matrix into another */ -value XMatrix_assign(vm *v, int nargs, value *args) { +value Matrix_assign(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); LINALG_ERRCHECKVM(matrix_copy(b, a)); @@ -774,7 +774,7 @@ value XMatrix_assign(vm *v, int nargs, value *args) { } /** Clones a matrix */ -value XMatrix_clone(vm *v, int nargs, value *args) { +value Matrix_clone(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *new=matrix_clone(a); return morpho_wrapandbind(v, (object *) new); @@ -784,7 +784,7 @@ value XMatrix_clone(vm *v, int nargs, value *args) { * index() * --------- */ -value XMatrix_index__int_int(vm *v, int nargs, value *args) { +value Matrix_index_int_int(vm *v, int nargs, value *args) { objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -836,7 +836,7 @@ static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx return LINALGERR_OK; } -value XMatrix_index__x_x(vm *v, int nargs, value *args) { +value Matrix_index_x_x(vm *v, int nargs, value *args) { objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)), *new=NULL; value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); value out=MORPHO_NIL; @@ -864,20 +864,20 @@ static void _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, val if (elptr) LINALG_ERRCHECKVM(matrix_getinterface(m)->setelfn(v, in, elptr)); } -value XMatrix_setindex__int_x(vm *v, int nargs, value *args) { +value Matrix_setindex_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); return MORPHO_NIL; } -value XMatrix_setindex__int_int_x(vm *v, int nargs, value *args) { +value Matrix_setindex_int_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); return MORPHO_NIL; } -value XMatrix_setindex__x_x_xmatrix(vm *v, int nargs, value *args) { +value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *msrc = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 2)); value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); @@ -894,7 +894,7 @@ value XMatrix_setindex__x_x_xmatrix(vm *v, int nargs, value *args) { * column * --------- */ -value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { +value Matrix_getcolumn_int(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; @@ -908,7 +908,7 @@ value XMatrix_getcolumn__int(vm *v, int nargs, value *args) { return out; } -value XMatrix_setcolumn__int_xmatrix(vm *v, int nargs, value *args) { +value Matrix_setcolumn_int__matrix(vm *v, int nargs, value *args) { LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)))); @@ -951,33 +951,33 @@ static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { return out; } -value XMatrix_add__xmatrix(vm *v, int nargs, value *args) { +value Matrix_add__matrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,1.0); } -value XMatrix_add__nil(vm *v, int nargs, value *args) { +value Matrix_add_nil(vm *v, int nargs, value *args) { return MORPHO_SELF(args); } -value XMatrix_add__x(vm *v, int nargs, value *args) { +value Matrix_add_x(vm *v, int nargs, value *args) { if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to addr return _xpa(v,nargs,args,1.0,1.0); } -value XMatrix_sub__xmatrix(vm *v, int nargs, value *args) { +value Matrix_sub__matrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,-1.0); } -value XMatrix_sub__x(vm *v, int nargs, value *args) { +value Matrix_sub_x(vm *v, int nargs, value *args) { if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr return _xpa(v,nargs,args,1.0,-1.0); } -value XMatrix_subr__x(vm *v, int nargs, value *args) { +value Matrix_subr_x(vm *v, int nargs, value *args) { return _xpa(v,nargs,args,-1.0,1.0); } -value XMatrix_mul__float(vm *v, int nargs, value *args) { +value Matrix_mul_float(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); double scale; @@ -988,7 +988,7 @@ value XMatrix_mul__float(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { +value Matrix_mul__matrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; @@ -1001,7 +1001,7 @@ value XMatrix_mul__xmatrix(vm *v, int nargs, value *args) { return out; } -value XMatrix_div__float(vm *v, int nargs, value *args) { +value Matrix_div_float(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); double scale; @@ -1014,7 +1014,7 @@ value XMatrix_div__float(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { +value Matrix_div__matrix(vm *v, int nargs, value *args) { objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument @@ -1025,7 +1025,7 @@ value XMatrix_div__xmatrix(vm *v, int nargs, value *args) { } /** Accumulate in place */ -value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args) { +value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)); @@ -1041,15 +1041,15 @@ value XMatrix_acc__x_xmatrix(vm *v, int nargs, value *args) { * ---------------- */ /** Matrix norm */ -value XMatrix_norm__x(vm *v, int nargs, value *args) { +value Matrix_norm_x(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); double n; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { if (fabs(n-1.0)nvals]; @@ -1072,7 +1072,7 @@ value XMatrix_sum(vm *v, int nargs, value *args) { } /** Computes the trace */ -value XMatrix_trace(vm *v, int nargs, value *args) { +value Matrix_trace(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); double out=0.0; LINALG_ERRCHECKVM(matrix_trace(a, &out)); @@ -1080,7 +1080,7 @@ value XMatrix_trace(vm *v, int nargs, value *args) { } /** Inverts a matrix */ -value XMatrix_transpose(vm *v, int nargs, value *args) { +value Matrix_transpose(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *new = matrix_clone(a); if (new) { @@ -1092,7 +1092,7 @@ value XMatrix_transpose(vm *v, int nargs, value *args) { } /** Inverts a matrix */ -value XMatrix_inverse(vm *v, int nargs, value *args) { +value Matrix_inverse(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *new = matrix_clone(a); if (new) LINALG_ERRCHECKVM(matrix_inverse(new)); @@ -1129,7 +1129,7 @@ static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *o } /** Finds the eigenvalues of a matrix */ -value XMatrix_eigenvalues(vm *v, int nargs, value *args) { +value Matrix_eigenvalues(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value out = MORPHO_NIL; @@ -1148,7 +1148,7 @@ value XMatrix_eigenvalues(vm *v, int nargs, value *args) { #define _CHK(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _eigensystem_cleanup; } /** Finds the eigenvalues and eigenvectors of a matrix */ -value XMatrix_eigensystem(vm *v, int nargs, value *args) { +value Matrix_eigensystem(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value ev=MORPHO_NIL; // Will hold eigenvalues @@ -1234,7 +1234,7 @@ static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) #define _CHK_SVD(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _svd_cleanup; } /** Singular Value Decomposition */ -value XMatrix_svd(vm *v, int nargs, value *args) { +value Matrix_svd(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); value s = MORPHO_NIL; // Will hold singular values @@ -1280,7 +1280,7 @@ value XMatrix_svd(vm *v, int nargs, value *args) { #define _CHK_QR(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _qr_cleanup; } /** QR Decomposition */ -value XMatrix_qr(vm *v, int nargs, value *args) { +value Matrix_qr(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *q = NULL; // Orthogonal matrix Q @@ -1319,7 +1319,7 @@ value XMatrix_qr(vm *v, int nargs, value *args) { * --------- */ /** Frobenius inner product */ -value XMatrix_inner(vm *v, int nargs, value *args) { +value Matrix_inner(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); double prod=0.0; @@ -1330,7 +1330,7 @@ value XMatrix_inner(vm *v, int nargs, value *args) { } /** Outer product */ -value XMatrix_outer(vm *v, int nargs, value *args) { +value Matrix_outer(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); @@ -1345,7 +1345,7 @@ value XMatrix_outer(vm *v, int nargs, value *args) { * --------- */ /** Reshape a matrix */ -value XMatrix_reshape(vm *v, int nargs, value *args) { +value Matrix_reshape(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -1365,7 +1365,7 @@ static value _roll(vm *v, objectxmatrix *a, int roll, int axis) { } /** Roll a matrix */ -value XMatrix_roll__int_int(vm *v, int nargs, value *args) { +value Matrix_roll_int_int(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), axis = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -1373,14 +1373,14 @@ value XMatrix_roll__int_int(vm *v, int nargs, value *args) { } /** Roll a matrix by row */ -value XMatrix_roll__int(vm *v, int nargs, value *args) { +value Matrix_roll_int(vm *v, int nargs, value *args) { objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); return _roll(v, a, roll, 0); } /** Enumerate protocol */ -value XMatrix_enumerate(vm *v, int nargs, value *args) { +value Matrix_enumerate(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; @@ -1397,13 +1397,13 @@ value XMatrix_enumerate(vm *v, int nargs, value *args) { } /** Number of matrix elements */ -value XMatrix_count(vm *v, int nargs, value *args) { +value Matrix_count(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); return MORPHO_INTEGER(a->ncols*a->nrows); } /** Matrix dimensions */ -value XMatrix_dimensions(vm *v, int nargs, value *args) { +value Matrix_dimensions(vm *v, int nargs, value *args) { objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); value dim[2] = { MORPHO_INTEGER(a->nrows), MORPHO_INTEGER(a->ncols) }; @@ -1413,51 +1413,51 @@ value XMatrix_dimensions(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(XMatrix) -MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", XMatrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", XMatrix_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", XMatrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", XMatrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", XMatrix_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", XMatrix_index__int_int, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "XMatrix (_,_)", XMatrix_index__x_x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", XMatrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", XMatrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,XMatrix)", XMatrix_setindex__x_x_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", XMatrix_getcolumn__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", XMatrix_setcolumn__int_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", XMatrix_add__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (_)", XMatrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", XMatrix_sub__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (Nil)", XMatrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (_)", XMatrix_sub__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "XMatrix (_)", XMatrix_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", XMatrix_mul__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (_)", XMatrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", XMatrix_div__xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (_)", XMatrix_div__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", XMatrix_acc__x_xmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_INVERSE_METHOD, "XMatrix ()", XMatrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float (_)", XMatrix_norm__x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_NORM_METHOD, "Float ()", XMatrix_norm, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", XMatrix_sum, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRACE_METHOD, "Float ()", XMatrix_trace, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_TRANSPOSE_METHOD, "XMatrix ()", XMatrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_INNER_METHOD, "Float (XMatrix)", XMatrix_inner, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_OUTER_METHOD, "XMatrix (XMatrix)", XMatrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENVALUES_METHOD, "Tuple ()", XMatrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_EIGENSYSTEM_METHOD, "Tuple ()", XMatrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_SVD_METHOD, "Tuple ()", XMatrix_svd, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_QR_METHOD, "Tuple ()", XMatrix_qr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_RESHAPE_METHOD, "(Int,Int)", XMatrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int)", XMatrix_roll__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(XMATRIX_ROLL_METHOD, "XMatrix (Int,Int)", XMatrix_roll__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", XMatrix_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", XMatrix_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(XMATRIX_DIMENSIONS_METHOD, "Tuple ()", XMatrix_dimensions, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index_int_int, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "XMatrix (_,_)", Matrix_index_x_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,XMatrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "XMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "XMatrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", Matrix_sum, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "XMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (XMatrix)", Matrix_inner, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "XMatrix (XMatrix)", Matrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "XMatrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "XMatrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** @@ -1471,18 +1471,18 @@ void matrix_initialize(void) { objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); - value xmatrixclass=builtin_addclass(XMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), objclass); + value xmatrixclass=builtin_addclass(MATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), objclass); object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (XMatrix)", matrix_constructor__xmatrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "XMatrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (XMatrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(XMATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); complematrix_initialize(); } diff --git a/newlinalg/src/matrix.h b/newlinalg/src/matrix.h index 4ceb4c65c..b4d800836 100644 --- a/newlinalg/src/matrix.h +++ b/newlinalg/src/matrix.h @@ -72,10 +72,10 @@ typedef value (*matrix_getelfn_t) (vm *, double *); typedef linalgError_t (*matrix_setelfn_t) (vm *, value, double *); typedef enum { - XMATRIX_NORM_MAX, - XMATRIX_NORM_L1, - XMATRIX_NORM_INF, - XMATRIX_NORM_FROBENIUS, + MATRIX_NORM_MAX, + MATRIX_NORM_L1, + MATRIX_NORM_INF, + MATRIX_NORM_FROBENIUS, } matrix_norm_t; /** Convert matrix_norm_t to a character for use with lapack routines */ @@ -132,72 +132,72 @@ matrixinterfacedefn *matrix_getinterface(objectxmatrix *a); * Matrix veneer class * ------------------------------------------------------- */ -#define XMATRIX_CLASSNAME "XMatrix" - -#define XMATRIX_GETCOLUMN_METHOD "column" -#define XMATRIX_DIMENSIONS_METHOD "dimensions" -#define XMATRIX_EIGENVALUES_METHOD "eigenvalues" -#define XMATRIX_EIGENSYSTEM_METHOD "eigensystem" -#define XMATRIX_SVD_METHOD "svd" -#define XMATRIX_QR_METHOD "qr" -#define XMATRIX_INNER_METHOD "inner" -#define XMATRIX_INVERSE_METHOD "inverse" -#define XMATRIX_NORM_METHOD "norm" -#define XMATRIX_OUTER_METHOD "outer" -#define XMATRIX_RESHAPE_METHOD "reshape" -#define XMATRIX_ROLL_METHOD "roll" -#define XMATRIX_SETCOLUMN_METHOD "setColumn" -#define XMATRIX_TRACE_METHOD "trace" -#define XMATRIX_TRANSPOSE_METHOD "transpose" - -#define XMATRIX_IDENTITYCONSTRUCTOR "IdentityXMatrix" +#define MATRIX_CLASSNAME "XMatrix" + +#define MATRIX_GETCOLUMN_METHOD "column" +#define MATRIX_DIMENSIONS_METHOD "dimensions" +#define MATRIX_EIGENVALUES_METHOD "eigenvalues" +#define MATRIX_EIGENSYSTEM_METHOD "eigensystem" +#define MATRIX_SVD_METHOD "svd" +#define MATRIX_QR_METHOD "qr" +#define MATRIX_INNER_METHOD "inner" +#define MATRIX_INVERSE_METHOD "inverse" +#define MATRIX_NORM_METHOD "norm" +#define MATRIX_OUTER_METHOD "outer" +#define MATRIX_RESHAPE_METHOD "reshape" +#define MATRIX_ROLL_METHOD "roll" +#define MATRIX_SETCOLUMN_METHOD "setColumn" +#define MATRIX_TRACE_METHOD "trace" +#define MATRIX_TRANSPOSE_METHOD "transpose" + +#define MATRIX_IDENTITYCONSTRUCTOR "IdentityXMatrix" void matrix_initialize(void); #define IMPLEMENTATIONFN(fn) value fn (vm *v, int nargs, value *args) -IMPLEMENTATIONFN(matrix_constructor__xmatrix); - -IMPLEMENTATIONFN(XMatrix_print); -IMPLEMENTATIONFN(XMatrix_format); -IMPLEMENTATIONFN(XMatrix_assign); -IMPLEMENTATIONFN(XMatrix_clone); - -IMPLEMENTATIONFN(XMatrix_index__int); -IMPLEMENTATIONFN(XMatrix_index__int_int); -IMPLEMENTATIONFN(XMatrix_index__x_x); -IMPLEMENTATIONFN(XMatrix_setindex__int_x); -IMPLEMENTATIONFN(XMatrix_setindex__int_int_x); -IMPLEMENTATIONFN(XMatrix_setindex__x_x_xmatrix); - -IMPLEMENTATIONFN(XMatrix_getcolumn__int); -IMPLEMENTATIONFN(XMatrix_setcolumn__int_xmatrix); - -IMPLEMENTATIONFN(XMatrix_add__xmatrix); -IMPLEMENTATIONFN(XMatrix_add__nil); -IMPLEMENTATIONFN(XMatrix_add__x); -IMPLEMENTATIONFN(XMatrix_sub__xmatrix); -IMPLEMENTATIONFN(XMatrix_sub__x); -IMPLEMENTATIONFN(XMatrix_subr__x); -IMPLEMENTATIONFN(XMatrix_mul__float); -IMPLEMENTATIONFN(XMatrix_div__float); -IMPLEMENTATIONFN(XMatrix_div__xmatrix); -IMPLEMENTATIONFN(XMatrix_acc__x_xmatrix); - -IMPLEMENTATIONFN(XMatrix_norm__x); -IMPLEMENTATIONFN(XMatrix_norm); -IMPLEMENTATIONFN(XMatrix_sum); -IMPLEMENTATIONFN(XMatrix_transpose); -IMPLEMENTATIONFN(XMatrix_eigenvalues); -IMPLEMENTATIONFN(XMatrix_eigensystem); -IMPLEMENTATIONFN(XMatrix_svd); -IMPLEMENTATIONFN(XMatrix_qr); -IMPLEMENTATIONFN(XMatrix_reshape); -IMPLEMENTATIONFN(XMatrix_roll__int); -IMPLEMENTATIONFN(XMatrix_roll__int_int); -IMPLEMENTATIONFN(XMatrix_enumerate); -IMPLEMENTATIONFN(XMatrix_count); -IMPLEMENTATIONFN(XMatrix_dimensions); +IMPLEMENTATIONFN(matrix_constructor__matrix); + +IMPLEMENTATIONFN(Matrix_print); +IMPLEMENTATIONFN(Matrix_format); +IMPLEMENTATIONFN(Matrix_assign); +IMPLEMENTATIONFN(Matrix_clone); + +IMPLEMENTATIONFN(Matrix_index_int); +IMPLEMENTATIONFN(Matrix_index_int_int); +IMPLEMENTATIONFN(Matrix_index_x_x); +IMPLEMENTATIONFN(Matrix_setindex_int_x); +IMPLEMENTATIONFN(Matrix_setindex_int_int_x); +IMPLEMENTATIONFN(Matrix_setindex_x_x__matrix); + +IMPLEMENTATIONFN(Matrix_getcolumn_int); +IMPLEMENTATIONFN(Matrix_setcolumn_int__matrix); + +IMPLEMENTATIONFN(Matrix_add__matrix); +IMPLEMENTATIONFN(Matrix_add_nil); +IMPLEMENTATIONFN(Matrix_add_x); +IMPLEMENTATIONFN(Matrix_sub__matrix); +IMPLEMENTATIONFN(Matrix_sub_x); +IMPLEMENTATIONFN(Matrix_subr_x); +IMPLEMENTATIONFN(Matrix_mul_float); +IMPLEMENTATIONFN(Matrix_div_float); +IMPLEMENTATIONFN(Matrix_div__matrix); +IMPLEMENTATIONFN(Matrix_acc_x_x__matrix); + +IMPLEMENTATIONFN(Matrix_norm_x); +IMPLEMENTATIONFN(Matrix_norm); +IMPLEMENTATIONFN(Matrix_sum); +IMPLEMENTATIONFN(Matrix_transpose); +IMPLEMENTATIONFN(Matrix_eigenvalues); +IMPLEMENTATIONFN(Matrix_eigensystem); +IMPLEMENTATIONFN(Matrix_svd); +IMPLEMENTATIONFN(Matrix_qr); +IMPLEMENTATIONFN(Matrix_reshape); +IMPLEMENTATIONFN(Matrix_roll_int); +IMPLEMENTATIONFN(Matrix_roll_int_int); +IMPLEMENTATIONFN(Matrix_enumerate); +IMPLEMENTATIONFN(Matrix_count); +IMPLEMENTATIONFN(Matrix_dimensions); #undef DECLARE_IMPLEMENTATIONFN From b2376127b2551ab7383e37352f49c9dbb0fe17dd Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 18:24:16 -0500 Subject: [PATCH 197/473] Update objectxmatrix, method signatures and a few other pieces of the X* nomenclature --- newlinalg/src/complexmatrix.c | 96 +++++----- newlinalg/src/matrix.c | 346 +++++++++++++++++----------------- newlinalg/src/matrix.h | 68 +++---- 3 files changed, 255 insertions(+), 255 deletions(-) diff --git a/newlinalg/src/complexmatrix.c b/newlinalg/src/complexmatrix.c index ecb8a4558..89f2d8b48 100644 --- a/newlinalg/src/complexmatrix.c +++ b/newlinalg/src/complexmatrix.c @@ -18,7 +18,7 @@ objecttype objectcomplexmatrixtype; #define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype -typedef objectxmatrix objectcomplexmatrix; +typedef objectmatrix objectcomplexmatrix; /* ********************************************************************** * ComplexMatrix utility functions @@ -57,7 +57,7 @@ static linalgError_t _setelfn(vm *v, value in, double *el) { } /** Evaluate norms */ -static double _normfn(objectxmatrix *a, matrix_norm_t nrm) { +static double _normfn(objectmatrix *a, matrix_norm_t nrm) { char cnrm = matrix_normtolapack(nrm); int nrows=a->nrows, ncols=a->ncols; @@ -70,7 +70,7 @@ static double _normfn(objectxmatrix *a, matrix_norm_t nrm) { } /** Low level linear solve */ -static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { +static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -84,7 +84,7 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { } /** Low level eigensolver */ -static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { +static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { int info, n=a->nrows; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -98,7 +98,7 @@ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v } /** Low level SVD */ -static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { +static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; @@ -139,7 +139,7 @@ static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx } /** Low level QR decomposition */ -static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { +static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; __LAPACK_double_complex tau[minmn]; @@ -248,19 +248,19 @@ linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t } /** Copies a real matrix x into a complex matrix y */ -static linalgError_t _stridedcopy(objectxmatrix *x, objectxmatrix *y, int offset) { +static linalgError_t _stridedcopy(objectmatrix *x, objectmatrix *y, int offset) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; cblas_dcopy((__LAPACK_int) x->ncols*x->nrows, x->elements+offset, x->nvals, y->elements, y->nvals); return LINALGERR_OK; } -linalgError_t complexmatrix_promote(objectxmatrix *x, objectcomplexmatrix *y) { +linalgError_t complexmatrix_promote(objectmatrix *x, objectcomplexmatrix *y) { return _stridedcopy(x, y, 0); } /** Copies the real part of a complex matrix y into */ -linalgError_t complexmatrix_demote(objectcomplexmatrix *x, objectxmatrix *y, bool imag) { +linalgError_t complexmatrix_demote(objectcomplexmatrix *x, objectmatrix *y, bool imag) { return _stridedcopy(x, y, (imag?1:0)); } @@ -269,7 +269,7 @@ linalgError_t complexmatrix_demote(objectcomplexmatrix *x, objectxmatrix *y, boo * ---------------------- */ /** Performs c <- alpha*(a*b) + beta*c with complex matrices */ -linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxmatrix *b, MorphoComplex beta, objectxmatrix *c) { +linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectmatrix *a, objectmatrix *b, MorphoComplex beta, objectmatrix *c) { if (!(a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, @@ -281,7 +281,7 @@ linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectxmatrix *a, objectxm } /** Scales a matrix x <- scale * x >*/ -void complematrix_scale(objectxmatrix *a, MorphoComplex scale) { +void complematrix_scale(objectmatrix *a, MorphoComplex scale) { cblas_zscal(a->nrows * a->ncols, (__LAPACK_double_complex *) &scale, (__LAPACK_double_complex *) a->elements, 1); } @@ -358,7 +358,7 @@ value complexmatrix_constructor__int(vm *v, int nargs, value *args) { } value complematrix_constructor__matrix(vm *v, int nargs, value *args) { - objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); if (new) complexmatrix_promote(a, new); @@ -367,7 +367,7 @@ value complematrix_constructor__matrix(vm *v, int nargs, value *args) { /** Constructs a complexmatrix from a list of lists or tuples */ value complexmatrix_constructor__list(vm *v, int nargs, value *args) { - objectxmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); + objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); return morpho_wrapandbind(v, (object *) new); } @@ -376,7 +376,7 @@ value complexmatrix_constructor__array(vm *v, int nargs, value *args) { objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - objectxmatrix *new = matrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); + objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); return morpho_wrapandbind(v, (object *) new); } @@ -390,8 +390,8 @@ value complexmatrix_constructor__array(vm *v, int nargs, value *args) { /** Add a vector */ static value _axpy(vm *v, int nargs, value *args, double alpha) { - objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; if (a->ncols==b->ncols && a->nrows==b->nrows) { @@ -411,7 +411,7 @@ value ComplexMatrix_add__matrix(vm *v, int nargs, value *args) { value ComplexMatrix_sub__matrix(vm *v, int nargs, value *args) { value out = _axpy(v, nargs, args, -1.0); - if (matrix_isamatrix(out)) matrix_scale(MORPHO_GETXMATRIX(out), -1.0); // -(-A + B) + if (matrix_isamatrix(out)) matrix_scale(MORPHO_GETMATRIX(out), -1.0); // -(-A + B) return out; } @@ -420,21 +420,21 @@ value ComplexMatrix_subr__matrix(vm *v, int nargs, value *args) { } value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectxmatrix *new = matrix_clone(a); + objectmatrix *new = matrix_clone(a); if (new) complematrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); return morpho_wrapandbind(v, (object *) new); } /** Multiplication by a complexmatrix or a regular matrix */ -static bool _promote(vm *v, objectxmatrix *b, objectxmatrix **bp) { // Promotes b to a complexmatrix +static bool _promote(vm *v, objectmatrix *b, objectmatrix **bp) { // Promotes b to a complexmatrix *bp=complexmatrix_new(b->nrows, b->ncols, true); if (!*bp) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } return complexmatrix_promote(b, *bp)==LINALGERR_OK; } -static value _axb(vm *v, objectxmatrix *a, objectxmatrix *b) { // Performs a*b returning a wrapped value +static value _axb(vm *v, objectmatrix *a, objectmatrix *b) { // Performs a*b returning a wrapped value if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } @@ -443,7 +443,7 @@ static value _axb(vm *v, objectxmatrix *a, objectxmatrix *b) { // Performs a*b r } static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { // Driver routine for a*b - objectxmatrix *A=MORPHO_GETXMATRIX(a), *B=MORPHO_GETXMATRIX(b), *bp=NULL; + objectmatrix *A=MORPHO_GETMATRIX(a), *B=MORPHO_GETMATRIX(b), *bp=NULL; if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } // Promote b if requested value out = (swap ? _axb(v, B, A) : _axb(v, A, B)); // Multiply, swapping arguments if requested if (bp) object_free((object *) bp); @@ -463,21 +463,21 @@ value ComplexMatrix_mulr__matrix(vm *v, int nargs, value *args) { } value ComplexMatrix_div__matrix(vm *v, int nargs, value *args) { - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; - objectxmatrix *new=matrix_clone(b); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; + objectmatrix *new=matrix_clone(b); if (new && _promote(v, A, &ap)) matrix_solve(ap, new); return morpho_wrapandbind(v, (object *) new); } value ComplexMatrix_divr__matrix(vm *v, int nargs, value *args) { - objectxmatrix *A=MORPHO_GETXMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; + objectmatrix *A=MORPHO_GETMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; if (_promote(v, b, &bp)) matrix_solve(A, bp); // Promote the matrix that will contain the solution anyway return morpho_wrapandbind(v, (object *) bp); } /** Computes the trace */ value ComplexMatrix_trace(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); MorphoComplex tr=MCBuild(0,0); LINALG_ERRCHECKVM(complexmatrix_trace(a, &tr)); objectcomplex *new = object_newcomplex(creal(tr), cimag(tr)); @@ -486,7 +486,7 @@ value ComplexMatrix_trace(vm *v, int nargs, value *args) { /** Inverts a matrix */ value ComplexMatrix_inverse(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); value out=MORPHO_NIL; objectcomplexmatrix *new = matrix_clone(a); @@ -497,8 +497,8 @@ value ComplexMatrix_inverse(vm *v, int nargs, value *args) { } static value _realimag(vm *v, int nargs, value *args, bool imag) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=matrix_new(a->nrows, a->ncols, false); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=matrix_new(a->nrows, a->ncols, false); if (new) complexmatrix_demote(a, new, imag); return morpho_wrapandbind(v, (object *) new); } @@ -514,8 +514,8 @@ value ComplexMatrix_imag(vm *v, int nargs, value *args) { } static value _conj(vm *v, int nargs, value *args, bool trans) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=matrix_clone(a); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=matrix_clone(a); if (new) { if (trans) matrix_transpose(a, new); cblas_dscal(a->nrows*a->ncols, -1.0, new->elements+1, new->nvals); @@ -539,8 +539,8 @@ value ComplexMatrix_conjTranspose(vm *v, int nargs, value *args) { /** Frobenius inner product */ value ComplexMatrix_inner(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectcomplexmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); MorphoComplex prod=MCBuild(0.0, 0.0); value out = MORPHO_NIL; @@ -554,8 +554,8 @@ value ComplexMatrix_inner(vm *v, int nargs, value *args) { /** Outer product */ value ComplexMatrix_outer(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectcomplexmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); objectcomplexmatrix *new=complexmatrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); if (new) LINALG_ERRCHECKVM(complexmatrix_r1update(MCBuild(1.0,0.0), a, b, new)); @@ -577,29 +577,29 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_se MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (XMatrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), @@ -607,11 +607,11 @@ MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_P MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "XMatrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "XMatrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Matrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Matrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (XMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (Matrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), @@ -630,7 +630,7 @@ MORPHO_ENDCLASS * ********************************************************************** */ void complexmatrix_initialize(void) { - objectcomplexmatrixtype=object_addtype(&objectxmatrixdefn); + objectcomplexmatrixtype=object_addtype(&objectmatrixdefn); matrix_addinterface(&complexmatrixdefn); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); @@ -642,7 +642,7 @@ void complexmatrix_initialize(void) { morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int)", complexmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (XMatrix)", complematrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Matrix)", complematrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/newlinalg/src/matrix.c b/newlinalg/src/matrix.c index 3c6cb68c8..8c725680d 100644 --- a/newlinalg/src/matrix.c +++ b/newlinalg/src/matrix.c @@ -25,8 +25,8 @@ void matrix_addinterface(matrixinterfacedefn *defn) { } else UNREACHABLE("Too many matrix interface definitions."); } -matrixinterfacedefn *matrix_getinterface(objectxmatrix *a) { - int iindx = a->obj.type-OBJECT_XMATRIX; +matrixinterfacedefn *matrix_getinterface(objectmatrix *a) { + int iindx = a->obj.type-OBJECT_MATRIX; if (iindxtype-OBJECT_XMATRIX; + int iindx=MORPHO_GETOBJECT(val)->type-OBJECT_MATRIX; return iindx>=0 && iindxnels; +size_t objectmatrix_sizefn(object *obj) { + return sizeof(objectmatrix)+sizeof(double) * ((objectmatrix *) obj)->nels; } void objectmatrix_printfn(object *obj, void *v) { @@ -56,21 +56,21 @@ void objectmatrix_printfn(object *obj, void *v) { morpho_printf(v, ">"); } -objecttypedefn objectxmatrixdefn = { +objecttypedefn objectmatrixdefn = { .printfn=objectmatrix_printfn, .markfn=NULL, .freefn=NULL, - .sizefn=objectxmatrix_sizefn, + .sizefn=objectmatrix_sizefn, .hashfn=NULL, .cmpfn=NULL }; /* ********************************************************************** - * XMatrix utility functions + * Matrix utility functions * ********************************************************************** */ /* ---------------------- - * XMatrix interface + * Matrix interface * ---------------------- */ static void _printelfn(vm *v, double *el) { @@ -103,7 +103,7 @@ char matrix_normtolapack(matrix_norm_t norm) { } /** Evaluate norms */ -static double _normfn(objectxmatrix *a, matrix_norm_t nrm) { +static double _normfn(objectmatrix *a, matrix_norm_t nrm) { char cnrm = matrix_normtolapack(nrm); int nrows=a->nrows, ncols=a->ncols; @@ -116,7 +116,7 @@ static double _normfn(objectxmatrix *a, matrix_norm_t nrm) { } /** Low level linear solve */ -static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { +static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -129,7 +129,7 @@ static linalgError_t _solve(objectxmatrix *a, objectxmatrix *b, int *pivot) { } /** Low level eigensolver */ -static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { +static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { int info, n=a->nrows; double wr[n], wi[n]; @@ -145,7 +145,7 @@ static linalgError_t _eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *v } /** Low level SVD */ -static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { +static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; @@ -179,7 +179,7 @@ static linalgError_t _svd(objectxmatrix *a, double *s, objectxmatrix *u, objectx } /** Low level QR decomposition without pivoting */ -static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { +static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; double tau[minmn]; @@ -239,7 +239,7 @@ static linalgError_t _qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { * Interface definition * ---------------------- */ -matrixinterfacedefn xmatrixdefn = { +matrixinterfacedefn matrixdefn = { .printelfn = _printelfn, .printeltobufffn = _printeltobufffn, .getelfn = _getelfn, @@ -256,9 +256,9 @@ matrixinterfacedefn xmatrixdefn = { * ---------------------- */ /** Create a generic matrix with given type and layout */ -objectxmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { +objectmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { MatrixCount_t nels = nrows*ncols*nvals; - objectxmatrix *new = (objectxmatrix *) object_new(sizeof(objectxmatrix) + nels*sizeof(double), type); + objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix) + nels*sizeof(double), type); if (new) { new->nrows=nrows; @@ -273,13 +273,13 @@ objectxmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_ } /** Create a new real matrix */ -objectxmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { - return matrix_newwithtype(OBJECT_XMATRIX, nrows, ncols, 1, zero); +objectmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { + return matrix_newwithtype(OBJECT_MATRIX, nrows, ncols, 1, zero); } /** Clone a matrix */ -objectxmatrix *matrix_clone(objectxmatrix *in) { - objectxmatrix *new = matrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); +objectmatrix *matrix_clone(objectmatrix *in) { + objectmatrix *new = matrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); if (new) cblas_dcopy((__LAPACK_int) in->nels, in->elements, 1, new->elements, 1); return new; @@ -308,7 +308,7 @@ static bool _length(value v, int *len) { } /** Create a matrix from a list of lists (or tuples) */ -objectxmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals) { +objectmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals) { value iel, jel; int nrows=0, ncols=0, rlen; @@ -321,7 +321,7 @@ objectxmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixI } } - objectxmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); + objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); if (!new) return NULL; for (int i=0; idimensions[0]); int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); - objectxmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); + objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); if (!new) return NULL; for (int i=0; incols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; @@ -371,7 +371,7 @@ linalgError_t matrix_setelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixId /** @brief Gets a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t matrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { +linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; @@ -380,7 +380,7 @@ linalgError_t matrix_getelement(objectxmatrix *matrix, MatrixIdx_t row, MatrixId /** @brief Gets a pointer to a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t matrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { +linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); @@ -388,7 +388,7 @@ linalgError_t matrix_getelementptr(objectxmatrix *matrix, MatrixIdx_t row, Matri } /** Copies the column col of matrix a into the column vector b */ -linalgError_t matrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { +linalgError_t matrix_getcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; @@ -397,7 +397,7 @@ linalgError_t matrix_getcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix } /** Copies the column vector b into column col of matrix a */ -linalgError_t matrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix *b) { +linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; @@ -410,7 +410,7 @@ linalgError_t matrix_setcolumn(objectxmatrix *a, MatrixIdx_t col, objectxmatrix * ---------------------- */ /** Vector addition: Performs y <- alpha*x + y */ -linalgError_t matrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { +linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); @@ -418,7 +418,7 @@ linalgError_t matrix_axpy(double alpha, objectxmatrix *x, objectxmatrix *y) { } /** Copies a matrix y <- x */ -linalgError_t matrix_copy(objectxmatrix *x, objectxmatrix *y) { +linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); @@ -426,12 +426,12 @@ linalgError_t matrix_copy(objectxmatrix *x, objectxmatrix *y) { } /** Scales a matrix x <- scale * x >*/ -void matrix_scale(objectxmatrix *x, double scale) { +void matrix_scale(objectmatrix *x, double scale) { cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); } /** Loads the identity matrix a <- I(n) */ -linalgError_t matrix_identity(objectxmatrix *x) { +linalgError_t matrix_identity(objectmatrix *x) { if (x->ncols!=x->nrows) return LINALGERR_NOT_SQUARE; memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; @@ -439,7 +439,7 @@ linalgError_t matrix_identity(objectxmatrix *x) { } /** Performs z <- alpha*(x*y) + beta*z */ -linalgError_t matrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, double beta, objectxmatrix *z) { +linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double beta, objectmatrix *z) { if (!(x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols)) return LINALGERR_INCOMPATIBLE_DIM; cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); @@ -447,7 +447,7 @@ linalgError_t matrix_mmul(double alpha, objectxmatrix *x, objectxmatrix *y, doub } /** Performs x <- alpha*x + beta */ -linalgError_t matrix_addscalar(objectxmatrix *x, double alpha, double beta) { +linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta) { for (MatrixCount_t i=0; incols*x->nrows; i++) { for (int k=0; knvals; k++) { x->elements[i*x->nvals+k]*=alpha; @@ -458,7 +458,7 @@ linalgError_t matrix_addscalar(objectxmatrix *x, double alpha, double beta) { } /** Performs y <- x^T>*/ -linalgError_t matrix_transpose(objectxmatrix *x, objectxmatrix *y) { +linalgError_t matrix_transpose(objectmatrix *x, objectmatrix *y) { if (!(x->ncols==y->nrows && x->nrows==y->ncols)) return LINALGERR_INCOMPATIBLE_DIM; for (MatrixCount_t i=0; incols; i++) { @@ -476,12 +476,12 @@ linalgError_t matrix_transpose(objectxmatrix *x, objectxmatrix *y) { * ---------------------- */ /** Computes various matrix norms */ -double matrix_norm(objectxmatrix *a, matrix_norm_t norm) { +double matrix_norm(objectmatrix *a, matrix_norm_t norm) { return matrix_getinterface(a)->normfn(a, norm); } /** Computes the sum of all elements in a matrix */ -void matrix_sum(objectxmatrix *a, double *sum) { +void matrix_sum(objectmatrix *a, double *sum) { double c[a->nvals], y, t; for (int i=0; invals; i++) { sum[i]=0; c[i]=0; } @@ -496,7 +496,7 @@ void matrix_sum(objectxmatrix *a, double *sum) { } /** Calculate the trace of a matrix */ -linalgError_t matrix_trace(objectxmatrix *a, double *out) { +linalgError_t matrix_trace(objectmatrix *a, double *out) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; *out = 0.0; for (int i = 0; i < a->nrows; i++) { @@ -511,7 +511,7 @@ linalgError_t matrix_trace(objectxmatrix *a, double *out) { * ---------------------- */ /** Finds the Frobenius inner product of two matrices */ -linalgError_t matrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { +linalgError_t matrix_inner(objectmatrix *x, objectmatrix *y, double *out) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); @@ -519,7 +519,7 @@ linalgError_t matrix_inner(objectxmatrix *x, objectxmatrix *y, double *out) { } /** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ -linalgError_t matrix_r1update(double alpha, objectxmatrix *a, objectxmatrix *b, objectxmatrix *c) { +linalgError_t matrix_r1update(double alpha, objectmatrix *a, objectmatrix *b, objectmatrix *c) { MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; @@ -528,18 +528,18 @@ linalgError_t matrix_r1update(double alpha, objectxmatrix *a, objectxmatrix *b, } /** Solve the linear system a.x = b using stack allocated memory for temporary */ -linalgError_t matrix_solvesmall(objectxmatrix *a, objectxmatrix *b) { +linalgError_t matrix_solvesmall(objectmatrix *a, objectmatrix *b) { int pivot[a->nrows]; double els[a->nels]; - objectxmatrix A = MORPHO_STATICXMATRIX(els, a->nrows, a->ncols); + objectmatrix A = MORPHO_STATICMATRIX(els, a->nrows, a->ncols); matrix_copy(a, &A); return (matrix_getinterface(a)->solvefn) (&A, b, pivot); } /** Solve the linear system a.x = b using heap allocated memory for temporary */ -linalgError_t matrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { +linalgError_t matrix_solvelarge(objectmatrix *a, objectmatrix *b) { int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); - objectxmatrix *A = matrix_clone(a); + objectmatrix *A = matrix_clone(a); linalgError_t out = LINALGERR_ALLOC; if (pivot && A) { out = (matrix_getinterface(a)->solvefn) (A, b, pivot); @@ -553,7 +553,7 @@ linalgError_t matrix_solvelarge(objectxmatrix *a, objectxmatrix *b) { * @param[in] a lhs * @param[in|out] b rhs — overwritten by the solution * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t matrix_solve(objectxmatrix *a, objectxmatrix *b) { +linalgError_t matrix_solve(objectmatrix *a, objectmatrix *b) { if (MATRIX_ISSMALL(a)) return matrix_solvesmall(a, b); else return matrix_solvelarge(a, b); } @@ -561,7 +561,7 @@ linalgError_t matrix_solve(objectxmatrix *a, objectxmatrix *b) { /** Inverts the matrix a * @param[in] a matrix to be inverted * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t matrix_inverse(objectxmatrix *a) { +linalgError_t matrix_inverse(objectmatrix *a) { int nrows=a->nrows, ncols=a->ncols, info; int pivot[nrows]; @@ -583,14 +583,14 @@ linalgError_t matrix_inverse(objectxmatrix *a) { } /** Interface to eigensystem */ -linalgError_t matrix_eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *vec) { +linalgError_t matrix_eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return LINALGERR_INCOMPATIBLE_DIM; matrix_eigenfn_t efn = matrix_getinterface(a)->eigenfn; if (!efn) return LINALGERR_NOT_SUPPORTED; - objectxmatrix *temp = matrix_clone(a); + objectmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; return efn(temp, w, vec); @@ -601,7 +601,7 @@ linalgError_t matrix_eigen(objectxmatrix *a, MorphoComplex *w, objectxmatrix *ve * ---------------------- */ /** Prints a matrix */ -void matrix_print(vm *v, objectxmatrix *m) { +void matrix_print(vm *v, objectmatrix *m) { matrixinterfacedefn *interface=matrix_getinterface(m); double *elptr; for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m @@ -616,7 +616,7 @@ void matrix_print(vm *v, objectxmatrix *m) { } /** Prints a matrix to a buffer */ -bool matrix_printtobuffer(objectxmatrix *m, char *format, varray_char *out) { +bool matrix_printtobuffer(objectmatrix *m, char *format, varray_char *out) { matrixinterfacedefn *interface=matrix_getinterface(m); double *elptr; for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m @@ -638,7 +638,7 @@ bool matrix_printtobuffer(objectxmatrix *m, char *format, varray_char *out) { * ---------------------- */ /** Rolls the matrix list */ -static void _rollflat(objectxmatrix *a, objectxmatrix *b, int nplaces) { +static void _rollflat(objectmatrix *a, objectmatrix *b, int nplaces) { MatrixCount_t N=a->nrows*a->ncols*a->nvals; MatrixCount_t n = abs(nplaces)*a->nvals; if (n>N) n = n % N; @@ -654,13 +654,13 @@ static void _rollflat(objectxmatrix *a, objectxmatrix *b, int nplaces) { } /** Copies a arow from matrix a into brow for matrix b */ -static void _copyrow(objectxmatrix *a, MatrixIdx_t arow, objectxmatrix *b, MatrixIdx_t brow) { +static void _copyrow(objectmatrix *a, MatrixIdx_t arow, objectmatrix *b, MatrixIdx_t brow) { for (MatrixIdx_t i=0; incols; i++) memcpy(b->elements+b->nvals*(i*b->nrows+brow), a->elements+a->nvals*(i*a->nrows+arow), sizeof(double)*a->nvals); } /** Rolls a list by a number of elements along a given axis; stores the result in b */ -linalgError_t matrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatrix *b) { +linalgError_t matrix_roll(objectmatrix *a, int nplaces, int axis, objectmatrix *b) { if (!(a->nrows==b->nrows && a->ncols==b->ncols && a->nvals==b->nvals)) return LINALGERR_INCOMPATIBLE_DIM; switch(axis) { @@ -679,33 +679,33 @@ linalgError_t matrix_roll(objectxmatrix *a, int nplaces, int axis, objectxmatrix } /* ********************************************************************** - * XMatrix constructors + * Matrix constructors * ********************************************************************** */ value matrix_constructor__int_int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - objectxmatrix *new=matrix_new(nrows, ncols, true); + objectmatrix *new=matrix_new(nrows, ncols, true); return morpho_wrapandbind(v, (object *) new); } value matrix_constructor__int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - objectxmatrix *new=matrix_new(nrows, 1, true); + objectmatrix *new=matrix_new(nrows, 1, true); return morpho_wrapandbind(v, (object *) new); } /** Clones a matrix */ value matrix_constructor__matrix(vm *v, int nargs, value *args) { - objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); return morpho_wrapandbind(v, (object *) matrix_clone(a)); } /** Constructs a matrix from a list of lists or tuples */ value matrix_constructor__list(vm *v, int nargs, value *args) { - objectxmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_XMATRIX, 1); + objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_MATRIX, 1); return morpho_wrapandbind(v, (object *) new); } @@ -714,7 +714,7 @@ value matrix_constructor__array(vm *v, int nargs, value *args) { objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - objectxmatrix *new = matrix_arrayconstructor(v, a, OBJECT_XMATRIX, 1); + objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_MATRIX, 1); return morpho_wrapandbind(v, (object *) new); } @@ -727,14 +727,14 @@ value matrix_constructor__err(vm *v, int nargs, value *args) { value matrix_identityconstructor(vm *v, int nargs, value *args) { MatrixIdx_t n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - objectxmatrix *new = matrix_new(n,n,false); + objectmatrix *new = matrix_new(n,n,false); if (new) matrix_identity(new); return morpho_wrapandbind(v, (object *) new); } /* ********************************************************************** - * XMatrix veneer class + * Matrix veneer class * ********************************************************************** */ /* ---------------------- @@ -743,7 +743,7 @@ value matrix_identityconstructor(vm *v, int nargs, value *args) { /** Prints a matrix */ value Matrix_print(vm *v, int nargs, value *args) { - objectxmatrix *m=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); matrix_print(v, m); return MORPHO_NIL; } @@ -754,7 +754,7 @@ value Matrix_format(vm *v, int nargs, value *args) { varray_char str; varray_charinit(&str); - if (matrix_printtobuffer(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + if (matrix_printtobuffer(MORPHO_GETMATRIX(MORPHO_SELF(args)), MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &str)) { out = object_stringfromvarraychar(&str); @@ -767,16 +767,16 @@ value Matrix_format(vm *v, int nargs, value *args) { /** Copies the contents of one matrix into another */ value Matrix_assign(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); LINALG_ERRCHECKVM(matrix_copy(b, a)); return MORPHO_NIL; } /** Clones a matrix */ value Matrix_clone(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=matrix_clone(a); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=matrix_clone(a); return morpho_wrapandbind(v, (object *) new); } @@ -785,7 +785,7 @@ value Matrix_clone(vm *v, int nargs, value *args) { * --------- */ value Matrix_index_int_int(vm *v, int nargs, value *args) { - objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); value out=MORPHO_NIL; @@ -819,7 +819,7 @@ static linalgError_t _slice_validate(value iv, value jv, MatrixIdx_t *icnt, Matr return LINALGERR_OK; } -static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx_t jcnt, objectxmatrix *a, objectxmatrix *b, bool swap) { +static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx_t jcnt, objectmatrix *a, objectmatrix *b, bool swap) { double *ael, *bel; for (MatrixIdx_t j=0; jsetelfn(v, in, elptr)); @@ -866,20 +866,20 @@ static void _setindex(vm *v, objectxmatrix *m, MatrixIdx_t i, MatrixIdx_t j, val value Matrix_setindex_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); + _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); return MORPHO_NIL; } value Matrix_setindex_int_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - _setindex(v, MORPHO_GETXMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); + _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); return MORPHO_NIL; } value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { - objectxmatrix *m = MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *msrc = MORPHO_GETXMATRIX(MORPHO_GETARG(args, 2)); + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *msrc = MORPHO_GETMATRIX(MORPHO_GETARG(args, 2)); value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); MatrixIdx_t icnt=0, jcnt=0; @@ -895,12 +895,12 @@ value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { * --------- */ value Matrix_getcolumn_int(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; if (i>=0 && incols) { - objectxmatrix *new=matrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); + objectmatrix *new=matrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); if (new) matrix_getcolumn(a, i, new); out=morpho_wrapandbind(v, (object *)new); } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); @@ -909,9 +909,9 @@ value Matrix_getcolumn_int(vm *v, int nargs, value *args) { } value Matrix_setcolumn_int__matrix(vm *v, int nargs, value *args) { - LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETXMATRIX(MORPHO_SELF(args)), + LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETMATRIX(MORPHO_SELF(args)), MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)))); + MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)))); return MORPHO_NIL; } @@ -921,9 +921,9 @@ value Matrix_setcolumn_int__matrix(vm *v, int nargs, value *args) { /** Add a vector */ static value _axpy(vm *v, int nargs, value *args, double alpha) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Receiver is left hand operand - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // Argument is right hand operand - objectxmatrix *new = NULL; + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); // Receiver is left hand operand + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); // Argument is right hand operand + objectmatrix *new = NULL; value out=MORPHO_NIL; if (a->ncols==b->ncols && a->nrows==b->nrows) { @@ -937,8 +937,8 @@ static value _axpy(vm *v, int nargs, value *args, double alpha) { /** Add a scalar */ static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new=NULL; + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=NULL; value out=MORPHO_NIL; double beta; @@ -978,23 +978,23 @@ value Matrix_subr_x(vm *v, int nargs, value *args) { } value Matrix_mul_float(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double scale; if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; - objectxmatrix *new = matrix_clone(a); + objectmatrix *new = matrix_clone(a); if (new) matrix_scale(new, scale); return morpho_wrapandbind(v, (object *) new); } value Matrix_mul__matrix(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; if (a->ncols==b->nrows) { - objectxmatrix *new = matrix_new(a->nrows, b->ncols, false); + objectmatrix *new = matrix_new(a->nrows, b->ncols, false); if (new) LINALG_ERRCHECKVM(matrix_mmul(1.0, a, b, 0.0, new)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); @@ -1002,23 +1002,23 @@ value Matrix_mul__matrix(vm *v, int nargs, value *args) { } value Matrix_div_float(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double scale; if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; scale = 1.0/scale; if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); - objectxmatrix *new = matrix_clone(a); + objectmatrix *new = matrix_clone(a); if (new) matrix_scale(new, scale); return morpho_wrapandbind(v, (object *) new); } value Matrix_div__matrix(vm *v, int nargs, value *args) { - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument - objectxmatrix *sol = matrix_clone(b); + objectmatrix *sol = matrix_clone(b); if (sol) LINALG_ERRCHECKVM(matrix_solve(a, sol)); return morpho_wrapandbind(v, (object *) sol); @@ -1026,8 +1026,8 @@ value Matrix_div__matrix(vm *v, int nargs, value *args) { /** Accumulate in place */ value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 1)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); double alpha=1.0; if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, MATRIX_ARITHARGS); return MORPHO_NIL; } @@ -1042,7 +1042,7 @@ value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { /** Matrix norm */ value Matrix_norm_x(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double n; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { @@ -1058,13 +1058,13 @@ value Matrix_norm_x(vm *v, int nargs, value *args) { /** Frobenius norm */ value Matrix_norm(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); return MORPHO_FLOAT(matrix_norm(a, MATRIX_NORM_FROBENIUS)); } /** Sums all matrix values */ value Matrix_sum(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double sum[a->nvals]; matrix_sum(a, sum); @@ -1073,7 +1073,7 @@ value Matrix_sum(vm *v, int nargs, value *args) { /** Computes the trace */ value Matrix_trace(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double out=0.0; LINALG_ERRCHECKVM(matrix_trace(a, &out)); return MORPHO_FLOAT(out); @@ -1081,8 +1081,8 @@ value Matrix_trace(vm *v, int nargs, value *args) { /** Inverts a matrix */ value Matrix_transpose(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new = matrix_clone(a); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new = matrix_clone(a); if (new) { new->ncols=a->nrows; new->nrows=a->ncols; @@ -1093,8 +1093,8 @@ value Matrix_transpose(vm *v, int nargs, value *args) { /** Inverts a matrix */ value Matrix_inverse(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *new = matrix_clone(a); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new = matrix_clone(a); if (new) LINALG_ERRCHECKVM(matrix_inverse(new)); return morpho_wrapandbind(v, (object *) new); @@ -1130,7 +1130,7 @@ static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *o /** Finds the eigenvalues of a matrix */ value Matrix_eigenvalues(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); value out = MORPHO_NIL; MatrixIdx_t n=a->ncols; @@ -1149,10 +1149,10 @@ value Matrix_eigenvalues(vm *v, int nargs, value *args) { /** Finds the eigenvalues and eigenvectors of a matrix */ value Matrix_eigensystem(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); value ev=MORPHO_NIL; // Will hold eigenvalues - objectxmatrix *evec=NULL; // Holds eigenvectors + objectmatrix *evec=NULL; // Holds eigenvectors objecttuple *otuple=NULL; // Tuple to return everything MatrixIdx_t n=a->ncols; @@ -1191,11 +1191,11 @@ value Matrix_eigensystem(vm *v, int nargs, value *args) { * ---------------- */ /** Interface to SVD */ -linalgError_t matrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxmatrix *vt) { +linalgError_t matrix_svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { if (u && ((a->nrows != u->nrows) || (a->nrows != u->ncols))) return LINALGERR_INCOMPATIBLE_DIM; if (vt && ((a->ncols != vt->nrows) || (a->ncols != vt->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - objectxmatrix *temp = matrix_clone(a); + objectmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; linalgError_t err = matrix_getinterface(a)->svdfn (temp, s, u, vt); @@ -1208,11 +1208,11 @@ linalgError_t matrix_svd(objectxmatrix *a, double *s, objectxmatrix *u, objectxm * ---------------- */ /** Interface to QR decomposition */ -linalgError_t matrix_qr(objectxmatrix *a, objectxmatrix *q, objectxmatrix *r) { +linalgError_t matrix_qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { if (q && ((a->nrows != q->nrows) || (a->nrows != q->ncols))) return LINALGERR_INCOMPATIBLE_DIM; if (r && ((a->nrows != r->nrows) || (a->ncols != r->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - objectxmatrix *temp = matrix_clone(a); + objectmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; linalgError_t err = matrix_getinterface(a)->qrfn (temp, q, r); @@ -1235,11 +1235,11 @@ static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) #define _CHK_SVD(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _svd_cleanup; } /** Singular Value Decomposition */ value Matrix_svd(vm *v, int nargs, value *args) { - objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); value s = MORPHO_NIL; // Will hold singular values - objectxmatrix *u = NULL; // Left singular vectors - objectxmatrix *vt = NULL; // Right singular vectors (transposed) + objectmatrix *u = NULL; // Left singular vectors + objectmatrix *vt = NULL; // Right singular vectors (transposed) objecttuple *otuple = NULL; // Tuple to return everything MatrixIdx_t m = a->nrows, n = a->ncols; @@ -1281,10 +1281,10 @@ value Matrix_svd(vm *v, int nargs, value *args) { #define _CHK_QR(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _qr_cleanup; } /** QR Decomposition */ value Matrix_qr(vm *v, int nargs, value *args) { - objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectxmatrix *q = NULL; // Orthogonal matrix Q - objectxmatrix *r = NULL; // Upper triangular matrix R + objectmatrix *q = NULL; // Orthogonal matrix Q + objectmatrix *r = NULL; // Upper triangular matrix R objecttuple *otuple = NULL; // Tuple to return everything MatrixIdx_t m = a->nrows, n = a->ncols; @@ -1320,8 +1320,8 @@ value Matrix_qr(vm *v, int nargs, value *args) { /** Frobenius inner product */ value Matrix_inner(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); double prod=0.0; LINALG_ERRCHECKVM(matrix_inner(a, b, &prod)); @@ -1331,10 +1331,10 @@ value Matrix_inner(vm *v, int nargs, value *args) { /** Outer product */ value Matrix_outer(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); - objectxmatrix *b=MORPHO_GETXMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - objectxmatrix *new=matrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); + objectmatrix *new=matrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); if (new) LINALG_ERRCHECKVM(matrix_r1update(1.0, a, b, new)); return morpho_wrapandbind(v, (object *) new); @@ -1346,7 +1346,7 @@ value Matrix_outer(vm *v, int nargs, value *args) { /** Reshape a matrix */ value Matrix_reshape(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -1358,15 +1358,15 @@ value Matrix_reshape(vm *v, int nargs, value *args) { return MORPHO_NIL; } -static value _roll(vm *v, objectxmatrix *a, int roll, int axis) { - objectxmatrix *new = matrix_clone(a); +static value _roll(vm *v, objectmatrix *a, int roll, int axis) { + objectmatrix *new = matrix_clone(a); if (new) matrix_roll(a, roll, axis, new); return morpho_wrapandbind(v, (object *) new); } /** Roll a matrix */ value Matrix_roll_int_int(vm *v, int nargs, value *args) { - objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), axis = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); return _roll(v, a, roll, axis); @@ -1374,14 +1374,14 @@ value Matrix_roll_int_int(vm *v, int nargs, value *args) { /** Roll a matrix by row */ value Matrix_roll_int(vm *v, int nargs, value *args) { - objectxmatrix *a = MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); return _roll(v, a, roll, 0); } /** Enumerate protocol */ value Matrix_enumerate(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; @@ -1398,13 +1398,13 @@ value Matrix_enumerate(vm *v, int nargs, value *args) { /** Number of matrix elements */ value Matrix_count(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); return MORPHO_INTEGER(a->ncols*a->nrows); } /** Matrix dimensions */ value Matrix_dimensions(vm *v, int nargs, value *args) { - objectxmatrix *a=MORPHO_GETXMATRIX(MORPHO_SELF(args)); + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); value dim[2] = { MORPHO_INTEGER(a->nrows), MORPHO_INTEGER(a->ncols) }; objecttuple *new=object_newtuple(2, dim); @@ -1412,49 +1412,49 @@ value Matrix_dimensions(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } -MORPHO_BEGINCLASS(XMatrix) +MORPHO_BEGINCLASS(Matrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(XMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "XMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(Matrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index_int_int, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "XMatrix (_,_)", Matrix_index_x_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index_x_x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,XMatrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "XMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, XMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (XMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "XMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "XMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (XMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "XMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "XMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "XMatrix (XMatrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "XMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (XMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "XMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, XMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "XMatrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Matrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (Matrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (Matrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "Matrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", Matrix_sum, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "XMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (XMatrix)", Matrix_inner, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "XMatrix (XMatrix)", Matrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "Matrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (Matrix)", Matrix_inner, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "Matrix (Matrix)", Matrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "XMatrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "XMatrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) @@ -1465,24 +1465,24 @@ MORPHO_ENDCLASS * ********************************************************************** */ void matrix_initialize(void) { - objectxmatrixtype=object_addtype(&objectxmatrixdefn); - matrix_addinterface(&xmatrixdefn); + objectmatrixtype=object_addtype(&objectmatrixdefn); + matrix_addinterface(&matrixdefn); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); - value xmatrixclass=builtin_addclass(MATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(XMatrix), objclass); - object_setveneerclass(OBJECT_XMATRIX, xmatrixclass); + value matrixclass=builtin_addclass(MATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(Matrix), objclass); + object_setveneerclass(OBJECT_MATRIX, matrixclass); - morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (XMatrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "XMatrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Matrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "XMatrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); complematrix_initialize(); } diff --git a/newlinalg/src/matrix.h b/newlinalg/src/matrix.h index b4d800836..7fa15bd3b 100644 --- a/newlinalg/src/matrix.h +++ b/newlinalg/src/matrix.h @@ -13,10 +13,10 @@ * Matrix object type * ------------------------------------------------------- */ -extern objecttype objectxmatrixtype; -#define OBJECT_XMATRIX objectxmatrixtype +extern objecttype objectmatrixtype; +#define OBJECT_MATRIX objectmatrixtype -extern objecttypedefn objectxmatrixdefn; +extern objecttypedefn objectmatrixdefn; typedef int MatrixIdx_t; // Type used for matrix indices typedef size_t MatrixCount_t; // Type used to count total number of elements @@ -35,17 +35,17 @@ typedef struct { MatrixCount_t nels; // Total number of entries (nrows*ncols*nvals) double *elements; double matrixdata[]; -} objectxmatrix; +} objectmatrix; /** Tests whether an object is a matrix */ -#define MORPHO_ISXMATRIX(val) object_istype(val, OBJECT_XMATRIX) +#define MORPHO_ISMATRIX(val) object_istype(val, OBJECT_MATRIX) /** Gets the object as an matrix */ -#define MORPHO_GETXMATRIX(val) ((objectxmatrix *) MORPHO_GETOBJECT(val)) +#define MORPHO_GETMATRIX(val) ((objectmatrix *) MORPHO_GETOBJECT(val)) /** @brief Use to create static matrices on the C stack @details Intended for small matrices; Caller needs to supply a double array of size nr*nc. */ -#define MORPHO_STATICXMATRIX(darray, nr, nc) { .obj.type=OBJECT_XMATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nels=nr*nc } +#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nels=nr*nc } /** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ #define MATRIX_ISSMALL(m) (m->nrows*m->ncols Date: Wed, 14 Jan 2026 19:16:03 -0500 Subject: [PATCH 198/473] Transfer new libary into the source tree --- src/linalg/CMakeLists.txt | 4 + src/linalg/complexmatrix.c | 649 ++++++++++ src/linalg/complexmatrix.h | 20 + src/linalg/matrix.c | 2361 +++++++++++++++++------------------- src/linalg/matrix.h | 321 ++--- src/linalg/newlinalg.c | 52 + src/linalg/newlinalg.h | 93 ++ src/linalg/xmatrix.c | 1585 ++++++++++++++++++++++++ src/linalg/xmatrix.h | 205 ++++ 9 files changed, 3916 insertions(+), 1374 deletions(-) create mode 100644 src/linalg/complexmatrix.c create mode 100644 src/linalg/complexmatrix.h create mode 100644 src/linalg/newlinalg.c create mode 100644 src/linalg/newlinalg.h create mode 100644 src/linalg/xmatrix.c create mode 100644 src/linalg/xmatrix.h diff --git a/src/linalg/CMakeLists.txt b/src/linalg/CMakeLists.txt index b767d8fe9..98b7f0b7f 100644 --- a/src/linalg/CMakeLists.txt +++ b/src/linalg/CMakeLists.txt @@ -1,5 +1,7 @@ target_sources(morpho PRIVATE + complexmatrix.c complexmatrix.h + linalg.c linalg.h matrix.c matrix.h sparse.c sparse.h ) @@ -9,6 +11,8 @@ target_sources(morpho FILE_SET public_headers TYPE HEADERS FILES + linalg.h matrix.h + complexmatrix.h sparse.h ) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c new file mode 100644 index 000000000..89f2d8b48 --- /dev/null +++ b/src/linalg/complexmatrix.c @@ -0,0 +1,649 @@ +/** @file complexmatrix.c + * @author T J Atherton + * + * @brief New linear algebra library +*/ + +#define ACCELERATE_NEW_LAPACK +#define MORPHO_INCLUDE_LINALG + +#include + +#include "newlinalg.h" +#include "matrix.h" +#include "complexmatrix.h" +#include "format.h" +#include "cmplx.h" + +objecttype objectcomplexmatrixtype; +#define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype + +typedef objectmatrix objectcomplexmatrix; + +/* ********************************************************************** + * ComplexMatrix utility functions + * ********************************************************************** */ + +/* ---------------------- + * Callbacks + * ---------------------- */ + +static void _printelfn(vm *v, double *el) { + objectcomplex cmplx = MORPHO_STATICCOMPLEX(el[0], el[1]); + complex_print(v, &cmplx); +} + +static bool _printeltobufffn(varray_char *out, char *format, double *el) { + if (!format_printtobuffer(MORPHO_FLOAT(el[0]), format, out)) return false; + varray_charadd(out, " ", 1); + varray_charadd(out, (el[1]<0 ? "-" : "+"), 1); + if (!format_printtobuffer(MORPHO_FLOAT(fabs(el[1])), format, out)) return false; + varray_charadd(out, "im", 2); + return true; +} + +static value _getelfn(vm *v, double *el) { + objectcomplex *new = object_newcomplex(el[0], el[1]); + return morpho_wrapandbind(v, (object *) new); +} + +static linalgError_t _setelfn(vm *v, value in, double *el) { + if (MORPHO_ISCOMPLEX(in)) { + *((MorphoComplex *) el) = MORPHO_GETCOMPLEX(in)->Z; + } else if (morpho_valuetofloat(in, el)) { + el[1] = 0.0; // Set imaginary part to zero + } else return LINALGERR_NON_NUMERICAL; + return LINALGERR_OK; +} + +/** Evaluate norms */ +static double _normfn(objectmatrix *a, matrix_norm_t nrm) { + char cnrm = matrix_normtolapack(nrm); + int nrows=a->nrows, ncols=a->ncols; + +#ifdef MORPHO_LINALG_USE_LAPACKE + return LAPACKE_zlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); +#else + double work[a->nrows]; + return zlange_(&cnrm, &nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, work); +#endif +} + +/** Low level linear solve */ +static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); +#else + zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, + &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); +} + +/** Low level eigensolver */ +static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { + int info, n=a->nrows; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, (__LAPACK_double_complex *) w, NULL, n, (vec ? vec->elements : NULL), n); +#else + int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; + zgeev_("N", (vec ? "V" : "N"), &n, (__LAPACK_double_complex *) a->elements, &n, (__LAPACK_double_complex *) w, NULL, &n, (__LAPACK_double_complex *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + +/** Low level SVD */ +static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_zgesvd(LAPACK_COL_MAJOR, + (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U + (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT + m, n, + (__LAPACK_double_complex *) a->elements, m, // input matrix A (overwritten) + s, // singular values (min(m,n)) + (__LAPACK_double_complex *) (u ? u->elements : NULL), m, // U matrix (m×m) + (__LAPACK_double_complex *) (vt ? vt->elements : NULL), n // VT matrix (n×n) + ); +#else + int lwork = -1; + __LAPACK_double_complex work_query; + double rwork[5 * minmn]; // rwork needs at least 5*min(m,n) for zgesvd + + // Query optimal work size + zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, + (__LAPACK_double_complex *) a->elements, &m, s, + (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, + (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, + &work_query, &lwork, rwork, &info); + + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork = (int)creal(work_query); + __LAPACK_double_complex work[lwork]; + zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, + (__LAPACK_double_complex *) a->elements, &m, s, + (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, + (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, + work, &lwork, rwork, &info); +#endif + + return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + +/** Low level QR decomposition */ +static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + __LAPACK_double_complex tau[minmn]; + + // Compute QR factorization without pivoting: A = Q*R +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_zgeqrf(LAPACK_COL_MAJOR, m, n, (__LAPACK_double_complex *) a->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + int lwork = -1; + __LAPACK_double_complex work_query; + + // Query optimal work size for ZGEQRF, which is reused for ZUNGQR + zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + int lwork_geqrf = (int) creal(work_query); + __LAPACK_double_complex work[lwork_geqrf]; + lwork = lwork_geqrf; + + // Compute QR factorization without pivoting + zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // Extract R (upper triangle of a) into r + // Copy entire matrix first then zero out below the diagonal + matrix_copy(a, r); + __LAPACK_double_complex *relems = (__LAPACK_double_complex *) r->elements; + for (int j = 0; j < n && j < m - 1; j++) { + memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(__LAPACK_double_complex)); + } + + // Generate Q from reflectors + if (q) { + // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) + // ZGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns + __LAPACK_double_complex *aelems = (__LAPACK_double_complex *) a->elements; + __LAPACK_double_complex *qelems = (__LAPACK_double_complex *) q->elements; + for (int j = 0; j < n; j++) { + cblas_zcopy(m, &aelems[j * m], 1, &qelems[j * m], 1); + } + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, minmn, minmn, (__LAPACK_double_complex *) q->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + lwork = lwork_geqrf; + zungqr_(&m, &minmn, &minmn, (__LAPACK_double_complex *) q->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // If Q should be m×m, zero out remaining columns if m > minmn + if (m > minmn) memset(&q->elements[minmn * m * q->nvals], 0, (m - minmn) * m * sizeof(__LAPACK_double_complex)); + } + + return LINALGERR_OK; +} + +/* ---------------------- + * Interface definition + * ---------------------- */ + +matrixinterfacedefn complexmatrixdefn = { + .printelfn = _printelfn, + .printeltobufffn = _printeltobufffn, + .getelfn = _getelfn, + .setelfn = _setelfn, + .normfn = _normfn, + .solvefn = _solve, + .eigenfn = _eigen, + .svdfn = _svd, + .qrfn = _qr +}; + +/* ---------------------- + * Constructor + * ---------------------- */ + +/** Create a new complex matrix */ +objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { + return (objectcomplexmatrix *) matrix_newwithtype(OBJECT_COMPLEXMATRIX, nrows, ncols, 2, zero); +} + +/* ---------------------- + * Element access + * ---------------------- */ + +/** Sets a matrix element. */ +linalgError_t complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; + + MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); + matrix->elements[ix]=creal(value); + matrix->elements[ix+1]=cimag(value); + return LINALGERR_OK; +} + +/** Gets a matrix element */ +linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; + + MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); + if (value) *value=MCBuild(matrix->elements[ix],matrix->elements[ix+1]); + return LINALGERR_OK; +} + +/** Copies a real matrix x into a complex matrix y */ +static linalgError_t _stridedcopy(objectmatrix *x, objectmatrix *y, int offset) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dcopy((__LAPACK_int) x->ncols*x->nrows, x->elements+offset, x->nvals, y->elements, y->nvals); + return LINALGERR_OK; +} + +linalgError_t complexmatrix_promote(objectmatrix *x, objectcomplexmatrix *y) { + return _stridedcopy(x, y, 0); +} + +/** Copies the real part of a complex matrix y into */ +linalgError_t complexmatrix_demote(objectcomplexmatrix *x, objectmatrix *y, bool imag) { + return _stridedcopy(x, y, (imag?1:0)); +} + +/* ---------------------- + * Complex arithmetic + * ---------------------- */ + +/** Performs c <- alpha*(a*b) + beta*c with complex matrices */ +linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectmatrix *a, objectmatrix *b, MorphoComplex beta, objectmatrix *c) { + if (!(a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, + a->nrows, b->ncols, a->ncols, + &alpha, (__LAPACK_double_complex *) a->elements, + a->nrows, (__LAPACK_double_complex *) b->elements, b->nrows, + &beta, (__LAPACK_double_complex *) c->elements, c->nrows); + return LINALGERR_OK; +} + +/** Scales a matrix x <- scale * x >*/ +void complematrix_scale(objectmatrix *a, MorphoComplex scale) { + cblas_zscal(a->nrows * a->ncols, (__LAPACK_double_complex *) &scale, (__LAPACK_double_complex *) a->elements, 1); +} + +/** Finds the Frobenius inner product of two complex matrices (a, b) = \sum_{i,j} conj(a)_ij * b_ij */ +linalgError_t complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { + if (!(a->ncols==b->ncols && a->nrows==b->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_zdotc_sub(a->nrows * a->ncols, (__LAPACK_double_complex *) a->elements, 1, + (__LAPACK_double_complex *) b->elements, 1, + (__LAPACK_double_complex *) out); + return LINALGERR_OK; +} + +/** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ +linalgError_t complexmatrix_r1update(MorphoComplex alpha, objectcomplexmatrix *a, objectcomplexmatrix *b, objectcomplexmatrix *c) { + MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; + if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_zgeru(CblasColMajor, m, n, (__LAPACK_double_complex *) &alpha, (__LAPACK_double_complex *) a->elements, 1, + (__LAPACK_double_complex *) b->elements, 1, + (__LAPACK_double_complex *) c->elements, c->nrows); + return LINALGERR_OK; +} + +/** Calculate the trace of a matrix */ +linalgError_t complexmatrix_trace(objectcomplexmatrix *a, MorphoComplex *out) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + MorphoComplex one = MCBuild(1.0, 0.0); + cblas_zdotu_sub(a->nrows, (__LAPACK_double_complex *) a->elements, a->ncols+1, (__LAPACK_double_complex *) &one, 0, (__LAPACK_double_complex *) out); + return LINALGERR_OK; +} + +/** Inverts the matrix a + * @param[in] a matrix to be inverted + * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ +linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { + int nrows=a->nrows, ncols=a->ncols, info; + int pivot[nrows]; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); +#else + zgetrf_(&nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, pivot, &info); +#endif + if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_zgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); +#else + int lwork=nrows*ncols; __LAPACK_double_complex work[nrows*ncols]; + zgetri_(&nrows, (__LAPACK_double_complex *) a->elements, &nrows, pivot, work, &lwork, &info); +#endif + + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); +} + +/* ********************************************************************** + * ComplexMatrix constructors + * ********************************************************************** */ + +value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + MatrixIdx_t ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + + objectcomplexmatrix *new=complexmatrix_new(nrows, ncols, true); + return morpho_wrapandbind(v, (object *) new); +} + +value complexmatrix_constructor__int(vm *v, int nargs, value *args) { + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + objectcomplexmatrix *new=complexmatrix_new(nrows, 1, true); + return morpho_wrapandbind(v, (object *) new); +} + +value complematrix_constructor__matrix(vm *v, int nargs, value *args) { + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); + if (new) complexmatrix_promote(a, new); + return morpho_wrapandbind(v, (object *) new); +} + +/** Constructs a complexmatrix from a list of lists or tuples */ +value complexmatrix_constructor__list(vm *v, int nargs, value *args) { + objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); + return morpho_wrapandbind(v, (object *) new); +} + +/** Constructs a matrix from an array */ +value complexmatrix_constructor__array(vm *v, int nargs, value *args) { + objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); + if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + + objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); + return morpho_wrapandbind(v, (object *) new); +} + +/* ********************************************************************** + * ComplexMatrix veneer class + * ********************************************************************** */ + +/* ---------------------- + * Arithmetic + * ---------------------- */ + +/** Add a vector */ +static value _axpy(vm *v, int nargs, value *args, double alpha) { + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + + if (a->ncols==b->ncols && a->nrows==b->nrows) { + objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); + if (new) { + complexmatrix_promote(b, new); + matrix_axpy(alpha, a, new); + } + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); + return out; +} + +value ComplexMatrix_add__matrix(vm *v, int nargs, value *args) { + return _axpy(v, nargs, args, 1.0); +} + +value ComplexMatrix_sub__matrix(vm *v, int nargs, value *args) { + value out = _axpy(v, nargs, args, -1.0); + if (matrix_isamatrix(out)) matrix_scale(MORPHO_GETMATRIX(out), -1.0); // -(-A + B) + return out; +} + +value ComplexMatrix_subr__matrix(vm *v, int nargs, value *args) { + return _axpy(v, nargs, args, -1.0); +} + +value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + + objectmatrix *new = matrix_clone(a); + if (new) complematrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); + return morpho_wrapandbind(v, (object *) new); +} + +/** Multiplication by a complexmatrix or a regular matrix */ +static bool _promote(vm *v, objectmatrix *b, objectmatrix **bp) { // Promotes b to a complexmatrix + *bp=complexmatrix_new(b->nrows, b->ncols, true); + if (!*bp) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } + return complexmatrix_promote(b, *bp)==LINALGERR_OK; +} + +static value _axb(vm *v, objectmatrix *a, objectmatrix *b) { // Performs a*b returning a wrapped value + if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } + objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + complexmatrix_mmul(MCBuild(1.0, 0.0), a, b, MCBuild(0.0, 0.0), new); + return morpho_wrapandbind(v, (object *) new); +} + +static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { // Driver routine for a*b + objectmatrix *A=MORPHO_GETMATRIX(a), *B=MORPHO_GETMATRIX(b), *bp=NULL; + if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } // Promote b if requested + value out = (swap ? _axb(v, B, A) : _axb(v, A, B)); // Multiply, swapping arguments if requested + if (bp) object_free((object *) bp); + return out; +} + +value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { + return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), false, false); +} + +value ComplexMatrix_mul__matrix(vm *v, int nargs, value *args) { + return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, false); +} + +value ComplexMatrix_mulr__matrix(vm *v, int nargs, value *args) { + return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, true); +} + +value ComplexMatrix_div__matrix(vm *v, int nargs, value *args) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; + objectmatrix *new=matrix_clone(b); + if (new && _promote(v, A, &ap)) matrix_solve(ap, new); + return morpho_wrapandbind(v, (object *) new); +} + +value ComplexMatrix_divr__matrix(vm *v, int nargs, value *args) { + objectmatrix *A=MORPHO_GETMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; + if (_promote(v, b, &bp)) matrix_solve(A, bp); // Promote the matrix that will contain the solution anyway + return morpho_wrapandbind(v, (object *) bp); +} + +/** Computes the trace */ +value ComplexMatrix_trace(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + MorphoComplex tr=MCBuild(0,0); + LINALG_ERRCHECKVM(complexmatrix_trace(a, &tr)); + objectcomplex *new = object_newcomplex(creal(tr), cimag(tr)); + return morpho_wrapandbind(v, (object *) new); +} + +/** Inverts a matrix */ +value ComplexMatrix_inverse(vm *v, int nargs, value *args) { + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + objectcomplexmatrix *new = matrix_clone(a); + out = morpho_wrapandbind(v, (object *) new); + if (new) LINALG_ERRCHECKVM(complexmatrix_inverse(new)); + + return out; +} + +static value _realimag(vm *v, int nargs, value *args, bool imag) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=matrix_new(a->nrows, a->ncols, false); + if (new) complexmatrix_demote(a, new, imag); + return morpho_wrapandbind(v, (object *) new); +} + +/** Extract real part */ +value ComplexMatrix_real(vm *v, int nargs, value *args) { + return _realimag(v, nargs, args, false); +} + +/** Extract imaginary part */ +value ComplexMatrix_imag(vm *v, int nargs, value *args) { + return _realimag(v, nargs, args, true); +} + +static value _conj(vm *v, int nargs, value *args, bool trans) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=matrix_clone(a); + if (new) { + if (trans) matrix_transpose(a, new); + cblas_dscal(a->nrows*a->ncols, -1.0, new->elements+1, new->nvals); + } + return morpho_wrapandbind(v, (object *) new); +} + +/** Extract imaginary part */ +value ComplexMatrix_conj(vm *v, int nargs, value *args) { + return _conj(v, nargs, args, false); +} + +/** Return conjugate transpose */ +value ComplexMatrix_conjTranspose(vm *v, int nargs, value *args) { + return _conj(v, nargs, args, true); +} + +/* --------- + * Products + * --------- */ + +/** Frobenius inner product */ +value ComplexMatrix_inner(vm *v, int nargs, value *args) { + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + MorphoComplex prod=MCBuild(0.0, 0.0); + value out = MORPHO_NIL; + + if (complexmatrix_inner(a, b, &prod)==LINALGERR_OK) { + objectcomplex *new = object_newcomplex(creal(prod), cimag(prod)); + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); + + return out; +} + +/** Outer product */ +value ComplexMatrix_outer(vm *v, int nargs, value *args) { + objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + objectcomplexmatrix *new=complexmatrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); + if (new) LINALG_ERRCHECKVM(complexmatrix_r1update(MCBuild(1.0,0.0), a, b, new)); + + return morpho_wrapandbind(v, (object *) new); +} + +MORPHO_BEGINCLASS(ComplexMatrix) +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index_x_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Matrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Matrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (Matrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS + +/* ********************************************************************** + * Initialization + * ********************************************************************** */ + +void complexmatrix_initialize(void) { + objectcomplexmatrixtype=object_addtype(&objectmatrixdefn); + matrix_addinterface(&complexmatrixdefn); + + objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); + value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + + value complexmatrixclass=builtin_addclass(COMPLEXMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexMatrix), objclass); + object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); + + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int)", complexmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Matrix)", complematrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); +} diff --git a/src/linalg/complexmatrix.h b/src/linalg/complexmatrix.h new file mode 100644 index 000000000..cdb7bdd89 --- /dev/null +++ b/src/linalg/complexmatrix.h @@ -0,0 +1,20 @@ +/** @file complexmatrix.h + * @author T J Atherton + * + * @brief New linear algebra library +*/ + +#ifndef complexmatrix_h +#define complexmatrix_h + +/* ------------------------------------------------------- + * ComplexMatrix veneer class + * ------------------------------------------------------- */ + +#define COMPLEXMATRIX_CLASSNAME "ComplexMatrix" + +#define COMPLEXMATRIX_CONJTRANSPOSE_METHOD "conjTranspose" + +void complexmatrix_initialize(void); + +#endif diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index b71e1aed6..8c725680d 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1,35 +1,59 @@ /** @file matrix.c * @author T J Atherton * - * @brief Veneer class over the objectmatrix type that interfaces with blas and lapack - */ + * @brief New matrices +*/ -#include "build.h" -#ifdef MORPHO_INCLUDE_LINALG +#define ACCELERATE_NEW_LAPACK +#define MORPHO_INCLUDE_LINALG -#include -#include "morpho.h" -#include "classes.h" - -#include "matrix.h" -#include "sparse.h" +#include "newlinalg.h" #include "format.h" +/* ********************************************************************** + * Matrix interface definitions + * ********************************************************************** */ + +/** Hold the matrix interface definitions as they're created */ +static matrixinterfacedefn _matrixdefn[LINALG_MAXMATRIXDEFNS]; +objecttype matrixinterfacedefnnext=0; /** Type of the next object definition */ + +void matrix_addinterface(matrixinterfacedefn *defn) { + if (matrixinterfacedefnnextobj.type-OBJECT_MATRIX; + if (iindxtype-OBJECT_MATRIX; + return iindx>=0 && iindxncols * - ((objectmatrix *) obj)->nrows; + return sizeof(objectmatrix)+sizeof(double) * ((objectmatrix *) obj)->nels; } void objectmatrix_printfn(object *obj, void *v) { - morpho_printf(v, ""); + objectclass *klass=object_getveneerclass(obj->type); + morpho_printf(v, "<"); + morpho_printvalue(v, klass->name); + morpho_printf(v, ">"); } objecttypedefn objectmatrixdefn = { @@ -41,1524 +65,1408 @@ objecttypedefn objectmatrixdefn = { .cmpfn=NULL }; -/** Creates a matrix object */ -objectmatrix *object_newmatrix(unsigned int nrows, unsigned int ncols, bool zero) { - unsigned int nel = nrows*ncols; - objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix)+nel*sizeof(double), OBJECT_MATRIX); - - if (new) { - new->ncols=ncols; - new->nrows=nrows; - new->elements=new->matrixdata; - if (zero) { - memset(new->elements, 0, sizeof(double)*nel); - } - } - - return new; -} - /* ********************************************************************** - * Other constructors + * Matrix utility functions * ********************************************************************** */ -/* - * Create matrices from array objects - */ - -void matrix_raiseerror(vm *v, objectmatrixerror err) { - switch(err) { - case MATRIX_OK: break; - case MATRIX_INCMPTBLDIM: morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); break; - case MATRIX_SING: morpho_runtimeerror(v, MATRIX_SINGULAR); break; - case MATRIX_INVLD: morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); break; - case MATRIX_BNDS: morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); break; - case MATRIX_NSQ: morpho_runtimeerror(v, MATRIX_NOTSQ); break; - case MATRIX_FAILED: morpho_runtimeerror(v, MATRIX_OPFAILED); break; - case MATRIX_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; - } +/* ---------------------- + * Matrix interface + * ---------------------- */ + +static void _printelfn(vm *v, double *el) { + double val=*el; + morpho_printf(v, "%g", (fabs(val)ndim; n++) { - int k=MORPHO_GETINTEGERVALUE(array->data[n]); - if (k>dim[n]) dim[n]=k; +static bool _printeltobufffn(varray_char *out, char *format, double *el) { + return format_printtobuffer(MORPHO_FLOAT(*el), format, out); +} + +static value _getelfn(vm *v, double *el) { + return MORPHO_FLOAT(*el); +} + +static linalgError_t _setelfn(vm *v, value in, double *el) { + if (!morpho_valuetofloat(in, el)) return LINALGERR_NON_NUMERICAL; + return LINALGERR_OK; +} + +/** Convert matrix_norm_t to a character for use with lapack routines */ +char matrix_normtolapack(matrix_norm_t norm) { + switch (norm) { + case MATRIX_NORM_MAX: return 'M'; + case MATRIX_NORM_L1: return '1'; + case MATRIX_NORM_INF: return 'I'; + case MATRIX_NORM_FROBENIUS: return 'F'; } + return '\0'; +} + +/** Evaluate norms */ +static double _normfn(objectmatrix *a, matrix_norm_t nrm) { + char cnrm = matrix_normtolapack(nrm); + int nrows=a->nrows, ncols=a->ncols; - if (maxdimndim) return false; +#ifdef MORPHO_LINALG_USE_LAPACKE + return LAPACKE_dlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); +#else + double work[a->nrows]; + return dlange_(&cnrm, &nrows, &ncols, a->elements, &nrows, work); +#endif +} + +/** Low level linear solve */ +static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; - for (unsigned int i=array->ndim; indim+array->nelements; i++) { - if (MORPHO_ISARRAY(array->data[i])) { - if (!matrix_getarraydimensions(MORPHO_GETARRAY(array->data[i]), dim+n, maxdim-n, &m)) return false; - } - } - *ndim=n+m; +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); +#else + dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); +#endif - return true; + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } -/** Looks up an array element recursively if necessary */ -value matrix_getarrayelement(objectarray *array, unsigned int ndim, unsigned int *indx) { - unsigned int na=array->ndim; - value out; +/** Low level eigensolver */ +static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { + int info, n=a->nrows; + double wr[n], wi[n]; - if (array_getelement(array, na, indx, &out)==ARRAY_OK) { - if (ndim==na) return out; - if (MORPHO_ISARRAY(out)) { - return matrix_getarrayelement(MORPHO_GETARRAY(out), ndim-na, indx+na); - } - } +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); +#else + int lwork=4*n; double work[4*n]; + dgeev_("N", (vec ? "V" : "N"), &n, a->elements, &n, wr, wi, NULL, &n, (vec ? vec->elements : NULL), &n, work, &lwork, &info); +#endif + for (int i=0; i0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); +} + +/** Low level SVD */ +static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, + (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U + (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT + m, n, + a->elements, m, // input matrix A (overwritten) + s, // singular values (min(m,n)) + (u ? u->elements : NULL), m, // U matrix (m×m) + (vt ? vt->elements : NULL), n // VT matrix (n×n) + ); +#else + int lwork = -1; + double work_query; + // Query optimal work size + dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, + (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, + &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork = (int)work_query; + double work[lwork]; + dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, + (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, + work, &lwork, &info); +#endif + + return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); } -/** Creates a new array from a list of values */ -objectmatrix *object_matrixfromarray(objectarray *array) { - unsigned int dim[2]={0,1}; // The 1 is to allow for vector arrays. - unsigned int ndim=0; - objectmatrix *ret=NULL; +/** Low level QR decomposition without pivoting */ +static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { + int info, m=a->nrows, n=a->ncols; + int minmn = (m < n) ? m : n; + double tau[minmn]; + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dgeqrf(LAPACK_COL_MAJOR, m, n, a->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + int lwork = -1; + double work_query; + + // Query optimal work size for DGEQRF, which is reused for DORGQR + dgeqrf_(&m, &n, a->elements, &m, tau, &work_query, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + int lwork_geqrf = (int) work_query; + double work[lwork_geqrf]; + lwork = lwork_geqrf; - if (matrix_getarraydimensions(array, dim, 2, &ndim)) { - ret=object_newmatrix(dim[0], dim[1], true); + // Compute QR factorization without pivoting + dgeqrf_(&m, &n, a->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // Extract R (upper triangle of a) into r + // Copy entire matrix first, then zero out below the diagonal + matrix_copy(a, r); + // Only process columns where there are rows below the diagonal (j < m - 1) + for (int j = 0; j < n && j < m - 1; j++) { + memset(&r->elements[j * m + (j + 1)], 0, (m - j - 1) * sizeof(double)); } - unsigned int indx[2]; - if (ret) for (unsigned int i=0; ielements[j*dim[0]+i]); - } else if (!MORPHO_ISNIL(f)) { - object_free((object *) ret); return NULL; - } - } + // Generate Q from reflectors + if (q) { + // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) + // DGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns + for (int j = 0; j < n; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, minmn, minmn, q->elements, m, tau); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#else + lwork = lwork_geqrf; + dorgqr_(&m, &minmn, &minmn, q->elements, &m, tau, work, &lwork, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); +#endif + + // If Q should be m×m, zero out remaining columns if m > minmn + // DORGQR only generates the first minmn columns, so we zero the rest + if (m > minmn) memset(&q->elements[minmn * m], 0, (m - minmn) * m * sizeof(double)); } - return ret; + return LINALGERR_OK; } -/* - * Create matrices from lists - */ +/* ---------------------- + * Interface definition + * ---------------------- */ + +matrixinterfacedefn matrixdefn = { + .printelfn = _printelfn, + .printeltobufffn = _printeltobufffn, + .getelfn = _getelfn, + .setelfn = _setelfn, + .normfn = _normfn, + .solvefn = _solve, + .eigenfn = _eigen, + .svdfn = _svd, + .qrfn = _qr +}; + +/* ---------------------- + * Constructors + * ---------------------- */ -/** Recurses into an objectlist to find the dimensions of the array and all child arrays - * @param[in] list - to search - * @param[out] dim - array of dimensions to be filled out (must be zero'd before initial call) - * @param[in] maxdim - maximum number of dimensions - * @param[out] ndim - number of dimensions of the array */ -bool matrix_getlistdimensions(objectlist *list, unsigned int dim[], unsigned int maxdim, unsigned int *ndim) { - unsigned int m=0; +/** Create a generic matrix with given type and layout */ +objectmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { + MatrixCount_t nels = nrows*ncols*nvals; + objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix) + nels*sizeof(double), type); - if (maxdim==0) return false; + if (new) { + new->nrows=nrows; + new->ncols=ncols; + new->nvals=nvals; + new->nels=nels; + new->elements=new->matrixdata; + if (zero) memset(new->elements, 0, nels*sizeof(double)); + } - /* Store the length */ - if (list->val.count>dim[0]) dim[0]=list->val.count; + return new; +} + +/** Create a new real matrix */ +objectmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { + return matrix_newwithtype(OBJECT_MATRIX, nrows, ncols, 1, zero); +} + +/** Clone a matrix */ +objectmatrix *matrix_clone(objectmatrix *in) { + objectmatrix *new = matrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); - for (unsigned int i=0; ival.count; i++) { - if (MORPHO_ISLIST(list->val.data[i]) && maxdim>0) { - matrix_getlistdimensions(MORPHO_GETLIST(list->val.data[i]), dim+1, maxdim-1, &m); - } + if (new) cblas_dcopy((__LAPACK_int) in->nels, in->elements, 1, new->elements, 1); + return new; +} + +static bool _getelement(value v, int i, value *out) { + if (MORPHO_ISLIST(v)) { + return list_getelement(MORPHO_GETLIST(v), i, out); + } else if (MORPHO_ISTUPLE(v)) { + return tuple_getelement(MORPHO_GETTUPLE(v), i, out); + } else if (MORPHO_ISNUMBER(v) || MORPHO_ISCOMPLEX(v)) { + if (i==0) { *out = v; return true; } } - *ndim=m+1; - - return true; + return false; } -/** Gets a matrix element from a (potentially nested) list. */ -bool matrix_getlistelement(objectlist *list, unsigned int ndim, unsigned int *indx, value *val) { - value out=MORPHO_NIL; - objectlist *l=list; - for (unsigned int i=0; ival.count) { - out=l->val.data[indx[i]]; - if (incols) { + ncols=rlen; + } } - if (ndim>2) return false; - - unsigned int indx[2]; - if (ret) for (unsigned int i=0; ielements[j*dim[0]+i]); - } else { - object_free((object *) ret); - return NULL; + objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); + if (!new) return NULL; + + for (int i=0; isetelfn(v, jel, new->elements+(j*nrows + i)*new->nvals); } } } - return ret; + return new; } -/** Creates a matrix from a list of floats */ -objectmatrix *object_matrixfromfloats(unsigned int nrows, unsigned int ncols, double *list) { - objectmatrix *ret=NULL; +/** Construct a matrix from an array */ +objectmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals) { + int nrows = MORPHO_GETINTEGERVALUE(a->dimensions[0]); + int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); - ret=object_newmatrix(nrows, ncols, true); - if (ret) cblas_dcopy(ncols*nrows, list, 1, ret->elements, 1); - - return ret; -} - -/* - * Clone matrices - */ - -/** Clone a matrix */ -objectmatrix *object_clonematrix(objectmatrix *in) { - objectmatrix *new = object_newmatrix(in->nrows, in->ncols, false); + objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); + if (!new) return NULL; - if (new) { - cblas_dcopy(in->ncols * in->nrows, in->elements, 1, new->elements, 1); + for (int i=0; isetelfn(v, el, new->elements+(j*nrows + i)*new->nvals); + } + } } - return new; } -/* ********************************************************************** - * Matrix operations - * ********************************************************************* */ +/* ---------------------- + * Accessing elements + * ---------------------- */ /** @brief Sets a matrix element. @returns true if the element is in the range of the matrix, false otherwise */ -bool matrix_setelement(objectmatrix *matrix, unsigned int row, unsigned int col, double value) { - if (colncols && rownrows) { - matrix->elements[col*matrix->nrows+row]=value; - return true; - } - return false; +linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; + + matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; + return LINALGERR_OK; } /** @brief Gets a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -bool matrix_getelement(objectmatrix *matrix, unsigned int row, unsigned int col, double *value) { - if (colncols && rownrows) { - if (value) *value=matrix->elements[col*matrix->nrows+row]; - return true; - } - return false; +linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; + + if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; + return LINALGERR_OK; } -/** @brief Gets a column's entries - * @param[in] matrix - the matrix - * @param[in] col - column number - * @param[out] v - column entries (matrix->nrows in number) +/** @brief Gets a pointer to a matrix element * @returns true if the element is in the range of the matrix, false otherwise */ -bool matrix_getcolumn(objectmatrix *matrix, unsigned int col, double **v) { - if (colncols) { - *v=&matrix->elements[col*matrix->nrows]; - return true; - } - return false; +linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { + if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; + + if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); + return LINALGERR_OK; } -/** @brief Sets a column's entries - * @param[in] matrix - the matrix - * @param[in] col - column number - * @param[in] v - column entries (matrix->nrows in number) - * @returns true if the element is in the range of the matrix, false otherwise */ -bool matrix_setcolumn(objectmatrix *matrix, unsigned int col, double *v) { - if (colncols) { - cblas_dcopy(matrix->nrows, v, 1, &matrix->elements[col*matrix->nrows], 1); - return true; - } - return false; +/** Copies the column col of matrix a into the column vector b */ +linalgError_t matrix_getcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { + if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col*a->nrows, 1, b->elements, 1); + return LINALGERR_OK; } -/** @brief Add a vector to a column in a matrix - * @param[in] m - the matrix - * @param[in] col - column number - * @param[in] alpha - scale - * @param[out] v - column entries (matrix->nrows in number) [should have m->nrows entries] - * @returns true on success */ -bool matrix_addtocolumn(objectmatrix *m, unsigned int col, double alpha, double *v) { - if (colncols) { - cblas_daxpy(m->nrows, alpha, v, 1, &m->elements[col*m->nrows], 1); - return true; - } - return false; +/** Copies the column vector b into column col of matrix a */ +linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { + if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col*a->nrows, 1); + return LINALGERR_OK; } -/* ********************************************************************** - * Matrix arithmetic - * ********************************************************************* */ +/* ---------------------- + * Arithmetic operations + * ---------------------- */ + +/** Vector addition: Performs y <- alpha*x + y */ +linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); + return LINALGERR_OK; +} -/** Copies one matrix to another */ -unsigned int matrix_countdof(objectmatrix *a) { - return a->ncols*a->nrows; +/** Copies a matrix y <- x */ +linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + return LINALGERR_OK; } -/** Copies one matrix to another */ -objectmatrixerror matrix_copy(objectmatrix *a, objectmatrix *out) { - if (a->ncols==out->ncols && a->nrows==out->nrows) { - cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +/** Scales a matrix x <- scale * x >*/ +void matrix_scale(objectmatrix *x, double scale) { + cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); } -/** Copies a matrix to another at an arbitrary point */ -objectmatrixerror matrix_copyat(objectmatrix *a, objectmatrix *out, int row0, int col0) { - if (col0+a->ncols<=out->ncols && row0+a->nrows<=out->nrows) { - for (int j=0; jncols; j++) { - for (int i=0; inrows; i++) { - double value; - if (!matrix_getelement(a, i, j, &value)) return MATRIX_BNDS; - if (!matrix_setelement(out, row0+i, col0+j, value)) return MATRIX_BNDS; - } - } - - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +/** Loads the identity matrix a <- I(n) */ +linalgError_t matrix_identity(objectmatrix *x) { + if (x->ncols!=x->nrows) return LINALGERR_NOT_SQUARE; + memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); + for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; + return LINALGERR_OK; } -/** Performs a + b -> out. */ -objectmatrixerror matrix_add(objectmatrix *a, objectmatrix *b, objectmatrix *out) { - if (a->ncols==b->ncols && a->ncols==out->ncols && - a->nrows==b->nrows && a->nrows==out->nrows) { - if (a!=out) cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); - cblas_daxpy(a->ncols * a->nrows, 1.0, b->elements, 1, out->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +/** Performs z <- alpha*(x*y) + beta*z */ +linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double beta, objectmatrix *z) { + if (!(x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); + return LINALGERR_OK; } -/** Performs lambda*a + beta -> out. */ -objectmatrixerror matrix_addscalar(objectmatrix *a, double lambda, double beta, objectmatrix *out) { - if (a->ncols==out->ncols && a->nrows==out->nrows) { - for (unsigned int i=0; inrows*out->ncols; i++) { - out->elements[i]=lambda*a->elements[i]+beta; +/** Performs x <- alpha*x + beta */ +linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta) { + for (MatrixCount_t i=0; incols*x->nrows; i++) { + for (int k=0; knvals; k++) { + x->elements[i*x->nvals+k]*=alpha; + if (k==0) x->elements[i*x->nvals+k]+=beta; } - return MATRIX_OK; } - - return MATRIX_INCMPTBLDIM; + return LINALGERR_OK; } -/** Performs a + lambda*b -> a. */ -objectmatrixerror matrix_accumulate(objectmatrix *a, double lambda, objectmatrix *b) { - if (a->ncols==b->ncols && a->nrows==b->nrows ) { - cblas_daxpy(a->ncols * a->nrows, lambda, b->elements, 1, a->elements, 1); - return MATRIX_OK; +/** Performs y <- x^T>*/ +linalgError_t matrix_transpose(objectmatrix *x, objectmatrix *y) { + if (!(x->ncols==y->nrows && x->nrows==y->ncols)) return LINALGERR_INCOMPATIBLE_DIM; + + for (MatrixCount_t i=0; incols; i++) { + for (MatrixCount_t j=0; jnrows; j++) { + for (int k=0; knvals; k++) { + y->elements[j*y->nrows*y->nvals+i*y->nvals+k] = x->elements[i*x->nrows*x->nvals+j*x->nvals+k]; + } + } } - return MATRIX_INCMPTBLDIM; + return LINALGERR_OK; } -/** Performs a - b -> out */ -objectmatrixerror matrix_sub(objectmatrix *a, objectmatrix *b, objectmatrix *out) { - if (a->ncols==b->ncols && a->ncols==out->ncols && - a->nrows==b->nrows && a->nrows==out->nrows) { - if (a!=out) cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); - cblas_daxpy(a->ncols * a->nrows, -1.0, b->elements, 1, out->elements, 1); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; +/* ---------------------- + * Unary operations + * ---------------------- */ + +/** Computes various matrix norms */ +double matrix_norm(objectmatrix *a, matrix_norm_t norm) { + return matrix_getinterface(a)->normfn(a, norm); } -/** Performs a * b -> out */ -objectmatrixerror matrix_mul(objectmatrix *a, objectmatrix *b, objectmatrix *out) { - if (a->ncols==b->nrows && a->nrows==out->nrows && b->ncols==out->ncols) { - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, 1.0, a->elements, a->nrows, b->elements, b->nrows, 0.0, out->elements, out->nrows); - return MATRIX_OK; +/** Computes the sum of all elements in a matrix */ +void matrix_sum(objectmatrix *a, double *sum) { + double c[a->nvals], y, t; + for (int i=0; invals; i++) { sum[i]=0; c[i]=0; } + + for (MatrixCount_t i=0; inels; i+=a->nvals) { + for (int k=0; knvals; k++) { + y=a->elements[i+k]-c[k]; + t=sum[k]+y; + c[k]=(t-sum[k])-y; + sum[k]=t; + } } - return MATRIX_INCMPTBLDIM; } -/** Finds the Frobenius inner product of two matrices */ -objectmatrixerror matrix_inner(objectmatrix *a, objectmatrix *b, double *out) { - if (a->ncols==b->ncols && a->nrows==b->nrows) { - *out=cblas_ddot(a->ncols*a->nrows, a->elements, 1, b->elements, 1); - return MATRIX_OK; +/** Calculate the trace of a matrix */ +linalgError_t matrix_trace(objectmatrix *a, double *out) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + *out = 0.0; + for (int i = 0; i < a->nrows; i++) { + *out += a->elements[a->nvals * (i * a->nrows + i)]; } - return MATRIX_INCMPTBLDIM; + + return LINALGERR_OK; } -/** Computes the outer product of two matrices */ -objectmatrixerror matrix_outer(objectmatrix *a, objectmatrix *b, objectmatrix *out) { - int m=a->nrows*a->ncols, n=b->nrows*b->ncols; - if (m==out->nrows && n==out->ncols) { - cblas_dger(CblasColMajor, m, n, 1, a->elements, 1, b->elements, 1, out->elements, out->nrows); - return MATRIX_OK; - } - return MATRIX_INCMPTBLDIM; -} - -/** Solves the system a.x = b - * @param[in] a lhs - * @param[in] b rhs - * @param[in] out - the solution x - * @param[out] lu - LU decomposition of a; you must provide an array the same size as a. - * @param[out] pivot - you must provide an array with the same number of rows as a. - * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. - * */ -static objectmatrixerror matrix_div(objectmatrix *a, objectmatrix *b, objectmatrix *out, double *lu, int *pivot) { - int n=a->nrows, nrhs = b->ncols, info; +/* ---------------------- + * Binary operations + * ---------------------- */ + +/** Finds the Frobenius inner product of two matrices */ +linalgError_t matrix_inner(objectmatrix *x, objectmatrix *y, double *out) { + if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_dcopy(a->ncols * a->nrows, a->elements, 1, lu, 1); - if (b!=out) cblas_dcopy(b->ncols * b->nrows, b->elements, 1, out->elements, 1); -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, lu, n, pivot, out->elements, n); -#else - dgesv_(&n, &nrhs, lu, &n, pivot, out->elements, &n, &info); -#endif + *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + return LINALGERR_OK; +} + +/** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ +linalgError_t matrix_r1update(double alpha, objectmatrix *a, objectmatrix *b, objectmatrix *c) { + MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; + if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); + cblas_dger(CblasColMajor, m, n, alpha, a->elements, 1, b->elements, 1, c->elements, c->nrows); + return LINALGERR_OK; } -/** Solves the system a.x = b for small matrices (test with MATRIX_ISSMALL) - * @warning Uses the C stack for storage, which avoids malloc but can cause stack overflow */ -objectmatrixerror matrix_divs(objectmatrix *a, objectmatrix *b, objectmatrix *out) { - if (a->ncols==b->nrows && a->ncols == out->nrows) { - int pivot[a->nrows]; - double lu[a->nrows*a->ncols]; - - return matrix_div(a, b, out, lu, pivot); - } - return MATRIX_INCMPTBLDIM; +/** Solve the linear system a.x = b using stack allocated memory for temporary */ +linalgError_t matrix_solvesmall(objectmatrix *a, objectmatrix *b) { + int pivot[a->nrows]; + double els[a->nels]; + objectmatrix A = MORPHO_STATICMATRIX(els, a->nrows, a->ncols); + matrix_copy(a, &A); + return (matrix_getinterface(a)->solvefn) (&A, b, pivot); } -/** Solves the system a.x = b for large matrices (test with MATRIX_ISSMALL) */ -objectmatrixerror matrix_divl(objectmatrix *a, objectmatrix *b, objectmatrix *out) { - objectmatrixerror ret = MATRIX_ALLOC; // Returned if allocation fails - if (!(a->ncols==b->nrows && a->ncols == out->nrows)) return MATRIX_INCMPTBLDIM; - - int *pivot=MORPHO_MALLOC(sizeof(int)*a->nrows); - double *lu=MORPHO_MALLOC(sizeof(double)*a->nrows*a->ncols); - - if (pivot && lu) ret=matrix_div(a, b, out, lu, pivot); - +/** Solve the linear system a.x = b using heap allocated memory for temporary */ +linalgError_t matrix_solvelarge(objectmatrix *a, objectmatrix *b) { + int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); + objectmatrix *A = matrix_clone(a); + linalgError_t out = LINALGERR_ALLOC; + if (pivot && A) { + out = (matrix_getinterface(a)->solvefn) (A, b, pivot); + } + if (A) object_free((object *) A); if (pivot) MORPHO_FREE(pivot); - if (lu) MORPHO_FREE(lu); - - return ret; + return out; +} + +/** Solve the linear system a.x = b; automatrically allocates storage depending on size of the matrix + * @param[in] a lhs + * @param[in|out] b rhs — overwritten by the solution + * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ +linalgError_t matrix_solve(objectmatrix *a, objectmatrix *b) { + if (MATRIX_ISSMALL(a)) return matrix_solvesmall(a, b); + else return matrix_solvelarge(a, b); } /** Inverts the matrix a - * @param[in] a lhs - * @param[in] out - the solution x - * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. - * */ -objectmatrixerror matrix_inverse(objectmatrix *a, objectmatrix *out) { + * @param[in] a matrix to be inverted + * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ +linalgError_t matrix_inverse(objectmatrix *a) { int nrows=a->nrows, ncols=a->ncols, info; - if (!(a->ncols==out->nrows && a->ncols == out->nrows)) return MATRIX_INCMPTBLDIM; - int pivot[nrows]; - cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgetrf(LAPACK_COL_MAJOR, nrows, ncols, out->elements, nrows, pivot); + info=LAPACKE_dgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); #else - dgetrf_(&nrows, &ncols, out->elements, &nrows, pivot, &info); + dgetrf_(&nrows, &ncols, a->elements, &nrows, pivot, &info); #endif - - if (info!=0) return (info>0 ? MATRIX_SING : MATRIX_INVLD); + if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgetri(LAPACK_COL_MAJOR, nrows, out->elements, nrows, pivot); + info=LAPACKE_dgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); #else int lwork=nrows*ncols; double work[nrows*ncols]; - dgetri_(&nrows, out->elements, &nrows, pivot, work, &lwork, &info); + dgetri_(&nrows, a->elements, &nrows, pivot, work, &lwork, &info); #endif - return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); + return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); } -/** Compute eigenvalues and eigenvectors of a matrix - * @param[in] a - an objectmatrix to diagonalize of size n - * @param[out] wr - a buffer of size n will hold the real part of the eigenvalues on exit - * @param[out] wi - a buffer of size n will hold the imag part of the eigenvalues on exit - * @param[out] vec - (optional) will be filled out with eigenvectors as columns (should be of size n) - * @returns an error code or MATRIX_OK on success */ -objectmatrixerror matrix_eigensystem(objectmatrix *a, double *wr, double *wi, objectmatrix *vec) { - int info, n=a->nrows; - if (a->nrows!=a->ncols) return MATRIX_NSQ; - if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return MATRIX_INCMPTBLDIM; - - // Copy a to prevent destruction - size_t size = ((size_t) n) * ((size_t) n) * sizeof(double); - double *acopy=MORPHO_MALLOC(size); - if (!acopy) return MATRIX_ALLOC; - cblas_dcopy(n*n, a->elements, 1, acopy, 1); +/** Interface to eigensystem */ +linalgError_t matrix_eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return LINALGERR_INCOMPATIBLE_DIM; -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, acopy, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); -#else - int lwork=4*n; double work[4*n]; - dgeev_("N", (vec ? "V" : "N"), &n, acopy, &n, wr, wi, NULL, &n, (vec ? vec->elements : NULL), &n, work, &lwork, &info); -#endif + matrix_eigenfn_t efn = matrix_getinterface(a)->eigenfn; + if (!efn) return LINALGERR_NOT_SUPPORTED; - if (acopy) MORPHO_FREE(acopy); // Free up buffer + objectmatrix *temp = matrix_clone(a); + if (!temp) return LINALGERR_ALLOC; - if (info!=0) return (info>0 ? MATRIX_FAILED : MATRIX_INVLD); - - return MATRIX_OK; + return efn(temp, w, vec); } +/* ---------------------- + * Display + * ---------------------- */ -/** Sums all elements of a matrix using Kahan summation */ -double matrix_sum(objectmatrix *a) { - unsigned int nel=a->ncols*a->nrows; - double sum=0.0, c=0.0, y,t; - - for (unsigned int i=0; ielements[i]-c; - t=sum+y; - c=(t-sum)-y; - sum=t; +/** Prints a matrix */ +void matrix_print(vm *v, objectmatrix *m) { + matrixinterfacedefn *interface=matrix_getinterface(m); + double *elptr; + for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m + morpho_printf(v, "[ "); + for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k + matrix_getelementptr(m, i, j, &elptr); + (*interface->printelfn) (v, elptr); + morpho_printf(v, " "); + } + morpho_printf(v, "]%s", (inrows-1 ? "\n" : "")); } - return sum; } -/** Norms */ - -/** Computes the Frobenius norm of a matrix */ -double matrix_norm(objectmatrix *a) { - double nrm2=cblas_dnrm2(a->ncols*a->nrows, a->elements, 1); - return nrm2; +/** Prints a matrix to a buffer */ +bool matrix_printtobuffer(objectmatrix *m, char *format, varray_char *out) { + matrixinterfacedefn *interface=matrix_getinterface(m); + double *elptr; + for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m + varray_charadd(out, "[ ", 2); + + for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k + matrix_getelementptr(m, i, j, &elptr); + if (!(*interface->printeltobufffn) (out, format, elptr)) return false; + varray_charadd(out, " ", 1); + } + varray_charadd(out, "]", 1); + if (inrows-1) varray_charadd(out, "\n", 1); + } + return true; } -/** Computes the L1 norm of a matrix */ -double matrix_L1norm(objectmatrix *a) { - unsigned int nel=a->ncols*a->nrows; - double sum=0.0, c=0.0, y,t; +/* ---------------------- + * Roll + * ---------------------- */ + +/** Rolls the matrix list */ +static void _rollflat(objectmatrix *a, objectmatrix *b, int nplaces) { + MatrixCount_t N=a->nrows*a->ncols*a->nvals; + MatrixCount_t n = abs(nplaces)*a->nvals; + if (n>N) n = n % N; + MatrixCount_t Np = N - n; // Number of elements to roll - for (unsigned int i=0; ielements[i])-c; - t=sum+y; - c=(t-sum)-y; - sum=t; + if (nplaces<0) { + memcpy(b->matrixdata, a->matrixdata+n, sizeof(double)*Np); + memcpy(b->matrixdata+Np, a->matrixdata, sizeof(double)*n); + } else { + memcpy(b->matrixdata+n, a->matrixdata, sizeof(double)*Np); + if (n>0) memcpy(b->matrixdata, a->matrixdata+Np, sizeof(double)*n); } - return sum; } -/** Computes the Ln norm of a matrix */ -double matrix_Lnnorm(objectmatrix *a, double n) { - unsigned int nel=a->ncols*a->nrows; - double sum=0.0, c=0.0, y,t; - - for (unsigned int i=0; ielements[i],n)-c; - t=sum+y; - c=(t-sum)-y; - sum=t; - } - return pow(sum,1.0/n); +/** Copies a arow from matrix a into brow for matrix b */ +static void _copyrow(objectmatrix *a, MatrixIdx_t arow, objectmatrix *b, MatrixIdx_t brow) { + for (MatrixIdx_t i=0; incols; i++) + memcpy(b->elements+b->nvals*(i*b->nrows+brow), a->elements+a->nvals*(i*a->nrows+arow), sizeof(double)*a->nvals); } -/** Computes the Linf norm of a matrix */ -double matrix_Linfnorm(objectmatrix *a) { - unsigned int nel=a->ncols*a->nrows; - double max=0.0; +/** Rolls a list by a number of elements along a given axis; stores the result in b */ +linalgError_t matrix_roll(objectmatrix *a, int nplaces, int axis, objectmatrix *b) { + if (!(a->nrows==b->nrows && a->ncols==b->ncols && a->nvals==b->nvals)) return LINALGERR_INCOMPATIBLE_DIM; - for (unsigned int i=0; ielements[i]); - if (y>max) max=y; + switch(axis) { + case 0: + for (int i=0; inrows; i++) { + int j = (i+nplaces); + while (j<0) j+=a->nrows; + _copyrow(a, i, b, j % a->nrows); + } + break; + case 1: _rollflat(a, b, nplaces*a->nrows); break; + default: return LINALGERR_NOT_SUPPORTED; } - return max; -} -/** Transpose a matrix */ -objectmatrixerror matrix_transpose(objectmatrix *a, objectmatrix *out) { - if (!(a->ncols==out->nrows && a->nrows == out->ncols)) return MATRIX_INCMPTBLDIM; - - /* Copy elements a column at a time */ - for (unsigned int i=0; incols; i++) { - cblas_dcopy(a->nrows, a->elements+(i*a->nrows), 1, out->elements+i, a->ncols); - } - return MATRIX_OK; + return LINALGERR_OK; } -/** Calculate the trace of a matrix */ -objectmatrixerror matrix_trace(objectmatrix *a, double *out) { - if (a->nrows!=a->ncols) return MATRIX_NSQ; - *out=1.0; - *out=cblas_ddot(a->nrows, a->elements, a->ncols+1, out, 0); +/* ********************************************************************** + * Matrix constructors + * ********************************************************************** */ + +value matrix_constructor__int_int(vm *v, int nargs, value *args) { + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return MATRIX_OK; + objectmatrix *new=matrix_new(nrows, ncols, true); + return morpho_wrapandbind(v, (object *) new); } -/** Scale a matrix */ -objectmatrixerror matrix_scale(objectmatrix *a, double scale) { - cblas_dscal(a->ncols*a->nrows, scale, a->elements, 1); +value matrix_constructor__int(vm *v, int nargs, value *args) { + MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return MATRIX_OK; + objectmatrix *new=matrix_new(nrows, 1, true); + return morpho_wrapandbind(v, (object *) new); } -/** Load the indentity matrix*/ -objectmatrixerror matrix_identity(objectmatrix *a) { - if (a->ncols!=a->nrows) return MATRIX_NSQ; - memset(a->elements, 0, sizeof(double)*a->nrows*a->ncols); - for (int i=0; inrows; i++) a->elements[i+a->nrows*i]=1.0; - return MATRIX_OK; +/** Clones a matrix */ +value matrix_constructor__matrix(vm *v, int nargs, value *args) { + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + return morpho_wrapandbind(v, (object *) matrix_clone(a)); } -/** Sets a matrix to zero */ -objectmatrixerror matrix_zero(objectmatrix *a) { - memset(a->elements, 0, sizeof(double)*a->nrows*a->ncols); - - return MATRIX_OK; +/** Constructs a matrix from a list of lists or tuples */ +value matrix_constructor__list(vm *v, int nargs, value *args) { + objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_MATRIX, 1); + return morpho_wrapandbind(v, (object *) new); } -/** Prints a matrix */ -void matrix_print(vm *v, objectmatrix *m) { - for (int i=0; inrows; i++) { // Rows run from 0...m - morpho_printf(v, "[ "); - for (int j=0; jncols; j++) { // Columns run from 0...k - double val; - matrix_getelement(m, i, j, &val); - morpho_printf(v, "%g ", (fabs(val)nrows-1 ? "\n" : "")); - } +/** Constructs a matrix from an array */ +value matrix_constructor__array(vm *v, int nargs, value *args) { + objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); + if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } + + objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_MATRIX, 1); + return morpho_wrapandbind(v, (object *) new); } -/** Prints a matrix to a buffer */ -bool matrix_printtobuffer(objectmatrix *m, char *format, varray_char *out) { - for (int i=0; inrows; i++) { // Rows run from 0...m - varray_charadd(out, "[ ", 2); - - for (int j=0; jncols; j++) { // Columns run from 0...k - double val; - matrix_getelement(m, i, j, &val); - if (!format_printtobuffer(MORPHO_FLOAT(val), format, out)) return false; - varray_charadd(out, " ", 1); - } - varray_charadd(out, "]", 1); - if (inrows-1) varray_charadd(out, "\n", 1); - } - return true; +value matrix_constructor__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); + return MORPHO_NIL; } -/** Matrix eigensystem */ -bool matrix_eigen(vm *v, objectmatrix *a, value *evals, value *evecs) { - double *ev = MORPHO_MALLOC(sizeof(double)*a->nrows*2); // Allocate temporary memory for eigenvalues - double *er=ev, *ei=ev+a->nrows; - - objectmatrix *vecs=NULL; // A new matrix for eigenvectors - objectlist *vallist = object_newlist(0, NULL); // List to hold eigenvalues - bool success=false; - - if (evecs) vecs=object_clonematrix(a); // Clones a to hold eigenvectors - - // Check that everything was allocated correctly - if (!(ev && vallist && (!evecs || vecs))) { - morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto matrix_eigen_cleanup; }; - - objectmatrixerror err=matrix_eigensystem(a, er, ei, vecs); - - if (err!=MATRIX_OK) { - matrix_raiseerror(v, err); - goto matrix_eigen_cleanup; - } - - // Now process the eigenvalues - for (int i=0; inrows; i++) { - if (fabs(ei[i])val.count; i++) { - if (MORPHO_ISOBJECT(vallist->val.data[i])) object_free(MORPHO_GETOBJECT(vallist->val.data[i])); - } - object_free((object *) vallist); - } - if (vecs) object_free((object *) vecs); - } + objectmatrix *new = matrix_new(n,n,false); + if (new) matrix_identity(new); - return success; + return morpho_wrapandbind(v, (object *) new); } /* ********************************************************************** * Matrix veneer class - * ********************************************************************* */ + * ********************************************************************** */ -/** Constructs a Matrix object */ -value matrix_constructor(vm *v, int nargs, value *args) { - unsigned int nrows, ncols; - objectmatrix *new=NULL; - value out=MORPHO_NIL; - - if (nargs==2 && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 1)) ) { - nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - new=object_newmatrix(nrows, ncols, true); - } else if (nargs==1 && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - ncols = 1; - new=object_newmatrix(nrows, ncols, true); - } else if (nargs==1 && - MORPHO_ISARRAY(MORPHO_GETARG(args, 0))) { - new=object_matrixfromarray(MORPHO_GETARRAY(MORPHO_GETARG(args, 0))); - if (!new) morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); -#ifdef MORPHO_INCLUDE_SPARSE - } else if (nargs==1 && - MORPHO_ISLIST(MORPHO_GETARG(args, 0))) { - new=object_matrixfromlist(MORPHO_GETLIST(MORPHO_GETARG(args, 0))); - if (!new) { - /** Could this be a concatenation operation? */ - objectsparseerror err = sparse_catmatrix(MORPHO_GETLIST(MORPHO_GETARG(args, 0)), &new); - if (err==SPARSE_INVLDINIT) { - morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); - } else if (err!=SPARSE_OK) sparse_raiseerror(v, err); - } -#endif - } else if (nargs==1 && - MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { - new=object_clonematrix(MORPHO_GETMATRIX(MORPHO_GETARG(args, 0))); - if (!new) morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); -#ifdef MORPHO_INCLUDE_SPARSE - } else if (nargs==1 && - MORPHO_ISSPARSE(MORPHO_GETARG(args, 0))) { - objectsparseerror err=sparse_tomatrix(MORPHO_GETSPARSE(MORPHO_GETARG(args, 0)), &new); - if (err!=SPARSE_OK) morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); -#endif - } else morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); - - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - - return out; +/* ---------------------- + * Common utility methods + * ---------------------- */ + +/** Prints a matrix */ +value Matrix_print(vm *v, int nargs, value *args) { + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); + matrix_print(v, m); + return MORPHO_NIL; } -/** Creates an identity matrix */ -value matrix_identityconstructor(vm *v, int nargs, value *args) { - int n; - objectmatrix *new=NULL; - value out = MORPHO_NIL; - - if (nargs==1 && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - new=object_newmatrix(n, n, false); - if (new) { - matrix_identity(new); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - } else morpho_runtimeerror(v, MATRIX_IDENTCONSTRUCTOR); - - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } +/** Formatted conversion to a string */ +value Matrix_format(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + varray_char str; + varray_charinit(&str); + + if (matrix_printtobuffer(MORPHO_GETMATRIX(MORPHO_SELF(args)), + MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), + &str)) { + out = object_stringfromvarraychar(&str); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + varray_charclear(&str); return out; } -/** Checks that a matrix is indexed with 2 indices with a generic interface */ -bool matrix_slicedim(value * a, unsigned int ndim){ - if (ndim>2||ndim<0) return false; - return true; +/** Copies the contents of one matrix into another */ +value Matrix_assign(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + LINALG_ERRCHECKVM(matrix_copy(b, a)); + return MORPHO_NIL; } -/** Constucts a new matrix with a generic interface */ -void matrix_sliceconstructor(unsigned int *slicesize,unsigned int ndim,value* out){ - unsigned int numcol = 1; - if (ndim == 2) { - numcol = slicesize[1]; - } - *out = MORPHO_OBJECT(object_newmatrix(slicesize[0],numcol,false)); +/** Clones a matrix */ +value Matrix_clone(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=matrix_clone(a); + return morpho_wrapandbind(v, (object *) new); } -/** Copies data from a at indx to out at newindx with a generic interface */ -objectarrayerror matrix_slicecopy(value * a,value * out, unsigned int ndim, unsigned int *indx,unsigned int *newindx){ - double num; // matrices store doubles; - unsigned int colindx = 0; - unsigned int colnewindx = 0; - - if (ndim == 2) { - colindx = indx[1]; - colnewindx = newindx[1]; - } - if (!(matrix_getelement(MORPHO_GETMATRIX(*a),indx[0],colindx,&num)&& - matrix_setelement(MORPHO_GETMATRIX(*out),newindx[0],colnewindx,num))){ - return ARRAY_OUTOFBOUNDS; - } - return ARRAY_OK; -} +/* --------- + * index() + * --------- */ -/** Rolls the matrix list */ -void matrix_rollflat(objectmatrix *a, objectmatrix *b, int nplaces) { - unsigned int N = a->nrows*a->ncols; - int n = abs(nplaces); - if (n>N) n = n % N; - unsigned int Np = N - n; // Number of elements to roll +value Matrix_index_int_int(vm *v, int nargs, value *args) { + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + value out=MORPHO_NIL; - if (nplaces<0) { - memcpy(b->matrixdata, a->matrixdata+n, sizeof(double)*Np); - memcpy(b->matrixdata+Np, a->matrixdata, sizeof(double)*n); - } else { - memcpy(b->matrixdata+n, a->matrixdata, sizeof(double)*Np); - if (n>0) memcpy(b->matrixdata, a->matrixdata+Np, sizeof(double)*n); - } + double *elptr=NULL; + LINALG_ERRCHECKVM(matrix_getelementptr(m, i, j, &elptr)); + + if (elptr) out=matrix_getinterface(m)->getelfn(v, elptr); + return out; } -/** Copies arow from matrix a into brow for matrix b */ -void matrix_copyrow(objectmatrix *a, int arow, objectmatrix *b, int brow) { - cblas_dcopy(a->ncols, a->elements+arow, a->nrows, b->elements+brow, a->nrows); +static linalgError_t _slice_count(value in, MatrixIdx_t *count) { + if (morpho_isnumber(in)) { *count=1; return LINALGERR_OK; } + else if (MORPHO_ISRANGE(in)) { *count = range_count(MORPHO_GETRANGE(in)); return LINALGERR_OK; } + return LINALGERR_NON_NUMERICAL; } -/** Rolls a list by a number of elements */ -objectmatrix *matrix_roll(objectmatrix *a, int nplaces, int axis) { - objectmatrix *new=object_newmatrix(a->nrows, a->ncols, false); - - if (new) { - switch(axis) { - case 0: { // TODO: Could probably be faster - for (int i=0; inrows; i++) { - int j = (i+nplaces); - if (j<0) j+=a->nrows; - matrix_copyrow(a, i, new, j % a->nrows); - } - } - break; - case 1: matrix_rollflat(a, new, nplaces*a->nrows); break; +static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { + value val=in; + if (MORPHO_ISRANGE(in)) val=range_iterate(MORPHO_GETRANGE(in), i); + + if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return LINALGERR_OK; } + else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return LINALGERR_OK; } + return LINALGERR_OP_FAILED; +} + +static linalgError_t _slice_validate(value iv, value jv, MatrixIdx_t *icnt, MatrixIdx_t *jcnt) { + LINALG_ERRCHECKRETURN(_slice_count(iv, icnt)); + LINALG_ERRCHECKRETURN(_slice_count(jv, jcnt)); + if (*icnt<1 || *jcnt<1) return LINALGERR_INVLD_ARG; + return LINALGERR_OK; +} + +static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx_t jcnt, objectmatrix *a, objectmatrix *b, bool swap) { + double *ael, *bel; + for (MatrixIdx_t j=0; jnvals); + else memcpy(bel, ael, sizeof(double)*b->nvals); } } - - return new; + return LINALGERR_OK; } -/** Gets the matrix element with given indices */ -value Matrix_getindex(vm *v, int nargs, value *args) { - objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); - unsigned int indx[2]={0,0}; - value out = MORPHO_NIL; - if (nargs>2){ - morpho_runtimeerror(v, MATRIX_INVLDNUMINDICES); - return out; - } - - if (array_valuelisttoindices(nargs, args+1, indx)) { - double outval; - if (!matrix_getelement(m, indx[0], indx[1], &outval)) { - morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); - } else { - out = MORPHO_FLOAT(outval); - } - } else { // now try to get a slice - objectarrayerror err = getslice(&MORPHO_SELF(args), &matrix_slicedim, &matrix_sliceconstructor, &matrix_slicecopy, nargs, &MORPHO_GETARG(args,0), &out); - if (err!=ARRAY_OK) MORPHO_RAISE(v, array_to_matrix_error(err) ); - if (MORPHO_ISOBJECT(out)){ - morpho_bindobjects(v,1,&out); - } else morpho_runtimeerror(v, MATRIX_INVLDINDICES); - } +value Matrix_index_x_x(vm *v, int nargs, value *args) { + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)), *new=NULL; + value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); + value out=MORPHO_NIL; + + MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix + LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); + + new=matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + + linalgError_t err=_slice_copy(iv, jv, icnt, jcnt, m, new, false); + if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); object_free((object *) new); } + else out = morpho_wrapandbind(v, (object *) new); + return out; } -/** Sets the matrix element with given indices */ -value Matrix_setindex(vm *v, int nargs, value *args) { - objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); - unsigned int indx[2]={0,0}; - - if (array_valuelisttoindices(nargs-1, args+1, indx)) { - double value=0.0; - if (MORPHO_ISFLOAT(args[nargs])) value=MORPHO_GETFLOATVALUE(args[nargs]); - if (MORPHO_ISINTEGER(args[nargs])) value=(double) MORPHO_GETINTEGERVALUE(args[nargs]); +/* --------- + * setindex() + * --------- */ - if (!matrix_setelement(m, indx[0], indx[1], value)) { - morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); - } - } else morpho_runtimeerror(v, MATRIX_INVLDINDICES); - +static void _setindex(vm *v, objectmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { + double *elptr=NULL; + LINALG_ERRCHECKVM(matrix_getelementptr(m, i, j, &elptr)); + if (elptr) LINALG_ERRCHECKVM(matrix_getinterface(m)->setelfn(v, in, elptr)); +} + +value Matrix_setindex_int_x(vm *v, int nargs, value *args) { + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); return MORPHO_NIL; } -/** Sets the column of a matrix */ -value Matrix_setcolumn(vm *v, int nargs, value *args) { - objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - if (nargs==2 && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && - MORPHO_ISMATRIX(MORPHO_GETARG(args, 1))) { - unsigned int col = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - objectmatrix *src = MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); - - if (colncols) { - if (src && src->ncols*src->nrows==m->nrows) { - matrix_setcolumn(m, col, src->elements); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); - } else morpho_runtimeerror(v, MATRIX_SETCOLARGS); - +value Matrix_setindex_int_int_x(vm *v, int nargs, value *args) { + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); return MORPHO_NIL; } -/** Gets a column of a matrix */ -value Matrix_getcolumn(vm *v, int nargs, value *args) { - objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; +value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *msrc = MORPHO_GETMATRIX(MORPHO_GETARG(args, 2)); + value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); - if (nargs==1 && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - unsigned int col = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (colncols) { - double *vals; - if (matrix_getcolumn(m, col, &vals)) { - objectmatrix *new=object_matrixfromfloats(m->nrows, 1, vals); - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - } - } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); - } else morpho_runtimeerror(v, MATRIX_SETCOLARGS); + MatrixIdx_t icnt=0, jcnt=0; + LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); - return out; -} - -/** Prints a matrix */ -value Matrix_print(vm *v, int nargs, value *args) { - value self = MORPHO_SELF(args); - if (!MORPHO_ISMATRIX(self)) return Object_print(v, nargs, args); + LINALG_ERRCHECKVM(_slice_copy(iv, jv, icnt, jcnt, m, msrc, true)); - objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); - matrix_print(v, m); return MORPHO_NIL; } -/** Formatted conversion to a string */ -value Matrix_format(vm *v, int nargs, value *args) { - value out = MORPHO_NIL; +/* --------- + * column + * --------- */ + +value Matrix_getcolumn_int(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; - if (nargs==1 && - MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - varray_char str; - varray_charinit(&str); - - if (matrix_printtobuffer(MORPHO_GETMATRIX(MORPHO_SELF(args)), - MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), - &str)) { - out = object_stringfromvarraychar(&str); - if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - - varray_charclear(&str); - } else { - morpho_runtimeerror(v, VALUE_FRMTARG); - } + if (i>=0 && incols) { + objectmatrix *new=matrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); + if (new) matrix_getcolumn(a, i, new); + out=morpho_wrapandbind(v, (object *)new); + } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); return out; } -/** Matrix add */ -value Matrix_assign(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - if (a->ncols==b->ncols && a->nrows==b->nrows) { - matrix_copy(b, a); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } - +value Matrix_setcolumn_int__matrix(vm *v, int nargs, value *args) { + LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETMATRIX(MORPHO_SELF(args)), + MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)))); return MORPHO_NIL; } -/** Matrix add */ -value Matrix_add(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); +/* ---------- + * Arithmetic + * ---------- */ + +/** Add a vector */ +static value _axpy(vm *v, int nargs, value *args, double alpha) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); // Receiver is left hand operand + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); // Argument is right hand operand + objectmatrix *new = NULL; value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - if (a->ncols==b->ncols && a->nrows==b->nrows) { - objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); - if (new) { - out=MORPHO_OBJECT(new); - matrix_add(a, b, new); - } - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - double val; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { - objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); - if (new) { - out=MORPHO_OBJECT(new); - matrix_addscalar(a, 1.0, val, new); - } - } - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); - if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); + if (a->ncols==b->ncols && a->nrows==b->nrows) { + new=matrix_clone(a); + if (new) LINALG_ERRCHECKVM(matrix_axpy(alpha, b, new)); + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } -/** Right add */ -value Matrix_addr(vm *v, int nargs, value *args) { +/** Add a scalar */ +static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=NULL; value out=MORPHO_NIL; - - if (nargs==1 && (MORPHO_ISNIL(MORPHO_GETARG(args, 0)) || - MORPHO_ISNUMBER(MORPHO_GETARG(args, 0)))) { - int i=0; - if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) i=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (MORPHO_ISFLOAT(MORPHO_GETARG(args, 0))) i=(fabs(MORPHO_GETFLOATVALUE(MORPHO_GETARG(args, 0)))ncols==b->ncols && a->nrows==b->nrows) { - objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); - if (new) { - out=MORPHO_OBJECT(new); - matrix_sub(a, b, new); - } - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - double val; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { - objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); - if (new) { - out=MORPHO_OBJECT(new); - matrix_addscalar(a, 1.0, -val, new); - } - } - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); - - if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); - - return out; +value Matrix_add__matrix(vm *v, int nargs, value *args) { + return _axpy(v,nargs,args,1.0); } -/** Right subtract */ -value Matrix_subr(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - if (nargs==1 && (MORPHO_ISNIL(MORPHO_GETARG(args, 0)) || - MORPHO_ISNUMBER(MORPHO_GETARG(args, 0)))) { - int i=(MORPHO_ISNIL(MORPHO_GETARG(args, 0)) ? 0 : MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0))); +value Matrix_add_nil(vm *v, int nargs, value *args) { + return MORPHO_SELF(args); +} - if (MORPHO_ISFLOAT(MORPHO_GETARG(args, 0))) i=(fabs(MORPHO_GETFLOATVALUE(MORPHO_GETARG(args, 0)))nrows, a->ncols, false); - if (new) { - matrix_addscalar(a, 1.0, -val, new); - // now that did self - arg[0] and we want arg[0] - self so scale the whole thing by -1 - matrix_scale(new, -1.0); - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - } +value Matrix_sub__matrix(vm *v, int nargs, value *args) { + return _axpy(v,nargs,args,-1.0); +} - } else morpho_runtimeerror(v, VM_INVALIDARGS); - } else morpho_runtimeerror(v, VM_INVALIDARGS); +value Matrix_sub_x(vm *v, int nargs, value *args) { + if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr + return _xpa(v,nargs,args,1.0,-1.0); +} + +value Matrix_subr_x(vm *v, int nargs, value *args) { + return _xpa(v,nargs,args,-1.0,1.0); +} + +value Matrix_mul_float(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - return out; + double scale; + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; + + objectmatrix *new = matrix_clone(a); + if (new) matrix_scale(new, scale); + return morpho_wrapandbind(v, (object *) new); } -/** Matrix multiply */ -value Matrix_mul(vm *v, int nargs, value *args) { +value Matrix_mul__matrix(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - if (a->ncols==b->nrows) { - objectmatrix *new = object_newmatrix(a->nrows, b->ncols, false); - if (new) { - out=MORPHO_OBJECT(new); - matrix_mul(a, b, new); - morpho_bindobjects(v, 1, &out); - } - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - double scale=1.0; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) { - objectmatrix *new = object_clonematrix(a); - if (new) { - out=MORPHO_OBJECT(new); - matrix_scale(new, scale); - morpho_bindobjects(v, 1, &out); - } - } -#ifdef MORPHO_INCLUDE_SPARSE - } else if (nargs==1 && MORPHO_ISSPARSE(MORPHO_GETARG(args, 0))) { - // Returns nil to ensure it gets passed to mulr on Sparse -#endif - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + if (a->ncols==b->nrows) { + objectmatrix *new = matrix_new(a->nrows, b->ncols, false); + if (new) LINALG_ERRCHECKVM(matrix_mmul(1.0, a, b, 0.0, new)); + out = morpho_wrapandbind(v, (object *) new); + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return out; } -/** Called when multiplying on the right */ -value Matrix_mulr(vm *v, int nargs, value *args) { +value Matrix_div_float(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - double scale=1.0; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) { - objectmatrix *new = object_clonematrix(a); - if (new) { - out=MORPHO_OBJECT(new); - matrix_scale(new, scale); - morpho_bindobjects(v, 1, &out); - } - } - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); - return out; + double scale; + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; + scale = 1.0/scale; + if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); + + objectmatrix *new = matrix_clone(a); + if (new) matrix_scale(new, scale); + return morpho_wrapandbind(v, (object *) new); } -/** Solution of linear system a.x = b (i.e. x = b/a) */ -value Matrix_div(vm *v, int nargs, value *args) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - if (a->ncols==b->nrows) { - objectmatrix *new = object_newmatrix(b->nrows, b->ncols, false); - if (new) { - objectmatrixerror err; - if (MATRIX_ISSMALL(a)) { - err=matrix_divs(a, b, new); - } else { - err=matrix_divl(a, b, new); - } - if (err==MATRIX_SING) { - morpho_runtimeerror(v, MATRIX_SINGULAR); - object_free((object *) new); - } else { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - } - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); -#ifdef MORPHO_INCLUDE_SPARSE - } else if (nargs==1 && MORPHO_ISSPARSE(MORPHO_GETARG(args, 0))) { - /* Division by a sparse matrix: redirect to the divr selector of Sparse. */ - value vargs[2]={args[1],args[0]}; - return Sparse_divr(v, nargs, vargs); -#endif - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - /* Division by a scalar */ - double scale=1.0; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) { - if (fabs(scale)ncols==b->ncols && a->nrows==b->nrows) { - out=MORPHO_SELF(args); - double lambda=1.0; - morpho_valuetofloat(MORPHO_GETARG(args, 0), &lambda); - matrix_accumulate(a, lambda, b); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); + + double alpha=1.0; + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, MATRIX_ARITHARGS); return MORPHO_NIL; } + LINALG_ERRCHECKVM(matrix_axpy(alpha, b, a)); return MORPHO_NIL; } -/** Frobenius inner product */ -value Matrix_inner(vm *v, int nargs, value *args) { +/* ---------------- + * Unary operations + * ---------------- */ + +/** Matrix norm */ +value Matrix_norm_x(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - double prod=0.0; - if (matrix_inner(a, b, &prod)==MATRIX_OK) { - out = MORPHO_FLOAT(prod); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + double n; - return out; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { + if (fabs(n-1.0)nrows*a->ncols, b->nrows*b->ncols, true); - - if (new && - matrix_outer(a, b, new)==MATRIX_OK) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); - - return out; + return MORPHO_FLOAT(matrix_norm(a, MATRIX_NORM_FROBENIUS)); } -/** Matrix sum */ +/** Sums all matrix values */ value Matrix_sum(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - return MORPHO_FLOAT(matrix_sum(a)); + double sum[a->nvals]; + + matrix_sum(a, sum); + return matrix_getinterface(a)->getelfn(v, sum); } -/** Roll a matrix */ -value Matrix_roll(vm *v, int nargs, value *args) { - objectmatrix *slf = MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out = MORPHO_NIL; - int roll, axis=0; +/** Computes the trace */ +value Matrix_trace(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + double out=0.0; + LINALG_ERRCHECKVM(matrix_trace(a, &out)); + return MORPHO_FLOAT(out); +} - if (nargs>0 && - morpho_valuetoint(MORPHO_GETARG(args, 0), &roll)) { - - if (nargs==2 && !morpho_valuetoint(MORPHO_GETARG(args, 1), &axis)) return out; - - objectmatrix *new = matrix_roll(slf, roll, axis); +/** Inverts a matrix */ +value Matrix_transpose(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new = matrix_clone(a); + if (new) { + new->ncols=a->nrows; + new->nrows=a->ncols; + LINALG_ERRCHECKVM(matrix_transpose(a, new)); + } + return morpho_wrapandbind(v, (object *) new); +} - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } +/** Inverts a matrix */ +value Matrix_inverse(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new = matrix_clone(a); + if (new) LINALG_ERRCHECKVM(matrix_inverse(new)); + + return morpho_wrapandbind(v, (object *) new); +} - } else morpho_runtimeerror(v, LIST_ADDARGS); +/* ---------------- + * Eigensystem + * ---------------- */ - return out; +static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { + value ev[n]; + for (int i=0; incols; + MorphoComplex w[n]; + linalgError_t err=matrix_eigen(a, w, NULL); + if (err==LINALGERR_OK) { + if (_processeigenvalues(v, n, w, &out)) { + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + } else linalg_raiseerror(v, err); return out; } -/** Matrix eigenvalues */ -value Matrix_eigenvalues(vm *v, int nargs, value *args) { +#define _CHK(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _eigensystem_cleanup; } + +/** Finds the eigenvalues and eigenvectors of a matrix */ +value Matrix_eigensystem(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value evals=MORPHO_NIL; - if (matrix_eigen(v, a, &evals, NULL)) { - objectlist *new = MORPHO_GETLIST(evals); - list_append(new, evals); // Ensure we retain the List object - morpho_bindobjects(v, new->val.count, new->val.data); - new->val.count--; // And pop it back off + value ev=MORPHO_NIL; // Will hold eigenvalues + objectmatrix *evec=NULL; // Holds eigenvectors + objecttuple *otuple=NULL; // Tuple to return everything + + MatrixIdx_t n=a->ncols; + MorphoComplex w[n]; + + evec=matrix_clone(a); + _CHK(evec); + + linalgError_t err=matrix_eigen(a, w, evec); + if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto _eigensystem_cleanup; } + + _CHK(_processeigenvalues(v, n, w, &ev)); + + value outtuple[2] = { ev, MORPHO_OBJECT(evec) }; + otuple = object_newtuple(2, outtuple); + _CHK(otuple); + + return morpho_wrapandbind(v, (object *) otuple); + +_eigensystem_cleanup: + if (evec) object_free((object *) evec); + if (otuple) object_free((object *) otuple); + if (MORPHO_ISOBJECT(ev)) { + value evx; + objecttuple *t = MORPHO_GETTUPLE(ev); + for (int i=0; inrows != u->nrows) || (a->nrows != u->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + if (vt && ((a->ncols != vt->nrows) || (a->ncols != vt->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - if (matrix_eigen(v, a, &evals, &evecs)) { - objectlist *evallist = MORPHO_GETLIST(evals); - - list_append(resultlist, evals); // Create the output list - list_append(resultlist, evecs); - out=MORPHO_OBJECT(resultlist); - - list_append(evallist, evals); // Ensure we bind all objects at once - list_append(evallist, evecs); // by popping them onto the evallist. - list_append(evallist, out); // - morpho_bindobjects(v, evallist->val.count, evallist->val.data); - evallist->val.count-=3; // and then popping them back off. - } + objectmatrix *temp = matrix_clone(a); + if (!temp) return LINALGERR_ALLOC; - return out; + linalgError_t err = matrix_getinterface(a)->svdfn (temp, s, u, vt); + object_free((object *) temp); + return err; } -/** Inverts a matrix */ -value Matrix_inverse(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; +/* ---------------- + * QR decomposition + * ---------------- */ - // The inverse will have the number of rows and number of columns - // swapped. - objectmatrix *new = object_newmatrix(a->ncols, a->nrows, false); - if (new) { - objectmatrixerror mi = matrix_inverse(a, new); - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - - if (mi!=MATRIX_OK) matrix_raiseerror(v, mi); - } +/** Interface to QR decomposition */ +linalgError_t matrix_qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { + if (q && ((a->nrows != q->nrows) || (a->nrows != q->ncols))) return LINALGERR_INCOMPATIBLE_DIM; + if (r && ((a->nrows != r->nrows) || (a->ncols != r->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - return out; + objectmatrix *temp = matrix_clone(a); + if (!temp) return LINALGERR_ALLOC; + + linalgError_t err = matrix_getinterface(a)->qrfn (temp, q, r); + object_free((object *) temp); + return err; } -/** Transpose of a matrix */ -value Matrix_transpose(vm *v, int nargs, value *args) { +/** Processes singular values into a tuple */ +static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) { + value sv[n]; + for (int i = 0; i < n; i++) sv[i] = MORPHO_FLOAT(s[i]); + + objecttuple *new = object_newtuple(n, sv); + if (!new) return false; + + *out = MORPHO_OBJECT(new); + return true; +} + +#define _CHK_SVD(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _svd_cleanup; } +/** Singular Value Decomposition */ +value Matrix_svd(vm *v, int nargs, value *args) { + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); + + value s = MORPHO_NIL; // Will hold singular values + objectmatrix *u = NULL; // Left singular vectors + objectmatrix *vt = NULL; // Right singular vectors (transposed) + objecttuple *otuple = NULL; // Tuple to return everything + + MatrixIdx_t m = a->nrows, n = a->ncols; + MatrixIdx_t minmn = (m < n) ? m : n; + double singular_values[minmn]; + + // Allocate U (m×m) and VT (n×n) matrices + u = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); + _CHK_SVD(u); + + vt = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), n, n, a->nvals, false); + _CHK_SVD(vt); + + linalgError_t err = matrix_svd(a, singular_values, u, vt); + if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _svd_cleanup; } + + _CHK_SVD(_processsingularvalues(v, minmn, singular_values, &s)); + + value outtuple[3] = { MORPHO_OBJECT(u), s, MORPHO_OBJECT(vt) }; + otuple = object_newtuple(3, outtuple); + _CHK_SVD(otuple); + + return morpho_wrapandbind(v, (object *) otuple); + +_svd_cleanup: + if (u) object_free((object *) u); + if (vt) object_free((object *) vt); + if (otuple) object_free((object *) otuple); + morpho_freeobject(s); + + return MORPHO_NIL; +} +#undef _CHK_SVD + +/* ---------------- + * QR decomposition + * ---------------- */ + +#define _CHK_QR(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _qr_cleanup; } +/** QR Decomposition */ +value Matrix_qr(vm *v, int nargs, value *args) { + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); + + objectmatrix *q = NULL; // Orthogonal matrix Q + objectmatrix *r = NULL; // Upper triangular matrix R + objecttuple *otuple = NULL; // Tuple to return everything + + MatrixIdx_t m = a->nrows, n = a->ncols; + + // Allocate Q (m×m) and R (m×n) matrices + q = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); + _CHK_QR(q); + + r = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, n, a->nvals, false); + _CHK_QR(r); + + linalgError_t err = matrix_qr(a, q, r); + if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _qr_cleanup; } + + value outtuple[2] = { MORPHO_OBJECT(q), MORPHO_OBJECT(r) }; + otuple = object_newtuple(2, outtuple); + _CHK_QR(otuple); + + return morpho_wrapandbind(v, (object *) otuple); + +_qr_cleanup: + if (q) object_free((object *) q); + if (r) object_free((object *) r); + if (otuple) object_free((object *) otuple); + + return MORPHO_NIL; +} +#undef _CHK_QR + +/* --------- + * Products + * --------- */ + +/** Frobenius inner product */ +value Matrix_inner(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - objectmatrix *new = object_newmatrix(a->ncols, a->nrows, false); - if (new) { - matrix_transpose(a, new); - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + double prod=0.0; - return out; + LINALG_ERRCHECKVM(matrix_inner(a, b, &prod)); + + return MORPHO_FLOAT(prod); } +/** Outer product */ +value Matrix_outer(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + objectmatrix *new=matrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); + if (new) LINALG_ERRCHECKVM(matrix_r1update(1.0, a, b, new)); + + return morpho_wrapandbind(v, (object *) new); +} + +/* --------- + * Metadata + * --------- */ + /** Reshape a matrix */ value Matrix_reshape(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - if (nargs==2 && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && - MORPHO_ISINTEGER(MORPHO_GETARG(args, 1))) { - int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - - if (nrows*ncols==a->nrows*a->ncols) { - a->nrows=nrows; - a->ncols=ncols; - } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); - } else morpho_runtimeerror(v, MATRIX_RESHAPEARGS); + if (nrows*ncols==a->nrows*a->ncols) { + a->nrows=nrows; + a->ncols=ncols; + } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } -/** Trace of a matrix */ -value Matrix_trace(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; +static value _roll(vm *v, objectmatrix *a, int roll, int axis) { + objectmatrix *new = matrix_clone(a); + if (new) matrix_roll(a, roll, axis, new); + return morpho_wrapandbind(v, (object *) new); +} - if (a->nrows==a->ncols) { - double tr; - if (matrix_trace(a, &tr)==MATRIX_OK) out=MORPHO_FLOAT(tr); - } else { - morpho_runtimeerror(v, MATRIX_NOTSQ); - } - - return out; +/** Roll a matrix */ +value Matrix_roll_int_int(vm *v, int nargs, value *args) { + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); + int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + axis = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + return _roll(v, a, roll, axis); +} + +/** Roll a matrix by row */ +value Matrix_roll_int(vm *v, int nargs, value *args) { + objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); + int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + return _roll(v, a, roll, 0); } /** Enumerate protocol */ value Matrix_enumerate(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; - if (nargs==1) { - if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int i=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (i<0) out=MORPHO_INTEGER(a->ncols*a->nrows); - else if (incols*a->nrows) out=MORPHO_FLOAT(a->elements[i]); - } + if (i<0) { + out=MORPHO_INTEGER(a->ncols*a->nrows); + } else if (incols*a->nrows) { + out=matrix_getinterface(a)->getelfn(v, a->elements+i*a->nvals); + } else { + linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); } return out; } - /** Number of matrix elements */ value Matrix_count(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - return MORPHO_INTEGER(a->ncols*a->nrows); } /** Matrix dimensions */ value Matrix_dimensions(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value dim[2]; - value out=MORPHO_NIL; - dim[0]=MORPHO_INTEGER(a->nrows); - dim[1]=MORPHO_INTEGER(a->ncols); + value dim[2] = { MORPHO_INTEGER(a->nrows), MORPHO_INTEGER(a->ncols) }; + objecttuple *new=object_newtuple(2, dim); - objectlist *new=object_newlist(2, dim); - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - - return out; -} - -/** Clones a matrix */ -value Matrix_clone(vm *v, int nargs, value *args) { - value out=MORPHO_NIL; - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new=object_clonematrix(a); - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - return out; + return morpho_wrapandbind(v, (object *) new); } MORPHO_BEGINCLASS(Matrix) -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Matrix_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Matrix_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_GETCOLUMN_METHOD, Matrix_getcolumn, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_SETCOLUMN_METHOD, Matrix_setcolumn, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Matrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_FORMAT_METHOD, Matrix_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ASSIGN_METHOD, Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_addr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_MUL_METHOD, Matrix_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_MULR_METHOD, Matrix_mulr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_DIV_METHOD, Matrix_div, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ACC_METHOD, Matrix_acc, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_INNER_METHOD, Matrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_OUTER_METHOD, Matrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUM_METHOD, Matrix_sum, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_NORM_METHOD, Matrix_norm, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_INVERSE_METHOD, Matrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_TRANSPOSE_METHOD, Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_RESHAPE_METHOD, Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_EIGENVALUES_METHOD, Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_EIGENSYSTEM_METHOD, Matrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_TRACE_METHOD, Matrix_trace, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Matrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Matrix_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_DIMENSIONS_METHOD, Matrix_dimensions, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ROLL_METHOD, Matrix_roll, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Matrix_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(Matrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index_int_int, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index_x_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Matrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (Matrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (Matrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "Matrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", Matrix_sum, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "Matrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (Matrix)", Matrix_inner, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "Matrix (Matrix)", Matrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** * Initialization - * ********************************************************************* */ + * ********************************************************************** */ void matrix_initialize(void) { objectmatrixtype=object_addtype(&objectmatrixdefn); - - builtin_addfunction(MATRIX_CLASSNAME, matrix_constructor, MORPHO_FN_CONSTRUCTOR); - builtin_addfunction(MATRIX_IDENTITYCONSTRUCTOR, matrix_identityconstructor, BUILTIN_FLAGSEMPTY); + matrix_addinterface(&matrixdefn); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); @@ -1566,20 +1474,15 @@ void matrix_initialize(void) { value matrixclass=builtin_addclass(MATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(Matrix), objclass); object_setveneerclass(OBJECT_MATRIX, matrixclass); - morpho_defineerror(MATRIX_INDICESOUTSIDEBOUNDS, ERROR_HALT, MATRIX_INDICESOUTSIDEBOUNDS_MSG); - morpho_defineerror(MATRIX_INVLDINDICES, ERROR_HALT, MATRIX_INVLDINDICES_MSG); - morpho_defineerror(MATRIX_INVLDNUMINDICES, ERROR_HALT, MATRIX_INVLDNUMINDICES_MSG); - morpho_defineerror(MATRIX_CONSTRUCTOR, ERROR_HALT, MATRIX_CONSTRUCTOR_MSG); - morpho_defineerror(MATRIX_INVLDARRAYINIT, ERROR_HALT, MATRIX_INVLDARRAYINIT_MSG); - morpho_defineerror(MATRIX_ARITHARGS, ERROR_HALT, MATRIX_ARITHARGS_MSG); - morpho_defineerror(MATRIX_RESHAPEARGS, ERROR_HALT, MATRIX_RESHAPEARGS_MSG); - morpho_defineerror(MATRIX_INCOMPATIBLEMATRICES, ERROR_HALT, MATRIX_INCOMPATIBLEMATRICES_MSG); - morpho_defineerror(MATRIX_SINGULAR, ERROR_HALT, MATRIX_SINGULAR_MSG); - morpho_defineerror(MATRIX_NOTSQ, ERROR_HALT, MATRIX_NOTSQ_MSG); - morpho_defineerror(MATRIX_OPFAILED, ERROR_HALT, MATRIX_OPFAILED_MSG); - morpho_defineerror(MATRIX_SETCOLARGS, ERROR_HALT, MATRIX_SETCOLARGS_MSG); - morpho_defineerror(MATRIX_NORMARGS, ERROR_HALT, MATRIX_NORMARGS_MSG); - morpho_defineerror(MATRIX_IDENTCONSTRUCTOR, ERROR_HALT, MATRIX_IDENTCONSTRUCTOR_MSG); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Matrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + + morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); + + complematrix_initialize(); } - -#endif diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index fe74a5151..7fa15bd3b 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -1,44 +1,26 @@ /** @file matrix.h * @author T J Atherton * - * @brief Veneer class over the objectmatrix type that interfaces with blas and lapack - */ + * @brief New linear algebra library +*/ #ifndef matrix_h #define matrix_h -#include "build.h" -#ifdef MORPHO_INCLUDE_LINALG - -#include -#include "classes.h" -/** Use Apple's Accelerate library for LAPACK and BLAS */ -#ifdef __APPLE__ -#ifdef MORPHO_LINALG_USE_ACCELERATE -#define ACCELERATE_NEW_LAPACK -#include -#define MATRIX_LAPACK_PRESENT -#endif -#endif - -/** Otherwise, use LAPACKE */ -#ifndef MATRIX_LAPACK_PRESENT -#include -#include -#define MORPHO_LINALG_USE_LAPACKE -#define MATRIX_LAPACK_PRESENT -#endif - -#include "cmplx.h" -#include "list.h" +#define LINALG_MAXMATRIXDEFNS 4 /* ------------------------------------------------------- - * Matrix objects + * Matrix object type * ------------------------------------------------------- */ extern objecttype objectmatrixtype; #define OBJECT_MATRIX objectmatrixtype +extern objecttypedefn objectmatrixdefn; + +typedef int MatrixIdx_t; // Type used for matrix indices +typedef size_t MatrixCount_t; // Type used to count total number of elements + /** Matrices are a purely numerical collection type oriented toward linear algebra. Elements are stored in column-major format, i.e. [ 1 2 ] @@ -47,8 +29,10 @@ extern objecttype objectmatrixtype; typedef struct { object obj; - unsigned int nrows; - unsigned int ncols; + MatrixIdx_t nrows; // Number of rows + MatrixIdx_t ncols; // Number of columns + MatrixIdx_t nvals; // Number of doubles per entry + MatrixCount_t nels; // Total number of entries (nrows*ncols*nvals) double *elements; double matrixdata[]; } objectmatrix; @@ -59,147 +43,194 @@ typedef struct { /** Gets the object as an matrix */ #define MORPHO_GETMATRIX(val) ((objectmatrix *) MORPHO_GETOBJECT(val)) -/** Creates a matrix object */ -objectmatrix *object_newmatrix(unsigned int nrows, unsigned int ncols, bool zero); - -/** Creates a new matrix from an array */ -objectmatrix *object_matrixfromarray(objectarray *array); - -/** Creates a new matrix from an existing matrix */ -objectmatrix *object_clonematrix(objectmatrix *array); - /** @brief Use to create static matrices on the C stack @details Intended for small matrices; Caller needs to supply a double array of size nr*nc. */ -#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc } +#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nels=nr*nc } /** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ #define MATRIX_ISSMALL(m) (m->nrows*m->ncols +#include + +/* ------------------------------------------------------- + * objectmatrixerror type + * ------------------------------------------------------- */ + +typedef enum { + LINALGERR_OK, // Operation performed correctly + LINALGERR_INCOMPATIBLE_DIM, // Matrices have incompatible dimensions, e.g. for multiplication + LINALGERR_INDX_OUT_OF_BNDS, // Index out of bounds, e.g. for access. + LINALGERR_MATRIX_SINGULAR, // Matrix is singular + LINALGERR_NOT_SQUARE, // Matrix is required to be square for this algorithm + LINALGERR_LAPACK_INVLD_ARGS, // Invalid arguments to LAPACK routine + LINALGERR_OP_FAILED, // Matrix operation failed + LINALGERR_NOT_SUPPORTED, // Operation not supported for this matrix type + LINALGERR_NON_NUMERICAL, // Non numerical args supplied + LINALGERR_INVLD_ARG, // Invalid argument supplied + LINALGERR_ALLOC // Memory allocation failed +} linalgError_t; + +/* ------------------------------------------------------- + * Errors + * ------------------------------------------------------- */ + +#define LINALG_INCOMPATIBLEMATRICES "LnAlgMtrxIncmptbl" +#define LINALG_INCOMPATIBLEMATRICES_MSG "Matrices have incompatible shape." + +#define LINALG_INDICESOUTSIDEBOUNDS "LnAlgMtrxIndxBnds" +#define LINALG_INDICESOUTSIDEBOUNDS_MSG "Matrix index out of bounds." + +#define LINALG_SINGULAR "LnAlgMtrxSnglr" +#define LINALG_SINGULAR_MSG "Matrix is singular." + +#define LINALG_NOTSQ "LnAlgMtrxNtSq" +#define LINALG_NOTSQ_MSG "Matrix is not square." + +#define LINALG_LAPACK_ARGS "LnAlgLapackArgs" +#define LINALG_LAPACK_ARGS_MSG "Lapack function called with invalid arguments." + +#define LINALG_OPFAILED "LnAlgMtrxOpFld" +#define LINALG_OPFAILED_MSG "Matrix operation failed." + +#define LINALG_NOTSUPPORTED "LnAlgMtrxNtSpprtd" +#define LINALG_NOTSUPPORTED_MSG "Operation not supported for this matrix type." + +#define LINALG_INVLDARGS "LnAlgMtrxInvldArg" +#define LINALG_INVLDARGS_MSG "Invalid arguments to matrix method." + +#define LINALG_NNNMRCL_ARG "LnAlgMtrxNnNmrclArg" +#define LINALG_NNNMRCL_ARG_MSG "Matrix method requires numerical arguments." + +#define LINALG_NORMARGS "LnAlgMtrxNrmArgs" +#define LINALG_NORMARGS_MSG "Method 'norm' requires a supported argument: 1 or inf." + +/* ------------------------------------------------------- + * Interface + * ------------------------------------------------------- */ + +void linalg_raiseerror(vm *v, linalgError_t err); + +/** Macros to simplify error checking: + - evaluates expression f that returns linalgError_t; + - if an error occurred, raises the corresponding error in a vm called v */ +#define LINALG_ERRCHECKVM(f) { linalgError_t err = f; if (err!=LINALGERR_OK) linalg_raiseerror(v, err); } + +/** As for LINALG_ERRCHECKVM but additionally jumps to a given label */ +#define LINALG_ERRCHECKVMGOTO(f, label) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto label; }} + +/** As for LINALG_ERRCHECKVM but additionally returnsl */ +#define LINALG_ERRCHECKVMRETURN(f, ret) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); return ret; }} + +/** Similar to the above, except returns the error rather than raising it */ +#define LINALG_ERRCHECKRETURN(f) { linalgError_t err = f; if (err!=LINALGERR_OK) return err; } + +/* ------------------------------------------------------- + * Include the rest of the library + * ------------------------------------------------------- */ + +#include "matrix.h" +#include "complexmatrix.h" + +#endif diff --git a/src/linalg/xmatrix.c b/src/linalg/xmatrix.c new file mode 100644 index 000000000..b71e1aed6 --- /dev/null +++ b/src/linalg/xmatrix.c @@ -0,0 +1,1585 @@ +/** @file matrix.c + * @author T J Atherton + * + * @brief Veneer class over the objectmatrix type that interfaces with blas and lapack + */ + +#include "build.h" +#ifdef MORPHO_INCLUDE_LINALG + +#include +#include "morpho.h" +#include "classes.h" + +#include "matrix.h" +#include "sparse.h" +#include "format.h" + +/* ********************************************************************** + * Matrix objects + * ********************************************************************** */ + +objecttype objectmatrixtype; + +/** Function object definitions */ +size_t objectmatrix_sizefn(object *obj) { + return sizeof(objectmatrix)+sizeof(double) * + ((objectmatrix *) obj)->ncols * + ((objectmatrix *) obj)->nrows; +} + +void objectmatrix_printfn(object *obj, void *v) { + morpho_printf(v, ""); +} + +objecttypedefn objectmatrixdefn = { + .printfn=objectmatrix_printfn, + .markfn=NULL, + .freefn=NULL, + .sizefn=objectmatrix_sizefn, + .hashfn=NULL, + .cmpfn=NULL +}; + +/** Creates a matrix object */ +objectmatrix *object_newmatrix(unsigned int nrows, unsigned int ncols, bool zero) { + unsigned int nel = nrows*ncols; + objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix)+nel*sizeof(double), OBJECT_MATRIX); + + if (new) { + new->ncols=ncols; + new->nrows=nrows; + new->elements=new->matrixdata; + if (zero) { + memset(new->elements, 0, sizeof(double)*nel); + } + } + + return new; +} + +/* ********************************************************************** + * Other constructors + * ********************************************************************** */ + +/* + * Create matrices from array objects + */ + +void matrix_raiseerror(vm *v, objectmatrixerror err) { + switch(err) { + case MATRIX_OK: break; + case MATRIX_INCMPTBLDIM: morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); break; + case MATRIX_SING: morpho_runtimeerror(v, MATRIX_SINGULAR); break; + case MATRIX_INVLD: morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); break; + case MATRIX_BNDS: morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); break; + case MATRIX_NSQ: morpho_runtimeerror(v, MATRIX_NOTSQ); break; + case MATRIX_FAILED: morpho_runtimeerror(v, MATRIX_OPFAILED); break; + case MATRIX_ALLOC: morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); break; + } +} + +/** Recurses into an objectarray to find the dimensions of the array and all child arrays + * @param[in] array - to search + * @param[out] dim - array of dimensions to be filled out (must be zero'd before initial call) + * @param[in] maxdim - maximum number of dimensions + * @param[out] ndim - number of dimensions of the array */ +bool matrix_getarraydimensions(objectarray *array, unsigned int dim[], unsigned int maxdim, unsigned int *ndim) { + unsigned int n=0, m=0; + for (n=0; nndim; n++) { + int k=MORPHO_GETINTEGERVALUE(array->data[n]); + if (k>dim[n]) dim[n]=k; + } + + if (maxdimndim) return false; + + for (unsigned int i=array->ndim; indim+array->nelements; i++) { + if (MORPHO_ISARRAY(array->data[i])) { + if (!matrix_getarraydimensions(MORPHO_GETARRAY(array->data[i]), dim+n, maxdim-n, &m)) return false; + } + } + *ndim=n+m; + + return true; +} + +/** Looks up an array element recursively if necessary */ +value matrix_getarrayelement(objectarray *array, unsigned int ndim, unsigned int *indx) { + unsigned int na=array->ndim; + value out; + + if (array_getelement(array, na, indx, &out)==ARRAY_OK) { + if (ndim==na) return out; + if (MORPHO_ISARRAY(out)) { + return matrix_getarrayelement(MORPHO_GETARRAY(out), ndim-na, indx+na); + } + } + + return MORPHO_NIL; +} + +/** Creates a new array from a list of values */ +objectmatrix *object_matrixfromarray(objectarray *array) { + unsigned int dim[2]={0,1}; // The 1 is to allow for vector arrays. + unsigned int ndim=0; + objectmatrix *ret=NULL; + + if (matrix_getarraydimensions(array, dim, 2, &ndim)) { + ret=object_newmatrix(dim[0], dim[1], true); + } + + unsigned int indx[2]; + if (ret) for (unsigned int i=0; ielements[j*dim[0]+i]); + } else if (!MORPHO_ISNIL(f)) { + object_free((object *) ret); return NULL; + } + } + } + + return ret; +} + +/* + * Create matrices from lists + */ + +/** Recurses into an objectlist to find the dimensions of the array and all child arrays + * @param[in] list - to search + * @param[out] dim - array of dimensions to be filled out (must be zero'd before initial call) + * @param[in] maxdim - maximum number of dimensions + * @param[out] ndim - number of dimensions of the array */ +bool matrix_getlistdimensions(objectlist *list, unsigned int dim[], unsigned int maxdim, unsigned int *ndim) { + unsigned int m=0; + + if (maxdim==0) return false; + + /* Store the length */ + if (list->val.count>dim[0]) dim[0]=list->val.count; + + for (unsigned int i=0; ival.count; i++) { + if (MORPHO_ISLIST(list->val.data[i]) && maxdim>0) { + matrix_getlistdimensions(MORPHO_GETLIST(list->val.data[i]), dim+1, maxdim-1, &m); + } + } + *ndim=m+1; + + return true; +} + +/** Gets a matrix element from a (potentially nested) list. */ +bool matrix_getlistelement(objectlist *list, unsigned int ndim, unsigned int *indx, value *val) { + value out=MORPHO_NIL; + objectlist *l=list; + for (unsigned int i=0; ival.count) { + out=l->val.data[indx[i]]; + if (i2) return false; + + unsigned int indx[2]; + if (ret) for (unsigned int i=0; ielements[j*dim[0]+i]); + } else { + object_free((object *) ret); + return NULL; + } + } + } + + return ret; +} + +/** Creates a matrix from a list of floats */ +objectmatrix *object_matrixfromfloats(unsigned int nrows, unsigned int ncols, double *list) { + objectmatrix *ret=NULL; + + ret=object_newmatrix(nrows, ncols, true); + if (ret) cblas_dcopy(ncols*nrows, list, 1, ret->elements, 1); + + return ret; +} + +/* + * Clone matrices + */ + +/** Clone a matrix */ +objectmatrix *object_clonematrix(objectmatrix *in) { + objectmatrix *new = object_newmatrix(in->nrows, in->ncols, false); + + if (new) { + cblas_dcopy(in->ncols * in->nrows, in->elements, 1, new->elements, 1); + } + + return new; +} + +/* ********************************************************************** + * Matrix operations + * ********************************************************************* */ + +/** @brief Sets a matrix element. + @returns true if the element is in the range of the matrix, false otherwise */ +bool matrix_setelement(objectmatrix *matrix, unsigned int row, unsigned int col, double value) { + if (colncols && rownrows) { + matrix->elements[col*matrix->nrows+row]=value; + return true; + } + return false; +} + +/** @brief Gets a matrix element + * @returns true if the element is in the range of the matrix, false otherwise */ +bool matrix_getelement(objectmatrix *matrix, unsigned int row, unsigned int col, double *value) { + if (colncols && rownrows) { + if (value) *value=matrix->elements[col*matrix->nrows+row]; + return true; + } + return false; +} + +/** @brief Gets a column's entries + * @param[in] matrix - the matrix + * @param[in] col - column number + * @param[out] v - column entries (matrix->nrows in number) + * @returns true if the element is in the range of the matrix, false otherwise */ +bool matrix_getcolumn(objectmatrix *matrix, unsigned int col, double **v) { + if (colncols) { + *v=&matrix->elements[col*matrix->nrows]; + return true; + } + return false; +} + +/** @brief Sets a column's entries + * @param[in] matrix - the matrix + * @param[in] col - column number + * @param[in] v - column entries (matrix->nrows in number) + * @returns true if the element is in the range of the matrix, false otherwise */ +bool matrix_setcolumn(objectmatrix *matrix, unsigned int col, double *v) { + if (colncols) { + cblas_dcopy(matrix->nrows, v, 1, &matrix->elements[col*matrix->nrows], 1); + return true; + } + return false; +} + +/** @brief Add a vector to a column in a matrix + * @param[in] m - the matrix + * @param[in] col - column number + * @param[in] alpha - scale + * @param[out] v - column entries (matrix->nrows in number) [should have m->nrows entries] + * @returns true on success */ +bool matrix_addtocolumn(objectmatrix *m, unsigned int col, double alpha, double *v) { + if (colncols) { + cblas_daxpy(m->nrows, alpha, v, 1, &m->elements[col*m->nrows], 1); + return true; + } + return false; +} + +/* ********************************************************************** + * Matrix arithmetic + * ********************************************************************* */ + +/** Copies one matrix to another */ +unsigned int matrix_countdof(objectmatrix *a) { + return a->ncols*a->nrows; +} + +/** Copies one matrix to another */ +objectmatrixerror matrix_copy(objectmatrix *a, objectmatrix *out) { + if (a->ncols==out->ncols && a->nrows==out->nrows) { + cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Copies a matrix to another at an arbitrary point */ +objectmatrixerror matrix_copyat(objectmatrix *a, objectmatrix *out, int row0, int col0) { + if (col0+a->ncols<=out->ncols && row0+a->nrows<=out->nrows) { + for (int j=0; jncols; j++) { + for (int i=0; inrows; i++) { + double value; + if (!matrix_getelement(a, i, j, &value)) return MATRIX_BNDS; + if (!matrix_setelement(out, row0+i, col0+j, value)) return MATRIX_BNDS; + } + } + + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Performs a + b -> out. */ +objectmatrixerror matrix_add(objectmatrix *a, objectmatrix *b, objectmatrix *out) { + if (a->ncols==b->ncols && a->ncols==out->ncols && + a->nrows==b->nrows && a->nrows==out->nrows) { + if (a!=out) cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); + cblas_daxpy(a->ncols * a->nrows, 1.0, b->elements, 1, out->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Performs lambda*a + beta -> out. */ +objectmatrixerror matrix_addscalar(objectmatrix *a, double lambda, double beta, objectmatrix *out) { + if (a->ncols==out->ncols && a->nrows==out->nrows) { + for (unsigned int i=0; inrows*out->ncols; i++) { + out->elements[i]=lambda*a->elements[i]+beta; + } + return MATRIX_OK; + } + + return MATRIX_INCMPTBLDIM; +} + +/** Performs a + lambda*b -> a. */ +objectmatrixerror matrix_accumulate(objectmatrix *a, double lambda, objectmatrix *b) { + if (a->ncols==b->ncols && a->nrows==b->nrows ) { + cblas_daxpy(a->ncols * a->nrows, lambda, b->elements, 1, a->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Performs a - b -> out */ +objectmatrixerror matrix_sub(objectmatrix *a, objectmatrix *b, objectmatrix *out) { + if (a->ncols==b->ncols && a->ncols==out->ncols && + a->nrows==b->nrows && a->nrows==out->nrows) { + if (a!=out) cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); + cblas_daxpy(a->ncols * a->nrows, -1.0, b->elements, 1, out->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Performs a * b -> out */ +objectmatrixerror matrix_mul(objectmatrix *a, objectmatrix *b, objectmatrix *out) { + if (a->ncols==b->nrows && a->nrows==out->nrows && b->ncols==out->ncols) { + cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, 1.0, a->elements, a->nrows, b->elements, b->nrows, 0.0, out->elements, out->nrows); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Finds the Frobenius inner product of two matrices */ +objectmatrixerror matrix_inner(objectmatrix *a, objectmatrix *b, double *out) { + if (a->ncols==b->ncols && a->nrows==b->nrows) { + *out=cblas_ddot(a->ncols*a->nrows, a->elements, 1, b->elements, 1); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Computes the outer product of two matrices */ +objectmatrixerror matrix_outer(objectmatrix *a, objectmatrix *b, objectmatrix *out) { + int m=a->nrows*a->ncols, n=b->nrows*b->ncols; + if (m==out->nrows && n==out->ncols) { + cblas_dger(CblasColMajor, m, n, 1, a->elements, 1, b->elements, 1, out->elements, out->nrows); + return MATRIX_OK; + } + return MATRIX_INCMPTBLDIM; +} + +/** Solves the system a.x = b + * @param[in] a lhs + * @param[in] b rhs + * @param[in] out - the solution x + * @param[out] lu - LU decomposition of a; you must provide an array the same size as a. + * @param[out] pivot - you must provide an array with the same number of rows as a. + * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. + * */ +static objectmatrixerror matrix_div(objectmatrix *a, objectmatrix *b, objectmatrix *out, double *lu, int *pivot) { + int n=a->nrows, nrhs = b->ncols, info; + + cblas_dcopy(a->ncols * a->nrows, a->elements, 1, lu, 1); + if (b!=out) cblas_dcopy(b->ncols * b->nrows, b->elements, 1, out->elements, 1); +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, lu, n, pivot, out->elements, n); +#else + dgesv_(&n, &nrhs, lu, &n, pivot, out->elements, &n, &info); +#endif + + return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); +} + +/** Solves the system a.x = b for small matrices (test with MATRIX_ISSMALL) + * @warning Uses the C stack for storage, which avoids malloc but can cause stack overflow */ +objectmatrixerror matrix_divs(objectmatrix *a, objectmatrix *b, objectmatrix *out) { + if (a->ncols==b->nrows && a->ncols == out->nrows) { + int pivot[a->nrows]; + double lu[a->nrows*a->ncols]; + + return matrix_div(a, b, out, lu, pivot); + } + return MATRIX_INCMPTBLDIM; +} + +/** Solves the system a.x = b for large matrices (test with MATRIX_ISSMALL) */ +objectmatrixerror matrix_divl(objectmatrix *a, objectmatrix *b, objectmatrix *out) { + objectmatrixerror ret = MATRIX_ALLOC; // Returned if allocation fails + if (!(a->ncols==b->nrows && a->ncols == out->nrows)) return MATRIX_INCMPTBLDIM; + + int *pivot=MORPHO_MALLOC(sizeof(int)*a->nrows); + double *lu=MORPHO_MALLOC(sizeof(double)*a->nrows*a->ncols); + + if (pivot && lu) ret=matrix_div(a, b, out, lu, pivot); + + if (pivot) MORPHO_FREE(pivot); + if (lu) MORPHO_FREE(lu); + + return ret; +} + +/** Inverts the matrix a + * @param[in] a lhs + * @param[in] out - the solution x + * @returns objectmatrixerror indicating the status; MATRIX_OK indicates success. + * */ +objectmatrixerror matrix_inverse(objectmatrix *a, objectmatrix *out) { + int nrows=a->nrows, ncols=a->ncols, info; + if (!(a->ncols==out->nrows && a->ncols == out->nrows)) return MATRIX_INCMPTBLDIM; + + int pivot[nrows]; + + cblas_dcopy(a->ncols * a->nrows, a->elements, 1, out->elements, 1); +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgetrf(LAPACK_COL_MAJOR, nrows, ncols, out->elements, nrows, pivot); +#else + dgetrf_(&nrows, &ncols, out->elements, &nrows, pivot, &info); +#endif + + if (info!=0) return (info>0 ? MATRIX_SING : MATRIX_INVLD); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgetri(LAPACK_COL_MAJOR, nrows, out->elements, nrows, pivot); +#else + int lwork=nrows*ncols; double work[nrows*ncols]; + dgetri_(&nrows, out->elements, &nrows, pivot, work, &lwork, &info); +#endif + + return (info==0 ? MATRIX_OK : (info>0 ? MATRIX_SING : MATRIX_INVLD)); +} + +/** Compute eigenvalues and eigenvectors of a matrix + * @param[in] a - an objectmatrix to diagonalize of size n + * @param[out] wr - a buffer of size n will hold the real part of the eigenvalues on exit + * @param[out] wi - a buffer of size n will hold the imag part of the eigenvalues on exit + * @param[out] vec - (optional) will be filled out with eigenvectors as columns (should be of size n) + * @returns an error code or MATRIX_OK on success */ +objectmatrixerror matrix_eigensystem(objectmatrix *a, double *wr, double *wi, objectmatrix *vec) { + int info, n=a->nrows; + if (a->nrows!=a->ncols) return MATRIX_NSQ; + if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return MATRIX_INCMPTBLDIM; + + // Copy a to prevent destruction + size_t size = ((size_t) n) * ((size_t) n) * sizeof(double); + double *acopy=MORPHO_MALLOC(size); + if (!acopy) return MATRIX_ALLOC; + cblas_dcopy(n*n, a->elements, 1, acopy, 1); + +#ifdef MORPHO_LINALG_USE_LAPACKE + info=LAPACKE_dgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, acopy, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); +#else + int lwork=4*n; double work[4*n]; + dgeev_("N", (vec ? "V" : "N"), &n, acopy, &n, wr, wi, NULL, &n, (vec ? vec->elements : NULL), &n, work, &lwork, &info); +#endif + + if (acopy) MORPHO_FREE(acopy); // Free up buffer + + if (info!=0) return (info>0 ? MATRIX_FAILED : MATRIX_INVLD); + + return MATRIX_OK; +} + + +/** Sums all elements of a matrix using Kahan summation */ +double matrix_sum(objectmatrix *a) { + unsigned int nel=a->ncols*a->nrows; + double sum=0.0, c=0.0, y,t; + + for (unsigned int i=0; ielements[i]-c; + t=sum+y; + c=(t-sum)-y; + sum=t; + } + return sum; +} + +/** Norms */ + +/** Computes the Frobenius norm of a matrix */ +double matrix_norm(objectmatrix *a) { + double nrm2=cblas_dnrm2(a->ncols*a->nrows, a->elements, 1); + return nrm2; +} + +/** Computes the L1 norm of a matrix */ +double matrix_L1norm(objectmatrix *a) { + unsigned int nel=a->ncols*a->nrows; + double sum=0.0, c=0.0, y,t; + + for (unsigned int i=0; ielements[i])-c; + t=sum+y; + c=(t-sum)-y; + sum=t; + } + return sum; +} + +/** Computes the Ln norm of a matrix */ +double matrix_Lnnorm(objectmatrix *a, double n) { + unsigned int nel=a->ncols*a->nrows; + double sum=0.0, c=0.0, y,t; + + for (unsigned int i=0; ielements[i],n)-c; + t=sum+y; + c=(t-sum)-y; + sum=t; + } + return pow(sum,1.0/n); +} + +/** Computes the Linf norm of a matrix */ +double matrix_Linfnorm(objectmatrix *a) { + unsigned int nel=a->ncols*a->nrows; + double max=0.0; + + for (unsigned int i=0; ielements[i]); + if (y>max) max=y; + } + return max; +} + +/** Transpose a matrix */ +objectmatrixerror matrix_transpose(objectmatrix *a, objectmatrix *out) { + if (!(a->ncols==out->nrows && a->nrows == out->ncols)) return MATRIX_INCMPTBLDIM; + + /* Copy elements a column at a time */ + for (unsigned int i=0; incols; i++) { + cblas_dcopy(a->nrows, a->elements+(i*a->nrows), 1, out->elements+i, a->ncols); + } + return MATRIX_OK; +} + +/** Calculate the trace of a matrix */ +objectmatrixerror matrix_trace(objectmatrix *a, double *out) { + if (a->nrows!=a->ncols) return MATRIX_NSQ; + *out=1.0; + *out=cblas_ddot(a->nrows, a->elements, a->ncols+1, out, 0); + + return MATRIX_OK; +} + +/** Scale a matrix */ +objectmatrixerror matrix_scale(objectmatrix *a, double scale) { + cblas_dscal(a->ncols*a->nrows, scale, a->elements, 1); + + return MATRIX_OK; +} + +/** Load the indentity matrix*/ +objectmatrixerror matrix_identity(objectmatrix *a) { + if (a->ncols!=a->nrows) return MATRIX_NSQ; + memset(a->elements, 0, sizeof(double)*a->nrows*a->ncols); + for (int i=0; inrows; i++) a->elements[i+a->nrows*i]=1.0; + return MATRIX_OK; +} + +/** Sets a matrix to zero */ +objectmatrixerror matrix_zero(objectmatrix *a) { + memset(a->elements, 0, sizeof(double)*a->nrows*a->ncols); + + return MATRIX_OK; +} + +/** Prints a matrix */ +void matrix_print(vm *v, objectmatrix *m) { + for (int i=0; inrows; i++) { // Rows run from 0...m + morpho_printf(v, "[ "); + for (int j=0; jncols; j++) { // Columns run from 0...k + double val; + matrix_getelement(m, i, j, &val); + morpho_printf(v, "%g ", (fabs(val)nrows-1 ? "\n" : "")); + } +} + +/** Prints a matrix to a buffer */ +bool matrix_printtobuffer(objectmatrix *m, char *format, varray_char *out) { + for (int i=0; inrows; i++) { // Rows run from 0...m + varray_charadd(out, "[ ", 2); + + for (int j=0; jncols; j++) { // Columns run from 0...k + double val; + matrix_getelement(m, i, j, &val); + if (!format_printtobuffer(MORPHO_FLOAT(val), format, out)) return false; + varray_charadd(out, " ", 1); + } + varray_charadd(out, "]", 1); + if (inrows-1) varray_charadd(out, "\n", 1); + } + return true; +} + +/** Matrix eigensystem */ +bool matrix_eigen(vm *v, objectmatrix *a, value *evals, value *evecs) { + double *ev = MORPHO_MALLOC(sizeof(double)*a->nrows*2); // Allocate temporary memory for eigenvalues + double *er=ev, *ei=ev+a->nrows; + + objectmatrix *vecs=NULL; // A new matrix for eigenvectors + objectlist *vallist = object_newlist(0, NULL); // List to hold eigenvalues + bool success=false; + + if (evecs) vecs=object_clonematrix(a); // Clones a to hold eigenvectors + + // Check that everything was allocated correctly + if (!(ev && vallist && (!evecs || vecs))) { + morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto matrix_eigen_cleanup; }; + + objectmatrixerror err=matrix_eigensystem(a, er, ei, vecs); + + if (err!=MATRIX_OK) { + matrix_raiseerror(v, err); + goto matrix_eigen_cleanup; + } + + // Now process the eigenvalues + for (int i=0; inrows; i++) { + if (fabs(ei[i])val.count; i++) { + if (MORPHO_ISOBJECT(vallist->val.data[i])) object_free(MORPHO_GETOBJECT(vallist->val.data[i])); + } + object_free((object *) vallist); + } + if (vecs) object_free((object *) vecs); + } + + return success; +} + +/* ********************************************************************** + * Matrix veneer class + * ********************************************************************* */ + +/** Constructs a Matrix object */ +value matrix_constructor(vm *v, int nargs, value *args) { + unsigned int nrows, ncols; + objectmatrix *new=NULL; + value out=MORPHO_NIL; + + if (nargs==2 && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 1)) ) { + nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + new=object_newmatrix(nrows, ncols, true); + } else if (nargs==1 && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + ncols = 1; + new=object_newmatrix(nrows, ncols, true); + } else if (nargs==1 && + MORPHO_ISARRAY(MORPHO_GETARG(args, 0))) { + new=object_matrixfromarray(MORPHO_GETARRAY(MORPHO_GETARG(args, 0))); + if (!new) morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); +#ifdef MORPHO_INCLUDE_SPARSE + } else if (nargs==1 && + MORPHO_ISLIST(MORPHO_GETARG(args, 0))) { + new=object_matrixfromlist(MORPHO_GETLIST(MORPHO_GETARG(args, 0))); + if (!new) { + /** Could this be a concatenation operation? */ + objectsparseerror err = sparse_catmatrix(MORPHO_GETLIST(MORPHO_GETARG(args, 0)), &new); + if (err==SPARSE_INVLDINIT) { + morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); + } else if (err!=SPARSE_OK) sparse_raiseerror(v, err); + } +#endif + } else if (nargs==1 && + MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + new=object_clonematrix(MORPHO_GETMATRIX(MORPHO_GETARG(args, 0))); + if (!new) morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); +#ifdef MORPHO_INCLUDE_SPARSE + } else if (nargs==1 && + MORPHO_ISSPARSE(MORPHO_GETARG(args, 0))) { + objectsparseerror err=sparse_tomatrix(MORPHO_GETSPARSE(MORPHO_GETARG(args, 0)), &new); + if (err!=SPARSE_OK) morpho_runtimeerror(v, MATRIX_INVLDARRAYINIT); +#endif + } else morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); + + if (new) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + + return out; +} + +/** Creates an identity matrix */ +value matrix_identityconstructor(vm *v, int nargs, value *args) { + int n; + objectmatrix *new=NULL; + value out = MORPHO_NIL; + + if (nargs==1 && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + new=object_newmatrix(n, n, false); + if (new) { + matrix_identity(new); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + } else morpho_runtimeerror(v, MATRIX_IDENTCONSTRUCTOR); + + if (new) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + + return out; +} + +/** Checks that a matrix is indexed with 2 indices with a generic interface */ +bool matrix_slicedim(value * a, unsigned int ndim){ + if (ndim>2||ndim<0) return false; + return true; +} + +/** Constucts a new matrix with a generic interface */ +void matrix_sliceconstructor(unsigned int *slicesize,unsigned int ndim,value* out){ + unsigned int numcol = 1; + if (ndim == 2) { + numcol = slicesize[1]; + } + *out = MORPHO_OBJECT(object_newmatrix(slicesize[0],numcol,false)); +} +/** Copies data from a at indx to out at newindx with a generic interface */ +objectarrayerror matrix_slicecopy(value * a,value * out, unsigned int ndim, unsigned int *indx,unsigned int *newindx){ + double num; // matrices store doubles; + unsigned int colindx = 0; + unsigned int colnewindx = 0; + + if (ndim == 2) { + colindx = indx[1]; + colnewindx = newindx[1]; + } + + if (!(matrix_getelement(MORPHO_GETMATRIX(*a),indx[0],colindx,&num)&& + matrix_setelement(MORPHO_GETMATRIX(*out),newindx[0],colnewindx,num))){ + return ARRAY_OUTOFBOUNDS; + } + return ARRAY_OK; +} + +/** Rolls the matrix list */ +void matrix_rollflat(objectmatrix *a, objectmatrix *b, int nplaces) { + unsigned int N = a->nrows*a->ncols; + int n = abs(nplaces); + if (n>N) n = n % N; + unsigned int Np = N - n; // Number of elements to roll + + if (nplaces<0) { + memcpy(b->matrixdata, a->matrixdata+n, sizeof(double)*Np); + memcpy(b->matrixdata+Np, a->matrixdata, sizeof(double)*n); + } else { + memcpy(b->matrixdata+n, a->matrixdata, sizeof(double)*Np); + if (n>0) memcpy(b->matrixdata, a->matrixdata+Np, sizeof(double)*n); + } +} + +/** Copies arow from matrix a into brow for matrix b */ +void matrix_copyrow(objectmatrix *a, int arow, objectmatrix *b, int brow) { + cblas_dcopy(a->ncols, a->elements+arow, a->nrows, b->elements+brow, a->nrows); +} + +/** Rolls a list by a number of elements */ +objectmatrix *matrix_roll(objectmatrix *a, int nplaces, int axis) { + objectmatrix *new=object_newmatrix(a->nrows, a->ncols, false); + + if (new) { + switch(axis) { + case 0: { // TODO: Could probably be faster + for (int i=0; inrows; i++) { + int j = (i+nplaces); + if (j<0) j+=a->nrows; + matrix_copyrow(a, i, new, j % a->nrows); + } + } + break; + case 1: matrix_rollflat(a, new, nplaces*a->nrows); break; + } + } + + return new; +} + +/** Gets the matrix element with given indices */ +value Matrix_getindex(vm *v, int nargs, value *args) { + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); + unsigned int indx[2]={0,0}; + value out = MORPHO_NIL; + if (nargs>2){ + morpho_runtimeerror(v, MATRIX_INVLDNUMINDICES); + return out; + } + + if (array_valuelisttoindices(nargs, args+1, indx)) { + double outval; + if (!matrix_getelement(m, indx[0], indx[1], &outval)) { + morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + } else { + out = MORPHO_FLOAT(outval); + } + } else { // now try to get a slice + objectarrayerror err = getslice(&MORPHO_SELF(args), &matrix_slicedim, &matrix_sliceconstructor, &matrix_slicecopy, nargs, &MORPHO_GETARG(args,0), &out); + if (err!=ARRAY_OK) MORPHO_RAISE(v, array_to_matrix_error(err) ); + if (MORPHO_ISOBJECT(out)){ + morpho_bindobjects(v,1,&out); + } else morpho_runtimeerror(v, MATRIX_INVLDINDICES); + } + return out; +} + +/** Sets the matrix element with given indices */ +value Matrix_setindex(vm *v, int nargs, value *args) { + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); + unsigned int indx[2]={0,0}; + + if (array_valuelisttoindices(nargs-1, args+1, indx)) { + double value=0.0; + if (MORPHO_ISFLOAT(args[nargs])) value=MORPHO_GETFLOATVALUE(args[nargs]); + if (MORPHO_ISINTEGER(args[nargs])) value=(double) MORPHO_GETINTEGERVALUE(args[nargs]); + + if (!matrix_setelement(m, indx[0], indx[1], value)) { + morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + } + } else morpho_runtimeerror(v, MATRIX_INVLDINDICES); + + return MORPHO_NIL; +} + +/** Sets the column of a matrix */ +value Matrix_setcolumn(vm *v, int nargs, value *args) { + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); + + if (nargs==2 && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && + MORPHO_ISMATRIX(MORPHO_GETARG(args, 1))) { + unsigned int col = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + objectmatrix *src = MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); + + if (colncols) { + if (src && src->ncols*src->nrows==m->nrows) { + matrix_setcolumn(m, col, src->elements); + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + } else morpho_runtimeerror(v, MATRIX_SETCOLARGS); + + return MORPHO_NIL; +} + +/** Gets a column of a matrix */ +value Matrix_getcolumn(vm *v, int nargs, value *args) { + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + unsigned int col = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (colncols) { + double *vals; + if (matrix_getcolumn(m, col, &vals)) { + objectmatrix *new=object_matrixfromfloats(m->nrows, 1, vals); + if (new) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + } + } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + } else morpho_runtimeerror(v, MATRIX_SETCOLARGS); + + return out; +} + +/** Prints a matrix */ +value Matrix_print(vm *v, int nargs, value *args) { + value self = MORPHO_SELF(args); + if (!MORPHO_ISMATRIX(self)) return Object_print(v, nargs, args); + + objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); + matrix_print(v, m); + return MORPHO_NIL; +} + +/** Formatted conversion to a string */ +value Matrix_format(vm *v, int nargs, value *args) { + value out = MORPHO_NIL; + + if (nargs==1 && + MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { + varray_char str; + varray_charinit(&str); + + if (matrix_printtobuffer(MORPHO_GETMATRIX(MORPHO_SELF(args)), + MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), + &str)) { + out = object_stringfromvarraychar(&str); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + + varray_charclear(&str); + } else { + morpho_runtimeerror(v, VALUE_FRMTARG); + } + + return out; +} + +/** Matrix add */ +value Matrix_assign(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + + if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + if (a->ncols==b->ncols && a->nrows==b->nrows) { + matrix_copy(b, a); + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } + + return MORPHO_NIL; +} + +/** Matrix add */ +value Matrix_add(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + if (a->ncols==b->ncols && a->nrows==b->nrows) { + objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); + if (new) { + out=MORPHO_OBJECT(new); + matrix_add(a, b, new); + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + double val; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { + objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); + if (new) { + out=MORPHO_OBJECT(new); + matrix_addscalar(a, 1.0, val, new); + } + } + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); + + return out; +} + +/** Right add */ +value Matrix_addr(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && (MORPHO_ISNIL(MORPHO_GETARG(args, 0)) || + MORPHO_ISNUMBER(MORPHO_GETARG(args, 0)))) { + int i=0; + if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) i=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + if (MORPHO_ISFLOAT(MORPHO_GETARG(args, 0))) i=(fabs(MORPHO_GETFLOATVALUE(MORPHO_GETARG(args, 0)))ncols==b->ncols && a->nrows==b->nrows) { + objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); + if (new) { + out=MORPHO_OBJECT(new); + matrix_sub(a, b, new); + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + double val; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { + objectmatrix *new = object_newmatrix(a->nrows, a->ncols, false); + if (new) { + out=MORPHO_OBJECT(new); + matrix_addscalar(a, 1.0, -val, new); + } + } + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); + + return out; +} + +/** Right subtract */ +value Matrix_subr(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && (MORPHO_ISNIL(MORPHO_GETARG(args, 0)) || + MORPHO_ISNUMBER(MORPHO_GETARG(args, 0)))) { + int i=(MORPHO_ISNIL(MORPHO_GETARG(args, 0)) ? 0 : MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0))); + + if (MORPHO_ISFLOAT(MORPHO_GETARG(args, 0))) i=(fabs(MORPHO_GETFLOATVALUE(MORPHO_GETARG(args, 0)))nrows, a->ncols, false); + if (new) { + matrix_addscalar(a, 1.0, -val, new); + // now that did self - arg[0] and we want arg[0] - self so scale the whole thing by -1 + matrix_scale(new, -1.0); + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + } + + } else morpho_runtimeerror(v, VM_INVALIDARGS); + } else morpho_runtimeerror(v, VM_INVALIDARGS); + + return out; +} + +/** Matrix multiply */ +value Matrix_mul(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + if (a->ncols==b->nrows) { + objectmatrix *new = object_newmatrix(a->nrows, b->ncols, false); + if (new) { + out=MORPHO_OBJECT(new); + matrix_mul(a, b, new); + morpho_bindobjects(v, 1, &out); + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + double scale=1.0; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) { + objectmatrix *new = object_clonematrix(a); + if (new) { + out=MORPHO_OBJECT(new); + matrix_scale(new, scale); + morpho_bindobjects(v, 1, &out); + } + } +#ifdef MORPHO_INCLUDE_SPARSE + } else if (nargs==1 && MORPHO_ISSPARSE(MORPHO_GETARG(args, 0))) { + // Returns nil to ensure it gets passed to mulr on Sparse +#endif + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + return out; +} + +/** Called when multiplying on the right */ +value Matrix_mulr(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + double scale=1.0; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) { + objectmatrix *new = object_clonematrix(a); + if (new) { + out=MORPHO_OBJECT(new); + matrix_scale(new, scale); + morpho_bindobjects(v, 1, &out); + } + } + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + return out; +} + +/** Solution of linear system a.x = b (i.e. x = b/a) */ +value Matrix_div(vm *v, int nargs, value *args) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + if (a->ncols==b->nrows) { + objectmatrix *new = object_newmatrix(b->nrows, b->ncols, false); + if (new) { + objectmatrixerror err; + if (MATRIX_ISSMALL(a)) { + err=matrix_divs(a, b, new); + } else { + err=matrix_divl(a, b, new); + } + if (err==MATRIX_SING) { + morpho_runtimeerror(v, MATRIX_SINGULAR); + object_free((object *) new); + } else { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + } + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); +#ifdef MORPHO_INCLUDE_SPARSE + } else if (nargs==1 && MORPHO_ISSPARSE(MORPHO_GETARG(args, 0))) { + /* Division by a sparse matrix: redirect to the divr selector of Sparse. */ + value vargs[2]={args[1],args[0]}; + return Sparse_divr(v, nargs, vargs); +#endif + } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + /* Division by a scalar */ + double scale=1.0; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) { + if (fabs(scale)ncols==b->ncols && a->nrows==b->nrows) { + out=MORPHO_SELF(args); + double lambda=1.0; + morpho_valuetofloat(MORPHO_GETARG(args, 0), &lambda); + matrix_accumulate(a, lambda, b); + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + return MORPHO_NIL; +} + +/** Frobenius inner product */ +value Matrix_inner(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + + double prod=0.0; + if (matrix_inner(a, b, &prod)==MATRIX_OK) { + out = MORPHO_FLOAT(prod); + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + return out; +} + +/** Outer product */ +value Matrix_outer(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { + objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + objectmatrix *new=object_newmatrix(a->nrows*a->ncols, b->nrows*b->ncols, true); + + if (new && + matrix_outer(a, b, new)==MATRIX_OK) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + + return out; +} + +/** Matrix sum */ +value Matrix_sum(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + return MORPHO_FLOAT(matrix_sum(a)); +} + +/** Roll a matrix */ +value Matrix_roll(vm *v, int nargs, value *args) { + objectmatrix *slf = MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out = MORPHO_NIL; + int roll, axis=0; + + if (nargs>0 && + morpho_valuetoint(MORPHO_GETARG(args, 0), &roll)) { + + if (nargs==2 && !morpho_valuetoint(MORPHO_GETARG(args, 1), &axis)) return out; + + objectmatrix *new = matrix_roll(slf, roll, axis); + + if (new) { + out = MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + + } else morpho_runtimeerror(v, LIST_ADDARGS); + + return out; +} + + +/** Matrix norm */ +value Matrix_norm(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out = MORPHO_NIL; + + if (nargs==1) { + value arg = MORPHO_GETARG(args, 0); + + if (MORPHO_ISNUMBER(arg)) { + double n; + + if (morpho_valuetofloat(arg, &n)) { + if (fabs(n-1.0)val.count, new->val.data); + new->val.count--; // And pop it back off + } + + return evals; +} + +/** Matrix eigensystem */ +value Matrix_eigensystem(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value evals=MORPHO_NIL, evecs=MORPHO_NIL, out=MORPHO_NIL; + objectlist *resultlist = object_newlist(0, NULL); + if (!resultlist) { + morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return MORPHO_NIL; + } + + if (matrix_eigen(v, a, &evals, &evecs)) { + objectlist *evallist = MORPHO_GETLIST(evals); + + list_append(resultlist, evals); // Create the output list + list_append(resultlist, evecs); + out=MORPHO_OBJECT(resultlist); + + list_append(evallist, evals); // Ensure we bind all objects at once + list_append(evallist, evecs); // by popping them onto the evallist. + list_append(evallist, out); // + morpho_bindobjects(v, evallist->val.count, evallist->val.data); + evallist->val.count-=3; // and then popping them back off. + } + + return out; +} + +/** Inverts a matrix */ +value Matrix_inverse(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + // The inverse will have the number of rows and number of columns + // swapped. + objectmatrix *new = object_newmatrix(a->ncols, a->nrows, false); + if (new) { + objectmatrixerror mi = matrix_inverse(a, new); + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + + if (mi!=MATRIX_OK) matrix_raiseerror(v, mi); + } + + return out; +} + +/** Transpose of a matrix */ +value Matrix_transpose(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + objectmatrix *new = object_newmatrix(a->ncols, a->nrows, false); + if (new) { + matrix_transpose(a, new); + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + + return out; +} + +/** Reshape a matrix */ +value Matrix_reshape(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + + if (nargs==2 && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 1))) { + int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + int ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + + if (nrows*ncols==a->nrows*a->ncols) { + a->nrows=nrows; + a->ncols=ncols; + } else morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + } else morpho_runtimeerror(v, MATRIX_RESHAPEARGS); + + return MORPHO_NIL; +} + +/** Trace of a matrix */ +value Matrix_trace(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (a->nrows==a->ncols) { + double tr; + if (matrix_trace(a, &tr)==MATRIX_OK) out=MORPHO_FLOAT(tr); + } else { + morpho_runtimeerror(v, MATRIX_NOTSQ); + } + + return out; +} + +/** Enumerate protocol */ +value Matrix_enumerate(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==1) { + if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + int i=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (i<0) out=MORPHO_INTEGER(a->ncols*a->nrows); + else if (incols*a->nrows) out=MORPHO_FLOAT(a->elements[i]); + } + } + + return out; +} + + +/** Number of matrix elements */ +value Matrix_count(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + + return MORPHO_INTEGER(a->ncols*a->nrows); +} + +/** Matrix dimensions */ +value Matrix_dimensions(vm *v, int nargs, value *args) { + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + value dim[2]; + value out=MORPHO_NIL; + + dim[0]=MORPHO_INTEGER(a->nrows); + dim[1]=MORPHO_INTEGER(a->ncols); + + objectlist *new=object_newlist(2, dim); + if (new) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + + return out; +} + +/** Clones a matrix */ +value Matrix_clone(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); + objectmatrix *new=object_clonematrix(a); + if (new) { + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return out; +} + +MORPHO_BEGINCLASS(Matrix) +MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Matrix_getindex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Matrix_setindex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_GETCOLUMN_METHOD, Matrix_getcolumn, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_SETCOLUMN_METHOD, Matrix_setcolumn, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Matrix_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_FORMAT_METHOD, Matrix_format, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_ASSIGN_METHOD, Matrix_assign, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_addr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_MUL_METHOD, Matrix_mul, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_MULR_METHOD, Matrix_mulr, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_DIV_METHOD, Matrix_div, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_ACC_METHOD, Matrix_acc, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_INNER_METHOD, Matrix_inner, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_OUTER_METHOD, Matrix_outer, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_SUM_METHOD, Matrix_sum, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_NORM_METHOD, Matrix_norm, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_INVERSE_METHOD, Matrix_inverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_TRANSPOSE_METHOD, Matrix_transpose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_RESHAPE_METHOD, Matrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_EIGENVALUES_METHOD, Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_EIGENSYSTEM_METHOD, Matrix_eigensystem, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_TRACE_METHOD, Matrix_trace, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_COUNT_METHOD, Matrix_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MATRIX_DIMENSIONS_METHOD, Matrix_dimensions, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_ROLL_METHOD, Matrix_roll, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_CLONE_METHOD, Matrix_clone, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS + +/* ********************************************************************** + * Initialization + * ********************************************************************* */ + +void matrix_initialize(void) { + objectmatrixtype=object_addtype(&objectmatrixdefn); + + builtin_addfunction(MATRIX_CLASSNAME, matrix_constructor, MORPHO_FN_CONSTRUCTOR); + builtin_addfunction(MATRIX_IDENTITYCONSTRUCTOR, matrix_identityconstructor, BUILTIN_FLAGSEMPTY); + + objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); + value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); + + value matrixclass=builtin_addclass(MATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(Matrix), objclass); + object_setveneerclass(OBJECT_MATRIX, matrixclass); + + morpho_defineerror(MATRIX_INDICESOUTSIDEBOUNDS, ERROR_HALT, MATRIX_INDICESOUTSIDEBOUNDS_MSG); + morpho_defineerror(MATRIX_INVLDINDICES, ERROR_HALT, MATRIX_INVLDINDICES_MSG); + morpho_defineerror(MATRIX_INVLDNUMINDICES, ERROR_HALT, MATRIX_INVLDNUMINDICES_MSG); + morpho_defineerror(MATRIX_CONSTRUCTOR, ERROR_HALT, MATRIX_CONSTRUCTOR_MSG); + morpho_defineerror(MATRIX_INVLDARRAYINIT, ERROR_HALT, MATRIX_INVLDARRAYINIT_MSG); + morpho_defineerror(MATRIX_ARITHARGS, ERROR_HALT, MATRIX_ARITHARGS_MSG); + morpho_defineerror(MATRIX_RESHAPEARGS, ERROR_HALT, MATRIX_RESHAPEARGS_MSG); + morpho_defineerror(MATRIX_INCOMPATIBLEMATRICES, ERROR_HALT, MATRIX_INCOMPATIBLEMATRICES_MSG); + morpho_defineerror(MATRIX_SINGULAR, ERROR_HALT, MATRIX_SINGULAR_MSG); + morpho_defineerror(MATRIX_NOTSQ, ERROR_HALT, MATRIX_NOTSQ_MSG); + morpho_defineerror(MATRIX_OPFAILED, ERROR_HALT, MATRIX_OPFAILED_MSG); + morpho_defineerror(MATRIX_SETCOLARGS, ERROR_HALT, MATRIX_SETCOLARGS_MSG); + morpho_defineerror(MATRIX_NORMARGS, ERROR_HALT, MATRIX_NORMARGS_MSG); + morpho_defineerror(MATRIX_IDENTCONSTRUCTOR, ERROR_HALT, MATRIX_IDENTCONSTRUCTOR_MSG); +} + +#endif diff --git a/src/linalg/xmatrix.h b/src/linalg/xmatrix.h new file mode 100644 index 000000000..fe74a5151 --- /dev/null +++ b/src/linalg/xmatrix.h @@ -0,0 +1,205 @@ +/** @file matrix.h + * @author T J Atherton + * + * @brief Veneer class over the objectmatrix type that interfaces with blas and lapack + */ + +#ifndef matrix_h +#define matrix_h + +#include "build.h" +#ifdef MORPHO_INCLUDE_LINALG + +#include +#include "classes.h" +/** Use Apple's Accelerate library for LAPACK and BLAS */ +#ifdef __APPLE__ +#ifdef MORPHO_LINALG_USE_ACCELERATE +#define ACCELERATE_NEW_LAPACK +#include +#define MATRIX_LAPACK_PRESENT +#endif +#endif + +/** Otherwise, use LAPACKE */ +#ifndef MATRIX_LAPACK_PRESENT +#include +#include +#define MORPHO_LINALG_USE_LAPACKE +#define MATRIX_LAPACK_PRESENT +#endif + +#include "cmplx.h" +#include "list.h" + +/* ------------------------------------------------------- + * Matrix objects + * ------------------------------------------------------- */ + +extern objecttype objectmatrixtype; +#define OBJECT_MATRIX objectmatrixtype + +/** Matrices are a purely numerical collection type oriented toward linear algebra. + Elements are stored in column-major format, i.e. + [ 1 2 ] + [ 3 4 ] + is stored ( 1, 3, 2, 4 ) in memory. This is for compatibility with standard linear algebra packages */ + +typedef struct { + object obj; + unsigned int nrows; + unsigned int ncols; + double *elements; + double matrixdata[]; +} objectmatrix; + +/** Tests whether an object is a matrix */ +#define MORPHO_ISMATRIX(val) object_istype(val, OBJECT_MATRIX) + +/** Gets the object as an matrix */ +#define MORPHO_GETMATRIX(val) ((objectmatrix *) MORPHO_GETOBJECT(val)) + +/** Creates a matrix object */ +objectmatrix *object_newmatrix(unsigned int nrows, unsigned int ncols, bool zero); + +/** Creates a new matrix from an array */ +objectmatrix *object_matrixfromarray(objectarray *array); + +/** Creates a new matrix from an existing matrix */ +objectmatrix *object_clonematrix(objectmatrix *array); + +/** @brief Use to create static matrices on the C stack + @details Intended for small matrices; Caller needs to supply a double array of size nr*nc. */ +#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc } + +/** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ +#define MATRIX_ISSMALL(m) (m->nrows*m->ncols Date: Wed, 14 Jan 2026 21:36:44 -0500 Subject: [PATCH 199/473] Correct more tests --- .../arithmetic/complexmatrix_add_matrix.morpho | 2 +- .../arithmetic/complexmatrix_addr_matrix.morpho | 2 +- .../arithmetic/complexmatrix_div_matrix.morpho | 4 ++-- .../arithmetic/complexmatrix_divr_matrix.morpho | 4 ++-- .../arithmetic/complexmatrix_mul_matrix.morpho | 2 +- .../arithmetic/complexmatrix_mulr_matrix.morpho | 2 +- .../arithmetic/complexmatrix_sub_matrix.morpho | 2 +- .../arithmetic/complexmatrix_subr_matrix.morpho | 2 +- newlinalg/test/arithmetic/matrix_acc.morpho | 2 +- newlinalg/test/arithmetic/matrix_add_matrix.morpho | 4 ++-- newlinalg/test/arithmetic/matrix_add_nil.morpho | 2 +- newlinalg/test/arithmetic/matrix_add_scalar.morpho | 2 +- newlinalg/test/arithmetic/matrix_addr_nil.morpho | 2 +- .../test/arithmetic/matrix_addr_scalar.morpho | 2 +- newlinalg/test/arithmetic/matrix_div_matrix.morpho | 6 +++--- newlinalg/test/arithmetic/matrix_div_scalar.morpho | 4 ++-- newlinalg/test/arithmetic/matrix_mul_matrix.morpho | 10 +++++----- newlinalg/test/arithmetic/matrix_mul_scalar.morpho | 4 ++-- newlinalg/test/arithmetic/matrix_negate.morpho | 2 +- newlinalg/test/arithmetic/matrix_sub_matrix.morpho | 4 ++-- newlinalg/test/arithmetic/matrix_sub_scalar.morpho | 2 +- .../test/arithmetic/matrix_subr_scalar.morpho | 2 +- newlinalg/test/assign/matrix_assign.morpho | 4 ++-- .../complexmatrix_matrix_constructor.morpho | 2 +- .../constructors/matrix_array_constructor.morpho | 2 +- ...rix_array_constructor_invalid_dimensions.morpho | 4 ++-- .../test/constructors/matrix_constructor.morpho | 2 +- .../matrix_constructor_edge_cases.morpho | 14 +++++++------- .../matrix_identity_constructor.morpho | 6 +++--- .../constructors/matrix_list_constructor.morpho | 2 +- .../matrix_list_vector_constructor.morpho | 2 +- .../constructors/matrix_tuple_constructor.morpho | 4 ++-- .../constructors/matrix_vector_constructor.morpho | 2 +- newlinalg/test/index/matrix_getcolumn.morpho | 2 +- newlinalg/test/index/matrix_getindex.morpho | 2 +- newlinalg/test/index/matrix_setcolumn.morpho | 6 +++--- newlinalg/test/index/matrix_setindex.morpho | 2 +- newlinalg/test/index/matrix_setslice.morpho | 12 ++++++------ newlinalg/test/index/matrix_slice.morpho | 2 +- newlinalg/test/index/matrix_slice_bounds.morpho | 2 +- .../test/index/matrix_slice_infinite_range.morpho | 2 +- newlinalg/test/methods/matrix_count.morpho | 4 ++-- newlinalg/test/methods/matrix_dimensions.morpho | 6 +++--- newlinalg/test/methods/matrix_eigensystem.morpho | 4 ++-- newlinalg/test/methods/matrix_eigenvalues.morpho | 2 +- newlinalg/test/methods/matrix_enumerate.morpho | 2 +- newlinalg/test/methods/matrix_format.morpho | 2 +- newlinalg/test/methods/matrix_inner.morpho | 4 ++-- newlinalg/test/methods/matrix_inverse.morpho | 2 +- .../test/methods/matrix_inverse_singular.morpho | 2 +- newlinalg/test/methods/matrix_norm.morpho | 4 ++-- newlinalg/test/methods/matrix_outer.morpho | 4 ++-- newlinalg/test/methods/matrix_qr.morpho | 14 +++++++------- newlinalg/test/methods/matrix_reshape.morpho | 4 ++-- newlinalg/test/methods/matrix_roll.morpho | 2 +- newlinalg/test/methods/matrix_sum.morpho | 2 +- newlinalg/test/methods/matrix_svd.morpho | 12 ++++++------ newlinalg/test/methods/matrix_trace.morpho | 2 +- newlinalg/test/methods/matrix_transpose.morpho | 2 +- src/linalg/{newlinalg.c => linalg.c} | 6 +++--- src/linalg/{newlinalg.h => linalg.h} | 8 ++++---- 61 files changed, 115 insertions(+), 115 deletions(-) rename src/linalg/{newlinalg.c => linalg.c} (96%) rename src/linalg/{newlinalg.h => linalg.h} (97%) diff --git a/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho index e019a40c6..b124d8b20 100644 --- a/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho @@ -2,7 +2,7 @@ import newlinalg var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = XMatrix(((1, 2), (3, 4))) +var B = Matrix(((1, 2), (3, 4))) print A + B // expect: [ 2 + 1im 4 + 2im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho index 6d0edfc33..15a97a628 100644 --- a/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho @@ -2,7 +2,7 @@ import newlinalg var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = XMatrix(((1, 2), (3, 4))) +var B = Matrix(((1, 2), (3, 4))) print B + A // expect: [ 2 + 1im 4 + 2im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho index 1d3214a74..eed76af3d 100644 --- a/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho @@ -1,7 +1,7 @@ -// Divide ComplexMatrix by XMatrix (solve linear system) +// Divide ComplexMatrix by Matrix (solve linear system) import newlinalg -var A = XMatrix(((1,2),(-2,1))) +var A = Matrix(((1,2),(-2,1))) var b = ComplexMatrix((1+im, 2)) diff --git a/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho index 7c9afe069..9e0e1e41d 100644 --- a/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho @@ -1,9 +1,9 @@ -// Divide XMatrix by ComplexMatrix (solve linear system) +// Divide Matrix by ComplexMatrix (solve linear system) import newlinalg var A = ComplexMatrix(((1,2+im),(2-im,1))) -var b = XMatrix((1, 2)) +var b = Matrix((1, 2)) print b / A // expect: [ 0.75 + 0.5im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho index 18e7419c0..438347695 100644 --- a/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho @@ -2,7 +2,7 @@ import newlinalg var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) -var B = XMatrix(((4,3),(2,1))) +var B = Matrix(((4,3),(2,1))) print A * B // expect: [ 8 + 8im 5 + 5im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho index 7cba06d6d..f9551c2f8 100644 --- a/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho @@ -2,7 +2,7 @@ import newlinalg var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) -var B = XMatrix(((4,3),(2,1))) +var B = Matrix(((4,3),(2,1))) print B * A // expect: [ 13 + 13im 20 + 20im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho index 1b0afe9e7..5e14f01c9 100644 --- a/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho @@ -2,7 +2,7 @@ import newlinalg var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = XMatrix(((4, 3), (2, 1))) +var B = Matrix(((4, 3), (2, 1))) print A - B // expect: [ -3 + 1im -1 + 2im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho index 03e9bbf04..ff6d357b4 100644 --- a/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho +++ b/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho @@ -2,7 +2,7 @@ import newlinalg var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = XMatrix(((4, 3), (2, 1))) +var B = Matrix(((4, 3), (2, 1))) print B - A // expect: [ 3 - 1im 1 - 2im ] diff --git a/newlinalg/test/arithmetic/matrix_acc.morpho b/newlinalg/test/arithmetic/matrix_acc.morpho index e6430ebd9..2a6a22ba9 100644 --- a/newlinalg/test/arithmetic/matrix_acc.morpho +++ b/newlinalg/test/arithmetic/matrix_acc.morpho @@ -1,7 +1,7 @@ // In-place accumulate import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=1 A[1,0]=1 diff --git a/newlinalg/test/arithmetic/matrix_add_matrix.morpho b/newlinalg/test/arithmetic/matrix_add_matrix.morpho index 076f6451f..7c71df78d 100644 --- a/newlinalg/test/arithmetic/matrix_add_matrix.morpho +++ b/newlinalg/test/arithmetic/matrix_add_matrix.morpho @@ -2,8 +2,8 @@ import newlinalg -var a = XMatrix([[1, 2], [3, 4]]) -var b = XMatrix([[0, 1], [1, 0]]) +var a = Matrix([[1, 2], [3, 4]]) +var b = Matrix([[0, 1], [1, 0]]) print "A+B:" print a+b diff --git a/newlinalg/test/arithmetic/matrix_add_nil.morpho b/newlinalg/test/arithmetic/matrix_add_nil.morpho index 23f4f313c..2f3b764ee 100644 --- a/newlinalg/test/arithmetic/matrix_add_nil.morpho +++ b/newlinalg/test/arithmetic/matrix_add_nil.morpho @@ -1,7 +1,7 @@ // Add a scalar import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) print A + nil // expect: [ 0 0 ] diff --git a/newlinalg/test/arithmetic/matrix_add_scalar.morpho b/newlinalg/test/arithmetic/matrix_add_scalar.morpho index 8d4569089..a7c811108 100644 --- a/newlinalg/test/arithmetic/matrix_add_scalar.morpho +++ b/newlinalg/test/arithmetic/matrix_add_scalar.morpho @@ -1,7 +1,7 @@ // Add a scalar import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) print A + 2 // expect: [ 2 2 ] diff --git a/newlinalg/test/arithmetic/matrix_addr_nil.morpho b/newlinalg/test/arithmetic/matrix_addr_nil.morpho index 2cd52c765..c3334e603 100644 --- a/newlinalg/test/arithmetic/matrix_addr_nil.morpho +++ b/newlinalg/test/arithmetic/matrix_addr_nil.morpho @@ -1,7 +1,7 @@ // Add nil from the right import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A += 1 print nil + A diff --git a/newlinalg/test/arithmetic/matrix_addr_scalar.morpho b/newlinalg/test/arithmetic/matrix_addr_scalar.morpho index e50b33364..93e721524 100644 --- a/newlinalg/test/arithmetic/matrix_addr_scalar.morpho +++ b/newlinalg/test/arithmetic/matrix_addr_scalar.morpho @@ -1,7 +1,7 @@ // Add a scalar from the right import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) print 2 + A // expect: [ 2 2 ] diff --git a/newlinalg/test/arithmetic/matrix_div_matrix.morpho b/newlinalg/test/arithmetic/matrix_div_matrix.morpho index eb37485b9..866d95302 100644 --- a/newlinalg/test/arithmetic/matrix_div_matrix.morpho +++ b/newlinalg/test/arithmetic/matrix_div_matrix.morpho @@ -1,13 +1,13 @@ -// Divide XMatrix by XMatrix (solve linear system) +// Divide Matrix by Matrix (solve linear system) import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 A[1,1]=4 -var b = XMatrix(2,1) +var b = Matrix(2,1) b[0]=1 b[1]=2 diff --git a/newlinalg/test/arithmetic/matrix_div_scalar.morpho b/newlinalg/test/arithmetic/matrix_div_scalar.morpho index 79a829ccc..4fb79d923 100644 --- a/newlinalg/test/arithmetic/matrix_div_scalar.morpho +++ b/newlinalg/test/arithmetic/matrix_div_scalar.morpho @@ -1,7 +1,7 @@ -// Divide XMatrix by scalar +// Divide Matrix by scalar import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=2 A[1,1]=4 diff --git a/newlinalg/test/arithmetic/matrix_mul_matrix.morpho b/newlinalg/test/arithmetic/matrix_mul_matrix.morpho index ca0811e18..798403034 100644 --- a/newlinalg/test/arithmetic/matrix_mul_matrix.morpho +++ b/newlinalg/test/arithmetic/matrix_mul_matrix.morpho @@ -1,13 +1,13 @@ -// Multiply two XMatrices +// Multiply two Matrices import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 A[1,1]=4 -var B = XMatrix(2,2) +var B = Matrix(2,2) B[0,0]=1 B[0,1]=0 B[1,0]=0 @@ -17,8 +17,8 @@ print A * B // expect: [ 1 2 ] // expect: [ 3 4 ] -var a = XMatrix([[1, 2], [3, 4]]) -var b = XMatrix([[0, 1], [1, 0]]) +var a = Matrix([[1, 2], [3, 4]]) +var b = Matrix([[0, 1], [1, 0]]) print "A*B:" print a*b diff --git a/newlinalg/test/arithmetic/matrix_mul_scalar.morpho b/newlinalg/test/arithmetic/matrix_mul_scalar.morpho index 190e4def4..f88ff97b5 100644 --- a/newlinalg/test/arithmetic/matrix_mul_scalar.morpho +++ b/newlinalg/test/arithmetic/matrix_mul_scalar.morpho @@ -1,7 +1,7 @@ -// Multiply XMatrix by scalar +// Multiply Matrix by scalar import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[1,1]=2 diff --git a/newlinalg/test/arithmetic/matrix_negate.morpho b/newlinalg/test/arithmetic/matrix_negate.morpho index c5f01d065..0613e11d0 100644 --- a/newlinalg/test/arithmetic/matrix_negate.morpho +++ b/newlinalg/test/arithmetic/matrix_negate.morpho @@ -2,7 +2,7 @@ import newlinalg -var a = XMatrix([[1,2], [3,4]]) +var a = Matrix([[1,2], [3,4]]) print -a // expect: [ -1 -2 ] diff --git a/newlinalg/test/arithmetic/matrix_sub_matrix.morpho b/newlinalg/test/arithmetic/matrix_sub_matrix.morpho index 800d14400..dd36ad584 100644 --- a/newlinalg/test/arithmetic/matrix_sub_matrix.morpho +++ b/newlinalg/test/arithmetic/matrix_sub_matrix.morpho @@ -2,8 +2,8 @@ import newlinalg -var a = XMatrix([[1, 2], [3, 4]]) -var b = XMatrix([[0, 1], [1, 0]]) +var a = Matrix([[1, 2], [3, 4]]) +var b = Matrix([[0, 1], [1, 0]]) print "A-B:" diff --git a/newlinalg/test/arithmetic/matrix_sub_scalar.morpho b/newlinalg/test/arithmetic/matrix_sub_scalar.morpho index 511a29b97..9f0e26c54 100644 --- a/newlinalg/test/arithmetic/matrix_sub_scalar.morpho +++ b/newlinalg/test/arithmetic/matrix_sub_scalar.morpho @@ -1,7 +1,7 @@ // Subtract a scalar import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) print A - 2 // expect: [ -2 -2 ] diff --git a/newlinalg/test/arithmetic/matrix_subr_scalar.morpho b/newlinalg/test/arithmetic/matrix_subr_scalar.morpho index 02ac3acdc..aab246de0 100644 --- a/newlinalg/test/arithmetic/matrix_subr_scalar.morpho +++ b/newlinalg/test/arithmetic/matrix_subr_scalar.morpho @@ -1,7 +1,7 @@ // Subtract a scalar import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[1,1]=1 diff --git a/newlinalg/test/assign/matrix_assign.morpho b/newlinalg/test/assign/matrix_assign.morpho index 70e19dad0..1d341bc62 100644 --- a/newlinalg/test/assign/matrix_assign.morpho +++ b/newlinalg/test/assign/matrix_assign.morpho @@ -2,13 +2,13 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0] = 1 A[0,1] = 2 A[1,0] = 3 A[1,1] = 4 -var B = XMatrix(2,2) +var B = Matrix(2,2) B.assign(A) print B diff --git a/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho b/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho index fdd36cd97..9c94d9a69 100644 --- a/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho +++ b/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(((1,2), (3,4))) +var A = Matrix(((1,2), (3,4))) var B = ComplexMatrix(A) diff --git a/newlinalg/test/constructors/matrix_array_constructor.morpho b/newlinalg/test/constructors/matrix_array_constructor.morpho index 7bc168e4b..0658a8f00 100644 --- a/newlinalg/test/constructors/matrix_array_constructor.morpho +++ b/newlinalg/test/constructors/matrix_array_constructor.morpho @@ -8,7 +8,7 @@ a[1,0]=3 a[0,1]=2 a[1,1]=4 -var A = XMatrix(a) +var A = Matrix(a) print A // expect: [ 1 2 ] diff --git a/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho b/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho index a2d5160f2..3c98c0b1e 100644 --- a/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho +++ b/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho @@ -1,4 +1,4 @@ -// XMatrix constructor from Array with invalid dimensions +// Matrix constructor from Array with invalid dimensions import newlinalg // Try to construct from a 1D array (should fail - requires 2D) @@ -8,5 +8,5 @@ a[1] = 2 a[2] = 3 a[3] = 4 -print XMatrix(a) +print Matrix(a) // expect error 'LnAlgMtrxInvldArg' diff --git a/newlinalg/test/constructors/matrix_constructor.morpho b/newlinalg/test/constructors/matrix_constructor.morpho index d85f095d9..c4b721149 100644 --- a/newlinalg/test/constructors/matrix_constructor.morpho +++ b/newlinalg/test/constructors/matrix_constructor.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) print A // expect: [ 0 0 ] diff --git a/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho b/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho index 509ec6234..6d5954c6d 100644 --- a/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho +++ b/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho @@ -1,35 +1,35 @@ -// XMatrix constructor edge cases +// Matrix constructor edge cases import newlinalg // Zero dimension matrix (0x0) -var A = XMatrix(0, 0) +var A = Matrix(0, 0) print A.dimensions() // expect: (0, 0) print A.count() // expect: 0 // Zero rows, non-zero columns -var B = XMatrix(0, 3) +var B = Matrix(0, 3) print B.dimensions() // expect: (0, 3) print B.count() // expect: 0 // Non-zero rows, zero columns -var C = XMatrix(3, 0) +var C = Matrix(3, 0) print C.dimensions() // expect: (3, 0) print C.count() // expect: 0 // Single element matrix (1x1) -var D = XMatrix(1, 1) +var D = Matrix(1, 1) D[0,0] = 42 print D // expect: [ 42 ] // Single row matrix (1xN) -var E = XMatrix(1, 3) +var E = Matrix(1, 3) E[0,0] = 1 E[0,1] = 2 E[0,2] = 3 @@ -37,7 +37,7 @@ print E // expect: [ 1 2 3 ] // Single column matrix (Nx1) -var F = XMatrix(3, 1) +var F = Matrix(3, 1) F[0,0] = 1 F[1,0] = 2 F[2,0] = 3 diff --git a/newlinalg/test/constructors/matrix_identity_constructor.morpho b/newlinalg/test/constructors/matrix_identity_constructor.morpho index 761948bb7..2d850ac4e 100644 --- a/newlinalg/test/constructors/matrix_identity_constructor.morpho +++ b/newlinalg/test/constructors/matrix_identity_constructor.morpho @@ -1,13 +1,13 @@ -// IdentityXMatrix constructor +// IdentityMatrix constructor import newlinalg -var I = IdentityXMatrix(3) +var I = IdentityMatrix(3) print I // expect: [ 1 0 0 ] // expect: [ 0 1 0 ] // expect: [ 0 0 1 ] -var I2 = IdentityXMatrix(1) +var I2 = IdentityMatrix(1) print I2 // expect: [ 1 ] diff --git a/newlinalg/test/constructors/matrix_list_constructor.morpho b/newlinalg/test/constructors/matrix_list_constructor.morpho index 22ab6b693..15e238822 100644 --- a/newlinalg/test/constructors/matrix_list_constructor.morpho +++ b/newlinalg/test/constructors/matrix_list_constructor.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix([[1,2],[3,4]]) +var A = Matrix([[1,2],[3,4]]) print A // expect: [ 1 2 ] diff --git a/newlinalg/test/constructors/matrix_list_vector_constructor.morpho b/newlinalg/test/constructors/matrix_list_vector_constructor.morpho index 4e34f4aca..8790fd031 100644 --- a/newlinalg/test/constructors/matrix_list_vector_constructor.morpho +++ b/newlinalg/test/constructors/matrix_list_vector_constructor.morpho @@ -2,7 +2,7 @@ import newlinalg -var C = XMatrix(((1),(2))) +var C = Matrix(((1),(2))) print C // expect: [ 1 ] diff --git a/newlinalg/test/constructors/matrix_tuple_constructor.morpho b/newlinalg/test/constructors/matrix_tuple_constructor.morpho index 48337f3f4..7d400bdda 100644 --- a/newlinalg/test/constructors/matrix_tuple_constructor.morpho +++ b/newlinalg/test/constructors/matrix_tuple_constructor.morpho @@ -2,14 +2,14 @@ import newlinalg -var A = XMatrix(((1,2),(3,4))) +var A = Matrix(((1,2),(3,4))) print A // expect: [ 1 2 ] // expect: [ 3 4 ] // Mix Tuples and Lists -var B = XMatrix(([1,2],[3,4])) +var B = Matrix(([1,2],[3,4])) print B // expect: [ 1 2 ] diff --git a/newlinalg/test/constructors/matrix_vector_constructor.morpho b/newlinalg/test/constructors/matrix_vector_constructor.morpho index 1eb18c22a..bf2e0b355 100644 --- a/newlinalg/test/constructors/matrix_vector_constructor.morpho +++ b/newlinalg/test/constructors/matrix_vector_constructor.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(2) +var A = Matrix(2) print A // expect: [ 0 ] diff --git a/newlinalg/test/index/matrix_getcolumn.morpho b/newlinalg/test/index/matrix_getcolumn.morpho index 1a46ce72a..59e613ae0 100644 --- a/newlinalg/test/index/matrix_getcolumn.morpho +++ b/newlinalg/test/index/matrix_getcolumn.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0] = 1 A[0,1] = 2 A[1,0] = 3 diff --git a/newlinalg/test/index/matrix_getindex.morpho b/newlinalg/test/index/matrix_getindex.morpho index 90af1fd85..f49b95701 100644 --- a/newlinalg/test/index/matrix_getindex.morpho +++ b/newlinalg/test/index/matrix_getindex.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0] = 1 A[1,0] = 2 A[0,1] = 3 diff --git a/newlinalg/test/index/matrix_setcolumn.morpho b/newlinalg/test/index/matrix_setcolumn.morpho index b879d6518..38e505ec0 100644 --- a/newlinalg/test/index/matrix_setcolumn.morpho +++ b/newlinalg/test/index/matrix_setcolumn.morpho @@ -2,13 +2,13 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) -var b = XMatrix(2,1) +var b = Matrix(2,1) b[0] = 1 b[1] = 3 -var c = XMatrix(2,1) +var c = Matrix(2,1) c[0] = 2 c[1] = 4 diff --git a/newlinalg/test/index/matrix_setindex.morpho b/newlinalg/test/index/matrix_setindex.morpho index af43f9c72..abe9f6cab 100644 --- a/newlinalg/test/index/matrix_setindex.morpho +++ b/newlinalg/test/index/matrix_setindex.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0] = 1 A[0,1] = 2 A[1,0] = 3 diff --git a/newlinalg/test/index/matrix_setslice.morpho b/newlinalg/test/index/matrix_setslice.morpho index 093a84466..41280a84b 100644 --- a/newlinalg/test/index/matrix_setslice.morpho +++ b/newlinalg/test/index/matrix_setslice.morpho @@ -1,9 +1,9 @@ // Copy elements of a Matrix using slices import newlinalg -var A = XMatrix(((1,2),(3,4))) +var A = Matrix(((1,2),(3,4))) -var B = XMatrix(4,4) +var B = Matrix(4,4) B[0..1, 0..1] = A print B @@ -12,7 +12,7 @@ print B // expect: [ 0 0 0 0 ] // expect: [ 0 0 0 0 ] -var C = XMatrix(4,4) +var C = Matrix(4,4) C[0..2:2, 0..2:2] = A print C // expect: [ 1 0 2 0 ] @@ -20,7 +20,7 @@ print C // expect: [ 3 0 4 0 ] // expect: [ 0 0 0 0 ] -var D = XMatrix(4,4) +var D = Matrix(4,4) D[1..2, 1..2] = A print D // expect: [ 0 0 0 0 ] @@ -28,7 +28,7 @@ print D // expect: [ 0 3 4 0 ] // expect: [ 0 0 0 0 ] -var E = XMatrix(4,4) +var E = Matrix(4,4) E[1..3:2, 1..3:2] = A print E // expect: [ 0 0 0 0 ] @@ -36,7 +36,7 @@ print E // expect: [ 0 0 0 0 ] // expect: [ 0 3 0 4 ] -var F = XMatrix(4,4) +var F = Matrix(4,4) F[0..1, 0] = A[0..1, 1] print F // expect: [ 2 0 0 0 ] diff --git a/newlinalg/test/index/matrix_slice.morpho b/newlinalg/test/index/matrix_slice.morpho index 0a8387b4e..5f362fa0a 100644 --- a/newlinalg/test/index/matrix_slice.morpho +++ b/newlinalg/test/index/matrix_slice.morpho @@ -1,7 +1,7 @@ // Slice a Matrix import newlinalg -var A = XMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) +var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) print A[0..1, 0..1] // expect: [ 1 2 ] diff --git a/newlinalg/test/index/matrix_slice_bounds.morpho b/newlinalg/test/index/matrix_slice_bounds.morpho index c56760561..819cef424 100644 --- a/newlinalg/test/index/matrix_slice_bounds.morpho +++ b/newlinalg/test/index/matrix_slice_bounds.morpho @@ -1,7 +1,7 @@ // Slice a Matrix out of bounds import newlinalg -var A = XMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) +var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) print A[0..5, 0..2] // expect error 'LnAlgMtrxIndxBnds' diff --git a/newlinalg/test/index/matrix_slice_infinite_range.morpho b/newlinalg/test/index/matrix_slice_infinite_range.morpho index b8724575e..3a4466bd5 100644 --- a/newlinalg/test/index/matrix_slice_infinite_range.morpho +++ b/newlinalg/test/index/matrix_slice_infinite_range.morpho @@ -1,7 +1,7 @@ // Slice a Matrix with a range that doesn't halt import newlinalg -var A = XMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) +var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) print A[0..3:-1, 0] // expect error 'LnAlgMtrxInvldArg' diff --git a/newlinalg/test/methods/matrix_count.morpho b/newlinalg/test/methods/matrix_count.morpho index 133144aee..b5a8c2fa5 100644 --- a/newlinalg/test/methods/matrix_count.morpho +++ b/newlinalg/test/methods/matrix_count.morpho @@ -1,7 +1,7 @@ -// Count elements in XMatrix +// Count elements in Matrix import newlinalg -var A = XMatrix(2,3) +var A = Matrix(2,3) A[0,0]=1 A[0,1]=2 A[0,2]=3 diff --git a/newlinalg/test/methods/matrix_dimensions.morpho b/newlinalg/test/methods/matrix_dimensions.morpho index 4c72b37f1..4712051e9 100644 --- a/newlinalg/test/methods/matrix_dimensions.morpho +++ b/newlinalg/test/methods/matrix_dimensions.morpho @@ -1,10 +1,10 @@ -// Get dimensions of XMatrix +// Get dimensions of Matrix import newlinalg -var A = XMatrix(2,3) +var A = Matrix(2,3) print A.dimensions() // expect: (2, 3) -var a = XMatrix([[0.8, -0.4], [0.4, 0.8]]) +var a = Matrix([[0.8, -0.4], [0.4, 0.8]]) print a.dimensions() // expect: (2, 2) diff --git a/newlinalg/test/methods/matrix_eigensystem.morpho b/newlinalg/test/methods/matrix_eigensystem.morpho index 1651052c7..1b2cbff74 100644 --- a/newlinalg/test/methods/matrix_eigensystem.morpho +++ b/newlinalg/test/methods/matrix_eigensystem.morpho @@ -1,7 +1,7 @@ // Eigenvalues and eigenvectors import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=0 A[0,1]=1 A[1,0]=1 @@ -10,7 +10,7 @@ A[1,1]=0 var es=A.eigensystem() print es -// expect: ((1, -1), ) +// expect: ((1, -1), ) print es[0] // expect: (1, -1) diff --git a/newlinalg/test/methods/matrix_eigenvalues.morpho b/newlinalg/test/methods/matrix_eigenvalues.morpho index 00141abce..0ec4f41c9 100644 --- a/newlinalg/test/methods/matrix_eigenvalues.morpho +++ b/newlinalg/test/methods/matrix_eigenvalues.morpho @@ -1,7 +1,7 @@ // Eigenvalues import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=0 A[0,1]=1 A[1,0]=1 diff --git a/newlinalg/test/methods/matrix_enumerate.morpho b/newlinalg/test/methods/matrix_enumerate.morpho index ac2478cf8..a6f7cf7a1 100644 --- a/newlinalg/test/methods/matrix_enumerate.morpho +++ b/newlinalg/test/methods/matrix_enumerate.morpho @@ -2,7 +2,7 @@ import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0] = 1 A[1,0] = 2 A[0,1] = 3 diff --git a/newlinalg/test/methods/matrix_format.morpho b/newlinalg/test/methods/matrix_format.morpho index 591c6c76d..06495b223 100644 --- a/newlinalg/test/methods/matrix_format.morpho +++ b/newlinalg/test/methods/matrix_format.morpho @@ -2,7 +2,7 @@ import newlinalg import constants -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=Pi/2 A[1,0]=Pi/2 diff --git a/newlinalg/test/methods/matrix_inner.morpho b/newlinalg/test/methods/matrix_inner.morpho index f37c665e4..c5539cd96 100644 --- a/newlinalg/test/methods/matrix_inner.morpho +++ b/newlinalg/test/methods/matrix_inner.morpho @@ -1,13 +1,13 @@ // Inner product of XMatrices import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 A[1,1]=4 -var B = XMatrix(2,2) +var B = Matrix(2,2) B[0,0]=1 B[0,1]=0 B[1,0]=0 diff --git a/newlinalg/test/methods/matrix_inverse.morpho b/newlinalg/test/methods/matrix_inverse.morpho index f7f07541d..2f269735f 100644 --- a/newlinalg/test/methods/matrix_inverse.morpho +++ b/newlinalg/test/methods/matrix_inverse.morpho @@ -1,7 +1,7 @@ // Inverse import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 diff --git a/newlinalg/test/methods/matrix_inverse_singular.morpho b/newlinalg/test/methods/matrix_inverse_singular.morpho index 7180cd65a..7428e58fd 100644 --- a/newlinalg/test/methods/matrix_inverse_singular.morpho +++ b/newlinalg/test/methods/matrix_inverse_singular.morpho @@ -1,7 +1,7 @@ // Inverse import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=2 A[1,0]=2 diff --git a/newlinalg/test/methods/matrix_norm.morpho b/newlinalg/test/methods/matrix_norm.morpho index a8d76cf29..179158c83 100644 --- a/newlinalg/test/methods/matrix_norm.morpho +++ b/newlinalg/test/methods/matrix_norm.morpho @@ -1,8 +1,8 @@ -// Norm of an XMatrix +// Norm of an Matrix import newlinalg import constants -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=-2 A[1,0]=3 diff --git a/newlinalg/test/methods/matrix_outer.morpho b/newlinalg/test/methods/matrix_outer.morpho index 0e49615e5..a190ed5dd 100644 --- a/newlinalg/test/methods/matrix_outer.morpho +++ b/newlinalg/test/methods/matrix_outer.morpho @@ -1,8 +1,8 @@ // Outer product of two vectors import newlinalg -var A = XMatrix((1,2,3)) -var B = XMatrix((4,5)) +var A = Matrix((1,2,3)) +var B = Matrix((4,5)) print A.outer(B) // expect: [ 4 5 ] diff --git a/newlinalg/test/methods/matrix_qr.morpho b/newlinalg/test/methods/matrix_qr.morpho index 79ac4847d..50e1abcb5 100644 --- a/newlinalg/test/methods/matrix_qr.morpho +++ b/newlinalg/test/methods/matrix_qr.morpho @@ -2,12 +2,12 @@ import newlinalg // Test with a square matrix (this one is singular, so R will have a zero on the diagonal) -var A = XMatrix(((1.0,2.0,3.0),(4.0,5.0,6.0),(7.0,8.0,9.0))) +var A = Matrix(((1.0,2.0,3.0),(4.0,5.0,6.0),(7.0,8.0,9.0))) var qr = A.qr() print qr -// expect: (, ) +// expect: (, ) var Q = qr[0] var R = qr[1] @@ -20,7 +20,7 @@ print R.dimensions() // Verify Q is orthogonal: Q^T * Q should be approximately I var QTQ = Q.transpose() * Q -var I = IdentityXMatrix(3) +var I = IdentityMatrix(3) print (QTQ - I).norm() < 1e-10 // expect: true @@ -46,7 +46,7 @@ print (QR - A).norm() < 1e-10 // expect: true // Test with a non-square matrix (tall matrix) -var B = XMatrix(4,2) +var B = Matrix(4,2) B[0,0] = 1.0 B[0,1] = 2.0 B[1,0] = 3.0 @@ -94,7 +94,7 @@ print R2_lower_norm < 1e-10 // expect: true // Test with a wide matrix -var C = XMatrix(2,4) +var C = Matrix(2,4) C[0,0] = 1.0 C[0,1] = 2.0 C[0,2] = 3.0 @@ -116,12 +116,12 @@ print R3.dimensions() // Verify Q3 is orthogonal var Q3TQ3 = Q3.transpose() * Q3 -var I2 = IdentityXMatrix(2) +var I2 = IdentityMatrix(2) print (Q3TQ3 - I2).norm() < 1e-10 // expect: true // Test with identity matrix -var I3 = IdentityXMatrix(3) +var I3 = IdentityMatrix(3) var qr4 = I3.qr() var Q4 = qr4[0] var R4 = qr4[1] diff --git a/newlinalg/test/methods/matrix_reshape.morpho b/newlinalg/test/methods/matrix_reshape.morpho index 553550855..f4825fd95 100644 --- a/newlinalg/test/methods/matrix_reshape.morpho +++ b/newlinalg/test/methods/matrix_reshape.morpho @@ -1,7 +1,7 @@ -// Reshape XMatrix +// Reshape Matrix import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[1,0]=2 A[0,1]=3 diff --git a/newlinalg/test/methods/matrix_roll.morpho b/newlinalg/test/methods/matrix_roll.morpho index 5e8c9aeea..379cb4268 100644 --- a/newlinalg/test/methods/matrix_roll.morpho +++ b/newlinalg/test/methods/matrix_roll.morpho @@ -1,7 +1,7 @@ // Roll contents of a matrix import newlinalg -var A = XMatrix(3,3) +var A = Matrix(3,3) var k=0 for (i in 0...3) for (j in 0...3) { A[i,j] = k; k+=1 } diff --git a/newlinalg/test/methods/matrix_sum.morpho b/newlinalg/test/methods/matrix_sum.morpho index 68294074f..8f2e4fd1d 100644 --- a/newlinalg/test/methods/matrix_sum.morpho +++ b/newlinalg/test/methods/matrix_sum.morpho @@ -1,7 +1,7 @@ // Sum import newlinalg -var A = XMatrix(3,2) +var A = Matrix(3,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 diff --git a/newlinalg/test/methods/matrix_svd.morpho b/newlinalg/test/methods/matrix_svd.morpho index 037c7f410..16bea32c4 100644 --- a/newlinalg/test/methods/matrix_svd.morpho +++ b/newlinalg/test/methods/matrix_svd.morpho @@ -1,20 +1,20 @@ // Singular Value Decomposition import newlinalg -var A = XMatrix(((1,0),(0,2))) +var A = Matrix(((1,0),(0,2))) var svd = A.svd() print svd -// expect: (, (2, 1), ) +// expect: (, (2, 1), ) -print (svd[0] - XMatrix(((0,1),(1,0)))).norm() < 1e-10 +print (svd[0] - Matrix(((0,1),(1,0)))).norm() < 1e-10 // expect: true print svd[1] // expect: (2, 1) -print (svd[2] - XMatrix(((0,1),(1,0)))).norm() < 1e-10 +print (svd[2] - Matrix(((0,1),(1,0)))).norm() < 1e-10 // expect: true // Test reconstruction: U * S * V^T should approximately equal A @@ -23,7 +23,7 @@ var S = svd[1] var V = svd[2] // Create diagonal matrix from singular values -var Sdiag = XMatrix(2,2) +var Sdiag = Matrix(2,2) Sdiag[0,0] = S[0] Sdiag[1,1] = S[1] @@ -34,7 +34,7 @@ print (reconstructed - A).norm() < 1e-10 // expect: true // Test with a non-square matrix -var B = XMatrix(3,2) +var B = Matrix(3,2) B[0,0]=1 B[0,1]=0 B[1,0]=0 diff --git a/newlinalg/test/methods/matrix_trace.morpho b/newlinalg/test/methods/matrix_trace.morpho index dc70fcf50..5ee330b9f 100644 --- a/newlinalg/test/methods/matrix_trace.morpho +++ b/newlinalg/test/methods/matrix_trace.morpho @@ -1,7 +1,7 @@ // Inverse import newlinalg -var A = XMatrix(2,2) +var A = Matrix(2,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 diff --git a/newlinalg/test/methods/matrix_transpose.morpho b/newlinalg/test/methods/matrix_transpose.morpho index 395fb0e24..a04547860 100644 --- a/newlinalg/test/methods/matrix_transpose.morpho +++ b/newlinalg/test/methods/matrix_transpose.morpho @@ -1,7 +1,7 @@ // Inverse import newlinalg -var A = XMatrix(3,2) +var A = Matrix(3,2) A[0,0]=1 A[0,1]=2 A[1,0]=3 diff --git a/src/linalg/newlinalg.c b/src/linalg/linalg.c similarity index 96% rename from src/linalg/newlinalg.c rename to src/linalg/linalg.c index 81beb96b8..41b8fb6a7 100644 --- a/src/linalg/newlinalg.c +++ b/src/linalg/linalg.c @@ -1,13 +1,13 @@ -/** @file newlinalg.c +/** @file linalg.c * @author T J Atherton * - * @brief New linear algebra library + * @brief Improved linear algebra library */ #define ACCELERATE_NEW_LAPACK #define MORPHO_INCLUDE_LINALG -#include "newlinalg.h" +#include "linalg.h" /* ------------------------------------------------------- * Errors diff --git a/src/linalg/newlinalg.h b/src/linalg/linalg.h similarity index 97% rename from src/linalg/newlinalg.h rename to src/linalg/linalg.h index c579c7465..386c2efa5 100644 --- a/src/linalg/newlinalg.h +++ b/src/linalg/linalg.h @@ -1,12 +1,12 @@ -/** @file newlinalg.h +/** @file linalg.h * @author T J Atherton * - * @brief New linear algebra library + * @brief Improved linear algebra library */ -#ifndef newlinalg_h -#define newlinalg_h +#ifndef linalg_h +#define linalg_h #include #include From 0841a3a7441b4bc73d5d6c4bd62749b6ed9509a3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:52:47 -0500 Subject: [PATCH 200/473] Initial integration --- src/builtin/builtin.c | 2 +- src/builtin/functiondefs.c | 2 +- src/classes/classes.h | 2 +- src/geometry/field.c | 2 +- src/geometry/field.h | 2 +- src/geometry/functional.c | 2 +- src/geometry/integrate.c | 2 +- src/geometry/mesh.c | 2 +- src/geometry/mesh.h | 2 +- src/geometry/selection.c | 4 ++-- src/linalg/complexmatrix.c | 5 +---- src/linalg/linalg.c | 7 +------ src/linalg/linalg.h | 7 +++++++ src/linalg/matrix.c | 2 +- src/linalg/matrix.h | 1 - src/linalg/sparse.c | 2 +- src/linalg/sparse.h | 2 +- 17 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index d880cfe3e..705b3f8c3 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -462,7 +462,7 @@ void builtin_initialize(void) { // Initialize linear algebra #ifdef MORPHO_INCLUDE_LINALG - matrix_initialize(); + linalg_initialize(); #endif #ifdef MORPHO_INCLUDE_SPARSE diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 4211d84cb..4b03e9d8e 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -14,7 +14,7 @@ #include "common.h" #include "cmplx.h" -#include "matrix.h" +#include "linalg.h" #include "sparse.h" #include "mesh.h" diff --git a/src/classes/classes.h b/src/classes/classes.h index 91b2994af..75d48dec3 100644 --- a/src/classes/classes.h +++ b/src/classes/classes.h @@ -35,6 +35,6 @@ //#include "system.h" #include "json.h" -#include "matrix.h" +#include "linalg.h" #endif /* classes_h */ diff --git a/src/geometry/field.c b/src/geometry/field.c index e59316488..f9029ff8b 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -11,7 +11,7 @@ #include "morpho.h" #include "classes.h" #include "common.h" -#include "matrix.h" +#include "linalg.h" #include "sparse.h" #include "geometry.h" diff --git a/src/geometry/field.h b/src/geometry/field.h index 93ee56f03..47a868e64 100644 --- a/src/geometry/field.h +++ b/src/geometry/field.h @@ -12,7 +12,7 @@ #include "object.h" #include "mesh.h" -#include "matrix.h" +#include "linalg.h" #include /* ------------------------------------------------------- diff --git a/src/geometry/functional.c b/src/geometry/functional.c index ab571011b..774f2d674 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -17,7 +17,7 @@ #include "threadpool.h" -#include "matrix.h" +#include "linalg.h" #include "sparse.h" #include "geometry.h" diff --git a/src/geometry/integrate.c b/src/geometry/integrate.c index 34e379bf1..5e8c8d832 100644 --- a/src/geometry/integrate.c +++ b/src/geometry/integrate.c @@ -14,7 +14,7 @@ #include "morpho.h" #include "classes.h" -#include "matrix.h" +#include "linalg.h" #include "sparse.h" #include "geometry.h" diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 903268a6d..8dca11ba8 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -13,7 +13,7 @@ #include "file.h" #include "parse.h" #include "sparse.h" -#include "matrix.h" +#include "linalg.h" #include "selection.h" // Temporary include diff --git a/src/geometry/mesh.h b/src/geometry/mesh.h index 0a530fa77..883b928e3 100644 --- a/src/geometry/mesh.h +++ b/src/geometry/mesh.h @@ -12,7 +12,7 @@ #ifdef MORPHO_INCLUDE_GEOMETRY #include "varray.h" -#include "matrix.h" +#include "linalg.h" #include "sparse.h" /* ------------------------------------------------------- diff --git a/src/geometry/selection.c b/src/geometry/selection.c index 38b1d66a6..8fa671640 100644 --- a/src/geometry/selection.c +++ b/src/geometry/selection.c @@ -11,7 +11,7 @@ #include "object.h" #include "builtin.h" #include "classes.h" -#include "matrix.h" +#include "linalg.h" #include "sparse.h" #include "mesh.h" #include "selection.h" @@ -186,7 +186,7 @@ void selection_selectwithmatrix(vm *v, objectselection *sel, value fn, objectmat int nv = vert->ncols; if (matrix->ncols!=nv) { - morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return; } diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 89f2d8b48..32cd5a57b 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -4,12 +4,9 @@ * @brief New linear algebra library */ -#define ACCELERATE_NEW_LAPACK -#define MORPHO_INCLUDE_LINALG - #include -#include "newlinalg.h" +#include "linalg.h" #include "matrix.h" #include "complexmatrix.h" #include "format.h" diff --git a/src/linalg/linalg.c b/src/linalg/linalg.c index 41b8fb6a7..d3e72d6b8 100644 --- a/src/linalg/linalg.c +++ b/src/linalg/linalg.c @@ -4,9 +4,6 @@ * @brief Improved linear algebra library */ -#define ACCELERATE_NEW_LAPACK -#define MORPHO_INCLUDE_LINALG - #include "linalg.h" /* ------------------------------------------------------- @@ -33,7 +30,7 @@ void linalg_raiseerror(vm *v, linalgError_t err) { * Initialization and finalization * ------------------------------------------------------- */ -void newlinalg_initialize(void) { +void linalg_initialize(void) { matrix_initialize(); morpho_defineerror(LINALG_INCOMPATIBLEMATRICES, ERROR_HALT, LINALG_INCOMPATIBLEMATRICES_MSG); @@ -48,5 +45,3 @@ void newlinalg_initialize(void) { morpho_defineerror(LINALG_NORMARGS, ERROR_HALT, LINALG_NORMARGS_MSG); } -void newlinalg_finalize(void) { -} diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index 386c2efa5..18dd197b6 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -90,4 +90,11 @@ void linalg_raiseerror(vm *v, linalgError_t err); #include "matrix.h" #include "complexmatrix.h" + +/* ------------------------------------------------------- + * Initialization and finalization + * ------------------------------------------------------- */ + +void linalg_initialize(void); + #endif diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 8c725680d..b38bf160e 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -7,7 +7,7 @@ #define ACCELERATE_NEW_LAPACK #define MORPHO_INCLUDE_LINALG -#include "newlinalg.h" +#include "linalg.h" #include "format.h" /* ********************************************************************** diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 7fa15bd3b..77c057e77 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -50,7 +50,6 @@ typedef struct { /** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ #define MATRIX_ISSMALL(m) (m->nrows*m->ncols #include "object.h" #include "morpho.h" -#include "matrix.h" +#include "linalg.h" /* ------------------------------------------------------- * Sparse objects From 253f8d7869fca06857ab4fd2bdb3720b0fbff713 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:01:27 -0500 Subject: [PATCH 201/473] Fix matrix library includes --- src/linalg/matrix.c | 2 -- src/linalg/matrix.h | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index b38bf160e..1cec54e2a 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -4,8 +4,6 @@ * @brief New matrices */ -#define ACCELERATE_NEW_LAPACK -#define MORPHO_INCLUDE_LINALG #include "linalg.h" #include "format.h" diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 77c057e77..8c0f3c76b 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -1,12 +1,37 @@ /** @file matrix.h * @author T J Atherton * - * @brief New linear algebra library -*/ + * @brief Veneer class over the objectmatrix type that interfaces with blas and lapack + */ #ifndef matrix_h #define matrix_h +#include "build.h" +#ifdef MORPHO_INCLUDE_LINALG + +#include +#include "classes.h" +/** Use Apple's Accelerate library for LAPACK and BLAS */ +#ifdef __APPLE__ +#ifdef MORPHO_LINALG_USE_ACCELERATE +#define ACCELERATE_NEW_LAPACK +#include +#define MATRIX_LAPACK_PRESENT +#endif +#endif + +/** Otherwise, use LAPACKE */ +#ifndef MATRIX_LAPACK_PRESENT +#include +#include +#define MORPHO_LINALG_USE_LAPACKE +#define MATRIX_LAPACK_PRESENT +#endif + +#include "cmplx.h" +#include "list.h" + #define LINALG_MAXMATRIXDEFNS 4 /* ------------------------------------------------------- @@ -232,4 +257,6 @@ linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, Matrix void matrix_print(vm *v, objectmatrix *m); -#endif +#endif /* MORPHO_INCLUDE_LINALG */ + +#endif /* matrix_h */ From b36d1cceecf175e4a820f15e901174e0fa4276d2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:02:50 -0500 Subject: [PATCH 202/473] Correct includes --- src/linalg/matrix.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 1cec54e2a..1e3f23a3d 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -4,8 +4,15 @@ * @brief New matrices */ +#include "build.h" +#ifdef MORPHO_INCLUDE_LINALG -#include "linalg.h" +#include +#include "morpho.h" +#include "classes.h" + +#include "matrix.h" +#include "sparse.h" #include "format.h" /* ********************************************************************** @@ -1484,3 +1491,5 @@ void matrix_initialize(void) { complematrix_initialize(); } + +#endif /* MORPHO_INCLUDE_LINALG */ \ No newline at end of file From bd32f5c51796209f572e6388bca8e3bde9982f5d Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:11:18 -0500 Subject: [PATCH 203/473] Patch some API calls --- src/geometry/mesh.c | 14 +++++++------- src/geometry/selection.c | 4 +--- src/linalg/matrix.c | 8 +++++++- src/linalg/matrix.h | 1 + 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 8dca11ba8..150174df3 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -79,7 +79,7 @@ objectmesh *object_newmesh(unsigned int dim, unsigned int nv, double *v) { new->dim=dim; new->conn=NULL; - new->vert=object_newmatrix(dim, nv, false); + new->vert=matrix_new(dim, nv, false); new->link=NULL; if (new->vert) { mesh_link(new, (object *) new->vert); @@ -129,7 +129,7 @@ void mesh_delink(objectmesh *mesh, object *obj) { /** Gets vertex coordinates */ bool mesh_getvertexcoordinates(objectmesh *mesh, elementid id, double *out) { double *coords; - if (matrix_getcolumn(mesh->vert, id, &coords)) { + if (matrix_getcolumnptr(mesh->vert, id, &coords)==LINALGERR_OK) { for (unsigned int i=0; idim; i++) out[i]=coords[i]; return true; } @@ -139,7 +139,7 @@ bool mesh_getvertexcoordinates(objectmesh *mesh, elementid id, double *out) { /** Gets vertex coordinates as a list */ bool mesh_getvertexcoordinatesaslist(objectmesh *mesh, elementid id, double **out) { double *coords=NULL; - if (matrix_getcolumn(mesh->vert, id, &coords)) { + if (matrix_getcolumnptr(mesh->vert, id, &coords)==LINALGERR_OK) { *out=coords; } return coords; @@ -154,7 +154,7 @@ bool mesh_setvertexcoordinates(objectmesh *mesh, elementid id, double *x) {; bool mesh_getvertexcoordinatesasvalues(objectmesh *mesh, elementid id, value *val) { double *x=NULL; // The vertex positions - bool success=matrix_getcolumn(mesh->vert, id, &x); + bool success=(matrix_getcolumnptr(mesh->vert, id, &x)==LINALGERR_OK); if (success) { for (unsigned int i=0; idim; i++) val[i]=MORPHO_FLOAT(x[i]); @@ -175,7 +175,7 @@ bool mesh_nearestvertex(objectmesh *mesh, double *x, elementid *id, double *sepa elementid bestid=0; for (elementid i=0; ivert, i, &vx)) return false; + if (matrix_getcolumnptr(mesh->vert, i, &vx)!=LINALGERR_OK) return false; sep=0; for (int k=0; kdim; k++) sep+=(vx[k]-x[k])*(vx[k]-x[k]); if (i==0 || sepvert, id, &vals)) { - objectmatrix *new=object_newmatrix(m->dim, 1, true); + if (matrix_getcolumnptr(m->vert, id, &vals)) { + objectmatrix *new=matrix_new(m->dim, 1, true); if (new) { matrix_setcolumn(new, 0, vals); out=MORPHO_OBJECT(new); diff --git a/src/geometry/selection.c b/src/geometry/selection.c index 8fa671640..7af5ab7c4 100644 --- a/src/geometry/selection.c +++ b/src/geometry/selection.c @@ -196,9 +196,7 @@ void selection_selectwithmatrix(vm *v, objectselection *sel, value fn, objectmat value ret=MORPHO_NIL; // Return value for (elementid i=0; i=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; @@ -1492,4 +1498,4 @@ void matrix_initialize(void) { complematrix_initialize(); } -#endif /* MORPHO_INCLUDE_LINALG */ \ No newline at end of file +#endif /* MORPHO_INCLUDE_LINALG */ diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 8c0f3c76b..207aed96f 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -254,6 +254,7 @@ linalgError_t matrix_qr(objectmatrix *a, objectmatrix *q, objectmatrix *r); linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); +linalgError_t matrix_getcolumnptr(objectmatrix *matrix, MatrixIdx_t col, double **value); void matrix_print(vm *v, objectmatrix *m); From dd4b1188b8c7df7a88ecc519cd4fda39fca682dc Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:25:15 -0500 Subject: [PATCH 204/473] matrix_zero and other API patches --- src/geometry/integrate.c | 12 ++++++------ src/linalg/complexmatrix.c | 2 -- src/linalg/matrix.c | 8 +++++++- src/linalg/matrix.h | 3 +++ 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/geometry/integrate.c b/src/geometry/integrate.c index 5e8c8d832..1cc90c620 100644 --- a/src/geometry/integrate.c +++ b/src/geometry/integrate.c @@ -24,7 +24,7 @@ bool integrate_recognizequantities(unsigned int nquantity, value *quantity, valu if (MORPHO_ISFLOAT(quantity[i])) { out[i]=MORPHO_FLOAT(0); } else if (MORPHO_ISMATRIX(quantity[i])) { - out[i]=MORPHO_OBJECT(object_clonematrix(MORPHO_GETMATRIX(quantity[i]))); + out[i]=MORPHO_OBJECT(matrix_clone(MORPHO_GETMATRIX(quantity[i]))); } else return false; } } @@ -84,7 +84,7 @@ void integrate_interpolatequantitiesline(unsigned int dim, double t, unsigned in *out=(MORPHO_ISMATRIX(qout[i]) ? MORPHO_GETMATRIX(qout[i]): NULL); if (!out) { - out = object_clonematrix(m0); + out = matrix_clone(m0); qout[i]=MORPHO_OBJECT(out); } @@ -265,7 +265,7 @@ void integrate_interpolatequantitiestri(unsigned int dim, double *lambda, unsign *out=(MORPHO_ISMATRIX(qout[i]) ? MORPHO_GETMATRIX(qout[i]): NULL); if (!out) { - out = object_clonematrix(m0); + out = matrix_clone(m0); qout[i]=MORPHO_OBJECT(out); } @@ -603,7 +603,7 @@ void integrate_interpolatequantitiesvol(unsigned int dim, double *lambda, unsign *out=(MORPHO_ISMATRIX(qout[i]) ? MORPHO_GETMATRIX(qout[i]): NULL); if (!out) { - out = object_clonematrix(m0); + out = matrix_clone(m0); qout[i]=MORPHO_OBJECT(out); } @@ -2228,7 +2228,7 @@ void integrator_initializequantities(integrator *integrate, int nq, quantity *qu objectmatrix *m = MORPHO_GETMATRIX(q); quantity[i].ndof=matrix_countdof(m); - objectmatrix *new = object_clonematrix(m); // Use a copy of the matrix + objectmatrix *new = matrix_clone(m); // Use a copy of the matrix integrate->qval[i]=MORPHO_OBJECT(new); } else return; } @@ -2396,7 +2396,7 @@ bool integrator_sumquantityweighted(int n, double *wts, value *q, value *out) { } else if (MORPHO_ISMATRIX(q[0])) { objectmatrix *sum = MORPHO_GETMATRIX(*out); matrix_zero(sum); - for (int j=0; j #include "linalg.h" -#include "matrix.h" -#include "complexmatrix.h" #include "format.h" #include "cmplx.h" diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index c2a1f6d8b..1cdb66f8a 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -441,10 +441,16 @@ void matrix_scale(objectmatrix *x, double scale) { cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); } +/** Loads the zero matrix a <- 0 */ +linalgError_t matrix_zero(objectmatrix *x) { + memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols*x->nvals); + return LINALGERR_OK; +} + /** Loads the identity matrix a <- I(n) */ linalgError_t matrix_identity(objectmatrix *x) { if (x->ncols!=x->nrows) return LINALGERR_NOT_SQUARE; - memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); + matrix_zero(x); for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; return LINALGERR_OK; } diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 207aed96f..d777890f3 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -32,6 +32,8 @@ #include "cmplx.h" #include "list.h" +#include "linalg.h" + #define LINALG_MAXMATRIXDEFNS 4 /* ------------------------------------------------------- @@ -240,6 +242,7 @@ objectmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, Ma linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y); linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y); void matrix_scale(objectmatrix *x, double scale); +linalgError_t matrix_zero(objectmatrix *x); linalgError_t matrix_identity(objectmatrix *x); linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double beta, objectmatrix *z); linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta); From a4755c72c6bab5d051e90460bf049623899077db Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:28:16 -0500 Subject: [PATCH 205/473] Correct output type --- src/geometry/field.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/geometry/field.c b/src/geometry/field.c index f9029ff8b..27695ebd2 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -485,21 +485,21 @@ unsigned int field_dofforgrade(objectfield *f, grade g) { /** Adds two fields together */ bool field_add(objectfield *left, objectfield *right, objectfield *out) { - return (matrix_add(&left->data, &right->data, &out->data)==MATRIX_OK); + return (matrix_add(&left->data, &right->data, &out->data)==LINALGERR_OK); } /** Subtracts one field from another */ bool field_sub(objectfield *left, objectfield *right, objectfield *out) { - return (matrix_sub(&left->data, &right->data, &out->data)==MATRIX_OK); + return (matrix_sub(&left->data, &right->data, &out->data)==LINALGERR_OK); } /** Accumulate, i.e. a <- a + lambda*b */ bool field_accumulate(objectfield *left, double lambda, objectfield *right) { - return (matrix_accumulate(&left->data, lambda, &right->data)==MATRIX_OK); + return (matrix_accumulate(&left->data, lambda, &right->data)==LINALGERR_OK); } bool field_inner(objectfield *left, objectfield *right, double *out) { - return (matrix_inner(&left->data, &right->data, out)==MATRIX_OK); + return (matrix_inner(&left->data, &right->data, out)==LINALGERR_OK); } /** Calls a function fn on every element of a field, optionally with other fields as arguments */ @@ -685,7 +685,7 @@ value Field_assign(vm *v, int nargs, value *args) { } else if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - if (matrix_copy(b, &a->data)!=MATRIX_OK) morpho_runtimeerror(v, FIELD_INCOMPATIBLEMATRICES); + if (matrix_copy(b, &a->data)!=LINALGERR_OK) morpho_runtimeerror(v, FIELD_INCOMPATIBLEMATRICES); } else morpho_runtimeerror(v, FIELD_ARITHARGS); return MORPHO_NIL; @@ -726,7 +726,7 @@ value Field_addr(vm *v, int nargs, value *args) { if (i==0) { out=MORPHO_SELF(args); } else UNREACHABLE("Right addition to non-zero value."); - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + } else morpho_runtimeerror(v, LINALG_INVLDARGS); return out; } @@ -808,7 +808,7 @@ value Field_mul(vm *v, int nargs, value *args) { morpho_bindobjects(v, 1, &out); } } - } else morpho_runtimeerror(v, MATRIX_ARITHARGS); + } else morpho_runtimeerror(v, LINALG_INVLDARGS); return out; } @@ -943,7 +943,7 @@ value Field_linearize(vm *v, int nargs, value *args) { objectfield *f=MORPHO_GETFIELD(MORPHO_SELF(args)); value out = MORPHO_NIL; - objectmatrix *m=object_clonematrix(&f->data); + objectmatrix *m=matrix_clone(&f->data); if (m) { out = MORPHO_OBJECT(m); morpho_bindobjects(v, 1, &out); From fa1a2d8b2d47f0b43bc92a7c4b23c6f43fa1fdf6 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:34:23 -0500 Subject: [PATCH 206/473] Patch field arithmetic functions --- src/geometry/field.c | 8 +++++--- src/linalg/matrix.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/geometry/field.c b/src/geometry/field.c index 27695ebd2..32bd5b267 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -485,17 +485,19 @@ unsigned int field_dofforgrade(objectfield *f, grade g) { /** Adds two fields together */ bool field_add(objectfield *left, objectfield *right, objectfield *out) { - return (matrix_add(&left->data, &right->data, &out->data)==LINALGERR_OK); + return (matrix_copy(&left->data, &out->data)==LINALGERR_OK && + matrix_axpy(1.0, &right->data, &out->data)==LINALGERR_OK); } /** Subtracts one field from another */ bool field_sub(objectfield *left, objectfield *right, objectfield *out) { - return (matrix_sub(&left->data, &right->data, &out->data)==LINALGERR_OK); + return (matrix_copy(&left->data, &out->data)==LINALGERR_OK && + matrix_axpy(-1.0, &right->data, &out->data)==LINALGERR_OK); } /** Accumulate, i.e. a <- a + lambda*b */ bool field_accumulate(objectfield *left, double lambda, objectfield *right) { - return (matrix_accumulate(&left->data, lambda, &right->data)==LINALGERR_OK); + return (matrix_axpy(lambda, &right->data, &left->data)==LINALGERR_OK); } bool field_inner(objectfield *left, objectfield *right, double *out) { diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 1cdb66f8a..38a6866e7 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1501,7 +1501,7 @@ void matrix_initialize(void) { morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); - complematrix_initialize(); + complexmatrix_initialize(); } #endif /* MORPHO_INCLUDE_LINALG */ From 33b360468eae86e04db445d1949fb888012f9b90 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:43:05 -0500 Subject: [PATCH 207/473] matrix_countdof --- src/linalg/matrix.c | 5 +++++ src/linalg/matrix.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 38a6866e7..0c515d55b 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -416,6 +416,11 @@ linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b return LINALGERR_OK; } +/** Counts the number of dofs in a matrix */ +MatrixCount_t matrix_countdof(objectmatrix *a) { + return a->ncols*a->nrows*a->nvals; +} + /* ---------------------- * Arithmetic operations * ---------------------- */ diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index d777890f3..dbcbcdff9 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -239,6 +239,8 @@ objectmatrix *matrix_clone(objectmatrix *in); objectmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals); objectmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals); +MatrixCount_t matrix_countdof(objectmatrix *a); + linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y); linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y); void matrix_scale(objectmatrix *x, double scale); @@ -248,6 +250,8 @@ linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta); linalgError_t matrix_transpose(objectmatrix *x, objectmatrix *y); +linalgError_t matrix_inner(objectmatrix *x, objectmatrix *y, double *out); + linalgError_t matrix_solve(objectmatrix *a, objectmatrix *b); linalgError_t matrix_svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt); From df1e43099569fa6d73e311abd0a42df37aaf7b80 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 14 Jan 2026 22:47:02 -0500 Subject: [PATCH 208/473] Matrix operations in functional.c --- src/geometry/functional.c | 78 +++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 774f2d674..933e06f92 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -154,8 +154,8 @@ bool functional_symmetrysumforces(objectmesh *mesh, objectmatrix *frc) { double *fi, *fj, fsum[mesh->dim]; while (sparsedok_loop(&s->dok, &ctr, &i, &j)) { - if (matrix_getcolumn(frc, i, &fi) && - matrix_getcolumn(frc, j, &fj)) { + if (matrix_getcolumnptr(frc, i, &fi) && + matrix_getcolumnptr(frc, j, &fj)) { for (unsigned int k=0; kdim; k++) fsum[k]=fi[k]+fj[k]; matrix_setcolumn(frc, i, fsum); @@ -279,7 +279,7 @@ bool functional_mapintegrandX(vm *v, functional_mapinfo *info, value *out) { /* Create the output matrix */ if (n>0) { - new=object_newmatrix(1, n, true); + new=matrix_new(1, n, true); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } } @@ -357,7 +357,7 @@ bool functional_mapgradientX(vm *v, functional_mapinfo *info, value *out) { /* Create the output matrix */ if (n>0) { - frc=object_newmatrix(mesh->vert->nrows, mesh->vert->ncols, true); + frc=matrix_new(mesh->vert->nrows, mesh->vert->ncols, true); if (!frc) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } } @@ -566,7 +566,7 @@ bool functional_mapnumericalgradientX(vm *v, functional_mapinfo *info, value *ou /* Create the output matrix */ if (n>0) { - frc=object_newmatrix(mesh->vert->nrows, mesh->vert->ncols, true); + frc=matrix_new(mesh->vert->nrows, mesh->vert->ncols, true); if (!frc) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } } @@ -1047,7 +1047,7 @@ bool functional_mapintegrand(vm *v, functional_mapinfo *info, value *out) { /* Create output matrix */ if (task[0].nel>0) { - new=object_newmatrix(1, task[0].nel, true); + new=matrix_new(1, task[0].nel, true); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } } @@ -1093,7 +1093,7 @@ bool functional_mapgradient(vm *v, functional_mapinfo *info, value *out) { /* Create output matrix */ for (int i=0; imesh->vert->nrows, info->mesh->vert->ncols, true); + new[i]=matrix_new(info->mesh->vert->nrows, info->mesh->vert->ncols, true); if (!new[i]) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto functional_mapgradient_cleanup; } task[i].mapfn=(functional_mapfn *) info->grad; @@ -1195,12 +1195,12 @@ bool functional_mapnumericalgradient(vm *v, functional_mapinfo *info, value *out for (int i=0; imesh->vert->nrows, info->mesh->vert->ncols, true); + new[i]=matrix_new(info->mesh->vert->nrows, info->mesh->vert->ncols, true); if (!new[i]) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto functional_mapgradient_cleanup; } // Clone the vertex matrix for each thread meshclones[i]=*info->mesh; - meshclones[i].vert=object_clonematrix(info->mesh->vert); + meshclones[i].vert=matrix_clone(info->mesh->vert); task[i].mesh=&meshclones[i]; task[i].ref=(void *) info; // Use this to pass the info structure @@ -1561,7 +1561,7 @@ bool functional_mapnumericalhessian(vm *v, functional_mapinfo *info, value *out) // Clone the vertex matrix for each thread meshclones[i]=*info->mesh; - meshclones[i].vert=object_clonematrix(info->mesh->vert); + meshclones[i].vert=matrix_clone(info->mesh->vert); if (!meshclones[i].vert) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto functional_maphessian_cleanup; } task[i].mesh=&meshclones[i]; @@ -1713,7 +1713,7 @@ bool functional_elementgradient(vm *v, objectmesh *mesh, grade g, elementid id, bool length_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, double *out) { if (nv!=2) return false; double *x[nv], s0[mesh->dim]; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); functional_vecsub(mesh->dim, x[1], x[0], s0); @@ -1724,7 +1724,7 @@ bool length_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, v /** Calculate scaled gradient */ bool length_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, objectmatrix *frc, double scale) { double *x[nv], s0[mesh->dim], norm; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); functional_vecsub(mesh->dim, x[1], x[0], s0); norm=functional_vecnorm(mesh->dim, s0); @@ -1764,7 +1764,7 @@ MORPHO_ENDCLASS /** Calculate area enclosed */ bool areaenclosed_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, double *out) { double *x[nv], cx[mesh->dim], normcx; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); if (mesh->dim==2) { functional_veccross2d(x[0], x[1], cx); @@ -1783,7 +1783,7 @@ bool areaenclosed_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * bool areaenclosed_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, objectmatrix *frc) { double *x[nv], cx[3], s[3]; double norm; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); if (mesh->dim==3) { functional_veccross(x[0], x[1], cx); @@ -1829,7 +1829,7 @@ bool area_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, voi if (nv!=3) return false; double *x[nv], s0[3], s1[3], cx[3]; for (int j=0; j<3; j++) { s0[j]=0; s1[j]=0; cx[j]=0; } - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); functional_vecsub(mesh->dim, x[1], x[0], s0); functional_vecsub(mesh->dim, x[2], x[1], s1); @@ -1845,7 +1845,7 @@ bool area_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *vid double *x[nv], s0[3], s1[3], s01[3], s010[3], s011[3]; double norm; for (int j=0; j<3; j++) { s0[j]=0; s1[j]=0; s01[j]=0; s010[j]=0; s011[j]=0; } - for (int j=0; jvert, vid[j], &x[j])) return false; + for (int j=0; jvert, vid[j], &x[j])) return false; functional_vecsub(mesh->dim, x[1], x[0], s0); functional_vecsub(mesh->dim, x[2], x[1], s1); @@ -1895,7 +1895,7 @@ MORPHO_ENDCLASS /** Calculate enclosed volume */ bool volumeenclosed_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, double *out) { double *x[nv], cx[mesh->dim]; - for (int j=0; jvert, vid[j], &x[j])) return false; + for (int j=0; jvert, vid[j], &x[j])) return false; functional_veccross(x[0], x[1], cx); @@ -1906,7 +1906,7 @@ bool volumeenclosed_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int /** Calculate gradient */ bool volumeenclosed_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, objectmatrix *frc) { double *x[nv], cx[mesh->dim], dot; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); functional_veccross(x[0], x[1], cx); dot=functional_vecdot(mesh->dim, cx, x[2]); @@ -1949,7 +1949,7 @@ MORPHO_ENDCLASS /** Calculate enclosed volume */ bool volume_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, double *out) { double *x[nv], s10[mesh->dim], s20[mesh->dim], s30[mesh->dim], cx[mesh->dim]; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); functional_vecsub(mesh->dim, x[1], x[0], s10); functional_vecsub(mesh->dim, x[2], x[0], s20); @@ -1965,7 +1965,7 @@ bool volume_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, v bool volume_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, objectmatrix *frc, double scale) { double *x[nv], s10[mesh->dim], s20[mesh->dim], s30[mesh->dim]; double s31[mesh->dim], s21[mesh->dim], cx[mesh->dim], uu; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j]); functional_vecsub(mesh->dim, x[1], x[0], s10); functional_vecsub(mesh->dim, x[2], x[0], s20); @@ -2034,7 +2034,7 @@ bool scalarpotential_integrand(vm *v, objectmesh *mesh, elementid id, int nv, in value args[mesh->dim]; value ret; - matrix_getcolumn(mesh->vert, id, &x); + matrix_getcolumnptr(mesh->vert, id, &x); for (int i=0; idim; i++) args[i]=MORPHO_FLOAT(x[i]); if (morpho_call(v, fn, mesh->dim, args, &ret)) { @@ -2051,7 +2051,7 @@ bool scalarpotential_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int value args[mesh->dim]; value ret; - matrix_getcolumn(mesh->vert, id, &x); + matrix_getcolumnptr(mesh->vert, id, &x); for (int i=0; idim; i++) args[i]=MORPHO_FLOAT(x[i]); if (morpho_call(v, fn, mesh->dim, args, &ret)) { @@ -2157,7 +2157,7 @@ void linearelasticity_calculategram(objectmatrix *vert, int dim, int nv, int *vi double *x[nv], // Positions of vertices s[gdim][nv]; // Side vectors - for (int j=0; j for (int i=0; ielements[i+j*gdim]=functional_vecdot(dim, s[i], s[j]); @@ -2180,8 +2180,8 @@ bool linearelasticity_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i linearelasticity_calculategram(info->refmesh->vert, mesh->dim, nv, vid, &gramref); linearelasticity_calculategram(mesh->vert, mesh->dim, nv, vid, &gramdef); - if (matrix_inverse(&gramref, &q)!=MATRIX_OK) return false; - if (matrix_mul(&gramdef, &q, &r)!=MATRIX_OK) return false; + if (matrix_inverse(&gramref, &q)!=LINALGERR_OK) return false; + if (matrix_mul(&gramdef, &q, &r)!=LINALGERR_OK) return false; matrix_identity(&cg); matrix_scale(&cg, -0.5); @@ -2917,7 +2917,7 @@ bool linetorsionsq_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int /* We now have an ordered list of vertices. Get the vertex positions */ double *x[6]; - for (int i=0; i<6; i++) matrix_getcolumn(mesh->vert, vlist[i], &x[i]); + for (int i=0; i<6; i++) matrix_getcolumnptr(mesh->vert, vlist[i], &x[i]); double A[3], B[3], C[3], crossAB[3], crossBC[3]; functional_vecsub(3, x[1], x[0], A); @@ -3081,7 +3081,7 @@ bool meancurvaturesq_integrand(vm *v, objectmesh *mesh, elementid id, int nv, in double *x[3], s0[3], s1[3], s01[3], s101[3]; double norm; - for (int j=0; j<3; j++) matrix_getcolumn(mesh->vert, vids[j], &x[j]); + for (int j=0; j<3; j++) matrix_getcolumnptr(mesh->vert, vids[j], &x[j]); /* s0 = x1-x0; s1 = x2-x1 */ functional_vecsub(mesh->dim, x[1], x[0], s0); @@ -3155,7 +3155,7 @@ bool gausscurvature_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int if (!curvature_ordervertices(&synid, nvert, vids)) goto gausscurv_cleanup; double *x[3], s0[3], s1[3], s01[3]; - for (int j=0; j<3; j++) matrix_getcolumn(mesh->vert, vids[j], &x[j]); + for (int j=0; j<3; j++) matrix_getcolumnptr(mesh->vert, vids[j], &x[j]); /* s0 = x1-x0; s1 = x2-x0 */ functional_vecsub(mesh->dim, x[1], x[0], s0); @@ -4003,7 +4003,7 @@ void integral_evaluatetangent(vm *v, value *out) { int dim = elref->mesh->dim; - objectmatrix *mtangent = object_newmatrix(dim, 1, false); + objectmatrix *mtangent = matrix_new(dim, 1, false); if (!mtangent) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return; @@ -4040,7 +4040,7 @@ void integral_evaluatenormal(vm *v, value *out) { int dim = elref->mesh->dim; double s0[dim], s1[dim]; - objectmatrix *mnormal = object_newmatrix(dim, 1, false); + objectmatrix *mnormal = matrix_new(dim, 1, false); if (!mnormal) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return; @@ -4086,7 +4086,7 @@ bool integral_prepareinvjacobian(unsigned int dim, grade g, double **x, objectma if (g==dim) { objectmatrix smat = MORPHO_STATICMATRIX(s, dim, dim); - success=(matrix_inverse(&smat, invj)==MATRIX_OK); + success=(matrix_inverse(&smat, invj)==LINALGERR_OK); } else if (g==1) { double s01norm = functional_vecdot(dim, s, s); if (s01norm>0) { @@ -4117,7 +4117,7 @@ bool integral_prepareinvjacobian(unsigned int dim, grade g, double **x, objectma /** Allocate suitable storage for the gradient */ bool integral_gradalloc(int dim, value prototype, value *out) { if (MORPHO_ISNIL(prototype)) { // Scalar - objectmatrix *mgrad=object_newmatrix(dim, 1, false); + objectmatrix *mgrad=matrix_new(dim, 1, false); if (mgrad) *out = MORPHO_OBJECT(mgrad); return mgrad; } else if (MORPHO_ISMATRIX(prototype)) { @@ -4135,7 +4135,7 @@ bool integral_gradsuminit(int i, value prototype, value dest, value *sum) { if (i>=list_length(lst)) { objectmatrix *prmat = MORPHO_GETMATRIX(prototype); - objectmatrix *new = object_newmatrix(prmat->nrows, prmat->ncols, true); + objectmatrix *new = matrix_new(prmat->nrows, prmat->ncols, true); if (!new) return false; *sum = MORPHO_OBJECT(new); list_append(lst, *sum); @@ -4169,7 +4169,7 @@ bool integral_oldgradcopy(int dim, int ndof, double *grad, value prototype, valu value el; if (i>=list_length(lst)) { - mgrad=object_newmatrix(proto->nrows, proto->ncols, false); // Should copy prototype dimensions! + mgrad=matrix_new(proto->nrows, proto->ncols, false); // Should copy prototype dimensions! if (mgrad) { for (int k=0; kelements[k]=grad[k*dim+i]; list_append(lst, MORPHO_OBJECT(mgrad)); @@ -4219,7 +4219,7 @@ bool integral_evaluategradient(vm *v, value q, value *out) { // Evaluate gradient if (MORPHO_ISFESPACE(fld->fnspc)) { if (!elref->invj) { - elref->invj=object_newmatrix(elref->g, elref->mesh->dim, false); + elref->invj=matrix_new(elref->g, elref->mesh->dim, false); if (elref->invj) { integral_prepareinvjacobian(elref->mesh->dim, elref->g, elref->vertexposn, elref->invj); @@ -4241,7 +4241,7 @@ bool integral_evaluategradient(vm *v, value q, value *out) { double fmatdata[nnodes * dim]; objectmatrix fmat = MORPHO_STATICMATRIX(fmatdata, nnodes, dim); - if (matrix_mul(&gmat, elref->invj, &fmat)!=MATRIX_OK) { + if (matrix_mul(&gmat, elref->invj, &fmat)!=LINALGERR_OK) { morpho_runtimeerror(v, INTEGRAL_GRDEVL); return false; } @@ -4302,7 +4302,7 @@ void integral_evaluatecg(vm *v, value *out) { int gdim=elref->nv-1; // Dimension of Gram matrix - objectmatrix *cg=object_newmatrix(gdim, gdim, true); + objectmatrix *cg=matrix_new(gdim, gdim, true); if (!cg) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return; } double gramrefel[gdim*gdim], gramdefel[gdim*gdim], qel[gdim*gdim], rel[gdim*gdim]; @@ -4314,8 +4314,8 @@ void integral_evaluatecg(vm *v, value *out) { linearelasticity_calculategram(elref->iref->mref->vert, elref->mesh->dim, elref->nv, elref->vid, &gramref); linearelasticity_calculategram(elref->mesh->vert, elref->mesh->dim, elref->nv, elref->vid, &gramdef); - if (matrix_inverse(&gramref, &q)!=MATRIX_OK) return; - if (matrix_mul(&gramdef, &q, &r)!=MATRIX_OK) return; + if (matrix_inverse(&gramref, &q)!=LINALGERR_OK) return; + if (matrix_mul(&gramdef, &q, &r)!=LINALGERR_OK) return; matrix_identity(cg); matrix_scale(cg, -0.5); From 2d712419a9249d13f2cf560b33ff151d6dbd8c1f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:18:42 -0500 Subject: [PATCH 209/473] Conversion of functional.c matrix_ calls to new API --- src/geometry/functional.c | 31 ++++++++++++++++--------------- src/linalg/matrix.c | 4 ++++ src/linalg/matrix.h | 8 ++++++++ 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 933e06f92..782d9de58 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -1103,7 +1103,7 @@ bool functional_mapgradient(vm *v, functional_mapinfo *info, value *out) { functional_parallelmap(ntask, task); /* Then add up all the matrices */ - for (int i=1; isym==SYMMETRY_ADD) functional_symmetrysumforces(info->mesh, new[0]); @@ -1211,7 +1211,7 @@ bool functional_mapnumericalgradient(vm *v, functional_mapinfo *info, value *out functional_parallelmap(ntask, task); /* Then add up all the matrices */ - for (int i=1; idata, &new[1]->data, &new[0]->data); + for (int i=1; idata, &new[0]->data); // TODO: Use symmetry actions //if (info->sym==SYMMETRY_ADD) functional_symmetrysumforces(info->mesh, new[0]); @@ -1394,7 +1394,7 @@ bool functional_mapnumericalfieldgradient(vm *v, functional_mapinfo *info, value functional_parallelmap(ntask, task); /* Then add up all the fields */ - for (int i=1; idata, &new[i]->data, &new[0]->data); + for (int i=1; idata, &new[0]->data); success=true; @@ -2180,16 +2180,17 @@ bool linearelasticity_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i linearelasticity_calculategram(info->refmesh->vert, mesh->dim, nv, vid, &gramref); linearelasticity_calculategram(mesh->vert, mesh->dim, nv, vid, &gramdef); - if (matrix_inverse(&gramref, &q)!=LINALGERR_OK) return false; + if (matrix_copy(&gramref, &q)!=LINALGERR_OK) return false; + if (matrix_inverse(&q)!=LINALGERR_OK) return false; if (matrix_mul(&gramdef, &q, &r)!=LINALGERR_OK) return false; matrix_identity(&cg); matrix_scale(&cg, -0.5); - matrix_accumulate(&cg, 0.5, &r); + matrix_axpy(0.5, &r, &cg); // y <- alpha*x + y double trcg=0.0, trcgcg=0.0; matrix_trace(&cg, &trcg); - + matrix_mul(&cg, &cg, &r); matrix_trace(&r, &trcgcg); @@ -2559,7 +2560,7 @@ bool equielement_prepareref(objectinstance *self, objectmesh *mesh, grade g, obj MORPHO_ISMATRIX(weight) ) { ref->weight=MORPHO_GETMATRIX(weight); if (ref->weight) { - ref->mean=matrix_sum(ref->weight); + matrix_sum(ref->weight, &ref->mean); ref->mean/=ref->weight->ncols; } } @@ -3328,18 +3329,16 @@ bool gradsq_evaluategradient3d(objectmesh *mesh, objectfield *field, int nv, int objectmatrix Mt = MORPHO_STATICMATRIX(xtarray, mesh->dim, mesh->dim); matrix_transpose(&M, &Mt); - double farray[nentries*mesh->dim]; // Field elements - objectmatrix frhs = MORPHO_STATICMATRIX(farray, mesh->dim, nentries); objectmatrix grad = MORPHO_STATICMATRIX(out, mesh->dim, nentries); // Loop over elements of the field for (unsigned int i=0; idim; j++) farray[i*mesh->dim+j] = f[j+1][i]-f[0][i]; + for (unsigned int j=0; jdim; j++) out[i*mesh->dim+j] = f[j+1][i]-f[0][i]; } // Solve to obtain the gradient of each element - matrix_divs(&Mt, &frhs, &grad); + matrix_solvesmall(&Mt, &grad); return true; } @@ -4086,7 +4085,8 @@ bool integral_prepareinvjacobian(unsigned int dim, grade g, double **x, objectma if (g==dim) { objectmatrix smat = MORPHO_STATICMATRIX(s, dim, dim); - success=(matrix_inverse(&smat, invj)==LINALGERR_OK); + success=(matrix_copy(&smat, invj)==LINALGERR_OK && + matrix_inverse(invj)==LINALGERR_OK); } else if (g==1) { double s01norm = functional_vecdot(dim, s, s); if (s01norm>0) { @@ -4314,12 +4314,13 @@ void integral_evaluatecg(vm *v, value *out) { linearelasticity_calculategram(elref->iref->mref->vert, elref->mesh->dim, elref->nv, elref->vid, &gramref); linearelasticity_calculategram(elref->mesh->vert, elref->mesh->dim, elref->nv, elref->vid, &gramdef); - if (matrix_inverse(&gramref, &q)!=LINALGERR_OK) return; + if (matrix_copy(&gramref, &q)!=LINALGERR_OK) return; + if (matrix_inverse(&q)!=LINALGERR_OK) return; if (matrix_mul(&gramdef, &q, &r)!=LINALGERR_OK) return; matrix_identity(cg); matrix_scale(cg, -0.5); - matrix_accumulate(cg, 0.5, &r); + matrix_axpy(0.5, &r, cg); vm_settlvar(v, cauchygreenhandle, MORPHO_OBJECT(cg)); *out = MORPHO_OBJECT(cg); diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 0c515d55b..a069acd6e 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -468,6 +468,10 @@ linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double return LINALGERR_OK; } +linalgError_t matrix_mul(objectmatrix *x, objectmatrix *y, objectmatrix *z) { + return matrix_mmul(1.0, x, y, 0.0, z); +} + /** Performs x <- alpha*x + beta */ linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta) { for (MatrixCount_t i=0; incols*x->nrows; i++) { diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index dbcbcdff9..fd4300b24 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -247,12 +247,20 @@ void matrix_scale(objectmatrix *x, double scale); linalgError_t matrix_zero(objectmatrix *x); linalgError_t matrix_identity(objectmatrix *x); linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double beta, objectmatrix *z); +linalgError_t matrix_mul(objectmatrix *x, objectmatrix *y, objectmatrix *z); linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta); linalgError_t matrix_transpose(objectmatrix *x, objectmatrix *y); +double matrix_norm(objectmatrix *a, matrix_norm_t norm); +void matrix_sum(objectmatrix *a, double *sum); +linalgError_t matrix_trace(objectmatrix *a, double *out); + linalgError_t matrix_inner(objectmatrix *x, objectmatrix *y, double *out); +linalgError_t matrix_solvesmall(objectmatrix *a, objectmatrix *b); +linalgError_t matrix_solvelarge(objectmatrix *a, objectmatrix *b); linalgError_t matrix_solve(objectmatrix *a, objectmatrix *b); +linalgError_t matrix_inverse(objectmatrix *a); linalgError_t matrix_svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt); From 42f520e9eb2be9675378cebcba135c3cb9a91b9a Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:27:42 -0500 Subject: [PATCH 210/473] matrix_setcolumnptr and matrix_addtocolumnptr for integration --- src/geometry/functional.c | 34 +++++++++++++++++----------------- src/linalg/matrix.c | 23 +++++++++++++++++++++++ src/linalg/matrix.h | 10 ++++++++++ 3 files changed, 50 insertions(+), 17 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 782d9de58..0565fc248 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -158,8 +158,8 @@ bool functional_symmetrysumforces(objectmesh *mesh, objectmatrix *frc) { matrix_getcolumnptr(frc, j, &fj)) { for (unsigned int k=0; kdim; k++) fsum[k]=fi[k]+fj[k]; - matrix_setcolumn(frc, i, fsum); - matrix_setcolumn(frc, j, fsum); + matrix_setcolumnptr(frc, i, fsum); + matrix_setcolumnptr(frc, j, fsum); } } } @@ -1730,8 +1730,8 @@ bool length_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *v norm=functional_vecnorm(mesh->dim, s0); if (normdim==2) { functional_veccross2d(x[0], x[1], cx); @@ -1857,12 +1857,12 @@ bool area_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *vid functional_veccross(s01, s0, s010); functional_veccross(s01, s1, s011); - matrix_addtocolumn(frc, vid[0], 0.5/norm*scale, s011); - matrix_addtocolumn(frc, vid[2], 0.5/norm*scale, s010); + matrix_addtocolumnptr(frc, vid[0], 0.5/norm*scale, s011); + matrix_addtocolumnptr(frc, vid[2], 0.5/norm*scale, s010); functional_vecadd(mesh->dim, s010, s011, s0); - matrix_addtocolumn(frc, vid[1], -0.5/norm*scale, s0); + matrix_addtocolumnptr(frc, vid[1], -0.5/norm*scale, s0); return true; } @@ -1917,13 +1917,13 @@ bool volumeenclosed_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int dot/=fabs(dot); - matrix_addtocolumn(frc, vid[2], dot/6.0, cx); + matrix_addtocolumnptr(frc, vid[2], dot/6.0, cx); functional_veccross(x[1], x[2], cx); - matrix_addtocolumn(frc, vid[0], dot/6.0, cx); + matrix_addtocolumnptr(frc, vid[0], dot/6.0, cx); functional_veccross(x[2], x[0], cx); - matrix_addtocolumn(frc, vid[1], dot/6.0, cx); + matrix_addtocolumnptr(frc, vid[1], dot/6.0, cx); return true; } @@ -1977,16 +1977,16 @@ bool volume_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *v uu=functional_vecdot(mesh->dim, s10, cx); uu=(uu>0 ? 1.0 : -1.0); - matrix_addtocolumn(frc, vid[1], uu/6.0*scale, cx); + matrix_addtocolumnptr(frc, vid[1], uu/6.0*scale, cx); functional_veccross(s31, s21, cx); - matrix_addtocolumn(frc, vid[0], uu/6.0*scale, cx); + matrix_addtocolumnptr(frc, vid[0], uu/6.0*scale, cx); functional_veccross(s30, s10, cx); - matrix_addtocolumn(frc, vid[2], uu/6.0*scale, cx); + matrix_addtocolumnptr(frc, vid[2], uu/6.0*scale, cx); functional_veccross(s10, s20, cx); - matrix_addtocolumn(frc, vid[3], uu/6.0*scale, cx); + matrix_addtocolumnptr(frc, vid[3], uu/6.0*scale, cx); return true; } @@ -2059,7 +2059,7 @@ bool scalarpotential_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int objectmatrix *vf=MORPHO_GETMATRIX(ret); if (vf->nrows*vf->ncols==frc->nrows) { - return matrix_addtocolumn(frc, id, 1.0, vf->elements); + return matrix_addtocolumnptr(frc, id, 1.0, vf->elements); } } } diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index a069acd6e..0f78033c2 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -416,6 +416,27 @@ linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b return LINALGERR_OK; } +/** Copies the column vector b as a raw list of doubles into column col of matrix a */ +linalgError_t matrix_setcolumnptr(objectmatrix *a, MatrixIdx_t col, double *b) { + if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + + cblas_dcopy((__LAPACK_int) a->nrows*a->nvals, b, 1, a->elements+a->nvals*col*a->nrows, 1); + return LINALGERR_OK; +} + +/** @brief Add a vector to a column in a matrix + * @param[in] m - the matrix + * @param[in] col - column number + * @param[in] alpha - scale + * @param[out] v - column entries (matrix->nrows in number) [should have m->nrows entries] + * @returns true on success */ +linalgError_t matrix_addtocolumnptr(objectmatrix *a, MatrixIdx_t col, double alpha, double *b) { + if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + + cblas_daxpy(a->nrows*a->nvals, alpha, b, 1, a->elements+a->nvals*col*a->nrows, 1); + return LINALGERR_OK; +} + /** Counts the number of dofs in a matrix */ MatrixCount_t matrix_countdof(objectmatrix *a) { return a->ncols*a->nrows*a->nvals; @@ -1510,6 +1531,8 @@ void matrix_initialize(void) { morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_defineerror(MATRIX_CONSTRUCTOR, ERROR_HALT, MATRIX_CONSTRUCTOR_MSG); + complexmatrix_initialize(); } diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index fd4300b24..bd401acd9 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -227,6 +227,13 @@ IMPLEMENTATIONFN(Matrix_dimensions); #undef DECLARE_IMPLEMENTATIONFN +/* ------------------------------------------------------- + * Errors + * ------------------------------------------------------- */ + +#define MATRIX_CONSTRUCTOR "MtrxCns" +#define MATRIX_CONSTRUCTOR_MSG "Matrix() constructor should be called either with dimensions or an array, list, tuple or matrix initializer." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ @@ -270,6 +277,9 @@ linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); linalgError_t matrix_getcolumnptr(objectmatrix *matrix, MatrixIdx_t col, double **value); +linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b); +linalgError_t matrix_setcolumnptr(objectmatrix *a, MatrixIdx_t col, double *b); +linalgError_t matrix_addtocolumnptr(objectmatrix *a, MatrixIdx_t col, double alpha, double *b); void matrix_print(vm *v, objectmatrix *m); From 39af4d5eda6ad473e0427a6e708d173c534434a0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:22:06 -0500 Subject: [PATCH 211/473] Fix header files and replace matrix_setcolumn with matrix_setcolumnptr --- src/geometry/mesh.c | 2 +- src/linalg/linalg.h | 4 ---- src/linalg/matrix.h | 2 ++ 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 150174df3..22480e6e3 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -147,7 +147,7 @@ bool mesh_getvertexcoordinatesaslist(objectmesh *mesh, elementid id, double **ou /** Gets vertex coordinates */ bool mesh_setvertexcoordinates(objectmesh *mesh, elementid id, double *x) {; - return matrix_setcolumn(mesh->vert, id, x); + return matrix_setcolumnptr(mesh->vert, id, x); } /** Gets vertex coordinates as a value list */ diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index 18dd197b6..c7c47ae7e 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -8,9 +8,6 @@ #ifndef linalg_h #define linalg_h -#include -#include - /* ------------------------------------------------------- * objectmatrixerror type * ------------------------------------------------------- */ @@ -90,7 +87,6 @@ void linalg_raiseerror(vm *v, linalgError_t err); #include "matrix.h" #include "complexmatrix.h" - /* ------------------------------------------------------- * Initialization and finalization * ------------------------------------------------------- */ diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index bd401acd9..f0189b440 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -281,6 +281,8 @@ linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b linalgError_t matrix_setcolumnptr(objectmatrix *a, MatrixIdx_t col, double *b); linalgError_t matrix_addtocolumnptr(objectmatrix *a, MatrixIdx_t col, double alpha, double *b); +MatrixCount_t matrix_countdof(objectmatrix *a); + void matrix_print(vm *v, objectmatrix *m); #endif /* MORPHO_INCLUDE_LINALG */ From 0ffa0bb39f3be21ca8106a627691d4328a93da6c Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:35:38 -0500 Subject: [PATCH 212/473] Remove circular dependency in includes --- src/core/core.h | 6 ++++++ src/datastructures/program.h | 2 +- src/linalg/linalg.h | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core/core.h b/src/core/core.h index 54e0726dd..0a542ad27 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -10,7 +10,13 @@ #include #include +/** Forward declarations of key types */ +struct sprogram; +struct scompiler; + typedef struct svm vm; +typedef struct sprogram program; +typedef struct scompiler compiler; #include "error.h" #include "random.h" diff --git a/src/datastructures/program.h b/src/datastructures/program.h index 00a166442..0ee32b04d 100644 --- a/src/datastructures/program.h +++ b/src/datastructures/program.h @@ -44,7 +44,7 @@ DECLARE_VARRAY(globalinfo, globalinfo) * ------------------------------------------------------- */ /** @brief Morpho code program and associated data */ -typedef struct { +typedef struct sprogram { varray_instruction code; /** Compiled instructions */ varray_debugannotation annotations; /** Information about how the code connects to the source */ objectfunction *global; /** Pseudofunction containing global data */ diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index c7c47ae7e..bca26ed14 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -8,6 +8,8 @@ #ifndef linalg_h #define linalg_h +#include "morpho.h" + /* ------------------------------------------------------- * objectmatrixerror type * ------------------------------------------------------- */ @@ -93,4 +95,4 @@ void linalg_raiseerror(vm *v, linalgError_t err); void linalg_initialize(void); -#endif +#endif /* linalg_h */ From 1a9912a9841c76bd2c0ae65a1060493d8ec088d2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:38:58 -0500 Subject: [PATCH 213/473] Fix undefined error message --- src/linalg/linalg.c | 1 + src/linalg/linalg.h | 3 +++ src/linalg/matrix.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/linalg/linalg.c b/src/linalg/linalg.c index d3e72d6b8..97440203b 100644 --- a/src/linalg/linalg.c +++ b/src/linalg/linalg.c @@ -43,5 +43,6 @@ void linalg_initialize(void) { morpho_defineerror(LINALG_INVLDARGS, ERROR_HALT, LINALG_INVLDARGS_MSG); morpho_defineerror(LINALG_NNNMRCL_ARG, ERROR_HALT, LINALG_NNNMRCL_ARG_MSG); morpho_defineerror(LINALG_NORMARGS, ERROR_HALT, LINALG_NORMARGS_MSG); + morpho_defineerror(LINALG_ARITHARGS, ERROR_HALT, LINALG_ARITHARGS_MSG); } diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index bca26ed14..c6d2a6f7d 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -62,6 +62,9 @@ typedef enum { #define LINALG_NORMARGS "LnAlgMtrxNrmArgs" #define LINALG_NORMARGS_MSG "Method 'norm' requires a supported argument: 1 or inf." +#define LINALG_ARITHARGS "LnAlgInvldArg" +#define LINALG_ARITHARGS_MSG "Matrix arithmetic methods expect a matrix or number as their argument." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 0f78033c2..6d0e55119 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1077,7 +1077,7 @@ value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); double alpha=1.0; - if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, MATRIX_ARITHARGS); return MORPHO_NIL; } + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, LINALG_ARITHARGS); return MORPHO_NIL; } LINALG_ERRCHECKVM(matrix_axpy(alpha, b, a)); return MORPHO_NIL; From cff963e117708d86fefe02ee4b6d9fb334700e4a Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 20:50:48 -0500 Subject: [PATCH 214/473] Migrate some helper functions for sparse constructor functions --- src/classes/array.c | 4 +- src/linalg/sparse.c | 112 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 94 insertions(+), 22 deletions(-) diff --git a/src/classes/array.c b/src/classes/array.c index a1ef3c968..2459fcbd4 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -192,8 +192,8 @@ errorid array_error(objectarrayerror err) { /** Converts an array error into an matrix error code for use in slices*/ errorid array_to_matrix_error(objectarrayerror err) { #ifdef MORPHO_INCLUDE_LINALG - switch (err) { - case ARRAY_OUTOFBOUNDS: return MATRIX_INDICESOUTSIDEBOUNDS; + switch (err) { + case ARRAY_OUTOFBOUNDS: return LINALG_INDICESOUTSIDEBOUNDS; case ARRAY_WRONGDIM: return MATRIX_INVLDNUMINDICES; case ARRAY_NONINTINDX: return MATRIX_INVLDINDICES; case ARRAY_ALLOC_FAILED: return ERROR_ALLOCATIONFAILED; diff --git a/src/linalg/sparse.c b/src/linalg/sparse.c index 320d80f37..d73e580c7 100644 --- a/src/linalg/sparse.c +++ b/src/linalg/sparse.c @@ -687,6 +687,39 @@ bool sparse_checkupdatedimension(int check, int *dim) { return true; } +/** Recurses into an objectlist to find the dimensions of the array and all child arrays */ +static bool _getlistdimensions(objectlist *list, unsigned int dim[], unsigned int maxdim, unsigned int *ndim) { + unsigned int m=0; + + if (maxdim==0) return false; + + /* Store the length */ + if (list->val.count>dim[0]) dim[0]=list->val.count; + + for (unsigned int i=0; ival.count; i++) { + if (MORPHO_ISLIST(list->val.data[i]) && maxdim>0) { + _getlistdimensions(MORPHO_GETLIST(list->val.data[i]), dim+1, maxdim-1, &m); + } + } + *ndim=m+1; + + return true; +} + +/** Gets a matrix element from a (potentially nested) list. */ +static bool _getlistelement(objectlist *list, unsigned int ndim, unsigned int *indx, value *val) { + value out=MORPHO_NIL; + objectlist *l=list; + for (unsigned int i=0; ival.count) { + out=l->val.data[indx[i]]; + if (i0) icol+=ncols[j]; @@ -828,7 +861,7 @@ objectsparseerror sparse_catmatrix(objectlist *in, objectmatrix **out) { objectsparseerror err=sparse_docat(in, NULL, matrix_catcopyentry, &nrows, &ncols); if (err!=SPARSE_OK) goto sparse_catmatrix_error; - new = object_newmatrix(nrows, ncols, true); + new = matrix_new(nrows, ncols, true); err=sparse_docat(in, new, matrix_catcopyentry, NULL, NULL); if (err==SPARSE_OK) *out = new; @@ -844,11 +877,50 @@ objectsparseerror sparse_catmatrix(objectlist *in, objectmatrix **out) { * Construct sparse matrices * ******************************* */ +/** Recurses into an objectarray to find the dimensions of the array and all child arrays + * @param[in] array - to search + * @param[out] dim - array of dimensions to be filled out (must be zero'd before initial call) + * @param[in] maxdim - maximum number of dimensions + * @param[out] ndim - number of dimensions of the array */ +static bool _getarraydimensions(objectarray *array, unsigned int dim[], unsigned int maxdim, unsigned int *ndim) { + unsigned int n=0, m=0; + for (n=0; nndim; n++) { + int k=MORPHO_GETINTEGERVALUE(array->data[n]); + if (k>dim[n]) dim[n]=k; + } + + if (maxdimndim) return false; + + for (unsigned int i=array->ndim; indim+array->nelements; i++) { + if (MORPHO_ISARRAY(array->data[i])) { + if (!_getarraydimensions(MORPHO_GETARRAY(array->data[i]), dim+n, maxdim-n, &m)) return false; + } + } + *ndim=n+m; + + return true; +} + +/** Looks up an array element recursively if necessary */ +static value _getarrayelement(objectarray *array, unsigned int ndim, unsigned int *indx) { + unsigned int na=array->ndim; + value out; + + if (array_getelement(array, na, indx, &out)==ARRAY_OK) { + if (ndim==na) return out; + if (MORPHO_ISARRAY(out)) { + return _getarrayelement(MORPHO_GETARRAY(out), ndim-na, indx+na); + } + } + + return MORPHO_NIL; +} + /** Create a sparse array from an array */ objectsparse *object_sparsefromarray(objectarray *array) { unsigned int dim[2] = {0,0}, ndim; - if (!matrix_getarraydimensions(array, dim, 2, &ndim)) return NULL; + if (!_getarraydimensions(array, dim, 2, &ndim)) return NULL; objectsparse *new=object_newsparse(NULL, NULL); @@ -856,7 +928,7 @@ objectsparse *object_sparsefromarray(objectarray *array) { value v[3]={MORPHO_NIL, MORPHO_NIL, MORPHO_NIL}; for (unsigned int k=0; kdok, MORPHO_GETINTEGERVALUE(v[0]), MORPHO_GETINTEGERVALUE(v[1]), v[2]); @@ -875,7 +947,7 @@ objectsparseerror object_sparsefromlist(objectlist *list, objectsparse **out) { unsigned int dim[2] = {0,0}, ndim; objectsparseerror err=SPARSE_OK; - if (!matrix_getlistdimensions(list, dim, 2, &ndim)) return SPARSE_INVLDINIT; + if (!_getlistdimensions(list, dim, 2, &ndim)) return SPARSE_INVLDINIT; objectsparse *new=object_newsparse(NULL, NULL); @@ -889,7 +961,7 @@ objectsparseerror object_sparsefromlist(objectlist *list, objectsparse **out) { value v[3]={MORPHO_NIL, MORPHO_NIL, MORPHO_NIL}; for (unsigned int k=0; kdok, MORPHO_GETINTEGERVALUE(v[0]), MORPHO_GETINTEGERVALUE(v[1]), v[2]); @@ -920,11 +992,11 @@ objectsparseerror sparse_tomatrix(objectsparse *in, objectmatrix **out) { objectmatrix *new = NULL; if (sparse_checkformat(in, SPARSE_CCS, false, false)) { - new=object_newmatrix(in->ccs.nrows, in->ccs.ncols, true); + new=matrix_new(in->ccs.nrows, in->ccs.ncols, true); if (!new) return SPARSE_FAILED; if (sparseccs_copytomatrix(&in->ccs, new, 0, 0)) err=SPARSE_OK; } else if (sparse_checkformat(in, SPARSE_DOK, false, false)) { - new=object_newmatrix(in->dok.nrows, in->dok.ncols, true); + new=matrix_new(in->dok.nrows, in->dok.ncols, true); if (!new) return SPARSE_FAILED; if (sparsedok_copytomatrix(&in->dok, new, 0, 0)) err=SPARSE_OK; } @@ -1192,7 +1264,7 @@ size_t sparse_size(objectsparse *a) { void sparse_raiseerror(vm *v, objectsparseerror err) { switch(err) { case SPARSE_OK: break; - case SPARSE_INCMPTBLDIM: morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); break; + case SPARSE_INCMPTBLDIM: morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); break; case SPARSE_CONVFAILED: morpho_runtimeerror(v, SPARSE_CONVFAILEDERR); break; case SPARSE_FAILED: morpho_runtimeerror(v, SPARSE_OPFAILEDERR); break; case SPARSE_INVLDINIT: morpho_runtimeerror(v, SPARSE_INVLDARRAYINIT); break; @@ -1384,7 +1456,7 @@ value Sparse_mul(vm *v, int nargs, value *args) { if (sparse_checkformat(a, SPARSE_CCS, true, true)) { objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - objectmatrix *out=object_newmatrix(a->ccs.nrows, b->ncols, true); + objectmatrix *out=matrix_new(a->ccs.nrows, b->ncols, true); new = (objectsparse *) out; // Munge type to ensure binding/deallocation if (out) { @@ -1427,7 +1499,7 @@ value Sparse_mulr(vm *v, int nargs, value *args) { int ncols; sparse_getdimensions(b, NULL, &ncols); - objectmatrix *new=object_newmatrix(a->nrows, ncols, true); + objectmatrix *new=matrix_new(a->nrows, ncols, true); if (new) { err=sparse_muldxs(a, b, new); @@ -1460,7 +1532,7 @@ value Sparse_divr(vm *v, int nargs, value *args) { if (nargs==1 && MORPHO_ISMATRIX(MORPHO_GETARG(args, 0))) { objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - objectmatrix *new = object_newmatrix(b->nrows, b->ncols, false); + objectmatrix *new = matrix_new(b->nrows, b->ncols, false); if (new) { size_t asize=sparse_size(a); objectsparseerror err =sparse_div(a, b, new); @@ -1586,7 +1658,7 @@ value Sparse_getcolumn(vm *v, int nargs, value *args) { morpho_bindobjects(v, 1, &out); } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + } else morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); } else morpho_runtimeerror(v, MATRIX_SETCOLARGS); return out; @@ -1642,12 +1714,12 @@ value Sparse_setrowindices(vm *v, int nargs, value *args) { entries[i]=MORPHO_GETINTEGERVALUE(entry); } else { morpho_runtimeerror(v, MATRIX_INVLDINDICES); return MORPHO_NIL; } } - + if (!sparseccs_setrowindices(&s->ccs, col, nentries, entries)) { - morpho_runtimeerror(v, MATRIX_INCOMPATIBLEMATRICES); + morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); } - - } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + + } else morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); } } From e5564595d78bf140bf6afb9ac7fcf6a75066d3a4 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:03:08 -0500 Subject: [PATCH 215/473] Fix error messages and unmangle Method implementation names --- src/classes/array.c | 8 +++-- src/classes/array.h | 6 ++++ src/linalg/matrix.c | 78 ++++++++++++++++++++++----------------------- src/linalg/matrix.h | 36 ++++++++++----------- src/linalg/sparse.c | 10 +++--- 5 files changed, 73 insertions(+), 65 deletions(-) diff --git a/src/classes/array.c b/src/classes/array.c index 2459fcbd4..aefebc0f8 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -192,10 +192,10 @@ errorid array_error(objectarrayerror err) { /** Converts an array error into an matrix error code for use in slices*/ errorid array_to_matrix_error(objectarrayerror err) { #ifdef MORPHO_INCLUDE_LINALG - switch (err) { + switch (err) { case ARRAY_OUTOFBOUNDS: return LINALG_INDICESOUTSIDEBOUNDS; - case ARRAY_WRONGDIM: return MATRIX_INVLDNUMINDICES; - case ARRAY_NONINTINDX: return MATRIX_INVLDINDICES; + case ARRAY_WRONGDIM: return ARRAY_DIMENSION; + case ARRAY_NONINTINDX: return ARRAY_INVLDINDICES; case ARRAY_ALLOC_FAILED: return ERROR_ALLOCATIONFAILED; case ARRAY_OK: UNREACHABLE("array_to_matrix_error called incorrectly."); } @@ -630,4 +630,6 @@ void array_initialize(void) { morpho_defineerror(ARRAY_ARGS, ERROR_HALT, ARRAY_ARGS_MSG); morpho_defineerror(ARRAY_INIT, ERROR_HALT, ARRAY_INIT_MSG); morpho_defineerror(ARRAY_CMPT, ERROR_HALT, ARRAY_CMPT_MSG); + morpho_defineerror(ARRAY_DIMENSION, ERROR_HALT, ARRAY_DIMENSION_MSG); + morpho_defineerror(ARRAY_INVLDINDICES, ERROR_HALT, ARRAY_INVLDINDICES_MSG); } diff --git a/src/classes/array.h b/src/classes/array.h index e0b7f97ba..17eba9fec 100644 --- a/src/classes/array.h +++ b/src/classes/array.h @@ -65,6 +65,12 @@ objectarray *object_arrayfromvalueindices(unsigned int ndim, value *dim); #define ARRAY_CMPT "ArrayCmpt" #define ARRAY_CMPT_MSG "Array initializer is not compatible with the requested dimensions." +#define ARRAY_DIMENSION "ArrayDim" +#define ARRAY_DIMENSION_MSG "Wrong dimensions for Array." + +#define ARRAY_INVLDINDICES "ArrayIndx" +#define ARRAY_INVLDINDICES_MSG "Array requires integers as indices." + /* ------------------------------------------------------- * Array interface * ------------------------------------------------------- */ diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 6d0e55119..347906967 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -831,7 +831,7 @@ value Matrix_clone(vm *v, int nargs, value *args) { * index() * --------- */ -value Matrix_index_int_int(vm *v, int nargs, value *args) { +value Matrix_index__int_int(vm *v, int nargs, value *args) { objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -883,7 +883,7 @@ static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx return LINALGERR_OK; } -value Matrix_index_x_x(vm *v, int nargs, value *args) { +value Matrix_index__x_x(vm *v, int nargs, value *args) { objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)), *new=NULL; value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); value out=MORPHO_NIL; @@ -911,20 +911,20 @@ static void _setindex(vm *v, objectmatrix *m, MatrixIdx_t i, MatrixIdx_t j, valu if (elptr) LINALG_ERRCHECKVM(matrix_getinterface(m)->setelfn(v, in, elptr)); } -value Matrix_setindex_int_x(vm *v, int nargs, value *args) { +value Matrix_setindex__int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); return MORPHO_NIL; } -value Matrix_setindex_int_int_x(vm *v, int nargs, value *args) { +value Matrix_setindex__int_int_x(vm *v, int nargs, value *args) { MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); return MORPHO_NIL; } -value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { +value Matrix_setindex__x_x_matrix(vm *v, int nargs, value *args) { objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); objectmatrix *msrc = MORPHO_GETMATRIX(MORPHO_GETARG(args, 2)); value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); @@ -941,7 +941,7 @@ value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { * column * --------- */ -value Matrix_getcolumn_int(vm *v, int nargs, value *args) { +value Matrix_getcolumn__int(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); value out=MORPHO_NIL; @@ -955,7 +955,7 @@ value Matrix_getcolumn_int(vm *v, int nargs, value *args) { return out; } -value Matrix_setcolumn_int__matrix(vm *v, int nargs, value *args) { +value Matrix_setcolumn__int_matrix(vm *v, int nargs, value *args) { LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETMATRIX(MORPHO_SELF(args)), MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)))); @@ -1002,12 +1002,12 @@ value Matrix_add__matrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,1.0); } -value Matrix_add_nil(vm *v, int nargs, value *args) { +value Matrix_add__nil(vm *v, int nargs, value *args) { return MORPHO_SELF(args); } -value Matrix_add_x(vm *v, int nargs, value *args) { - if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to addr +value Matrix_add__x(vm *v, int nargs, value *args) { + if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to addr return _xpa(v,nargs,args,1.0,1.0); } @@ -1015,16 +1015,16 @@ value Matrix_sub__matrix(vm *v, int nargs, value *args) { return _axpy(v,nargs,args,-1.0); } -value Matrix_sub_x(vm *v, int nargs, value *args) { +value Matrix_sub__x(vm *v, int nargs, value *args) { if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr return _xpa(v,nargs,args,1.0,-1.0); } -value Matrix_subr_x(vm *v, int nargs, value *args) { +value Matrix_subr__x(vm *v, int nargs, value *args) { return _xpa(v,nargs,args,-1.0,1.0); } -value Matrix_mul_float(vm *v, int nargs, value *args) { +value Matrix_mul__float(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double scale; @@ -1048,7 +1048,7 @@ value Matrix_mul__matrix(vm *v, int nargs, value *args) { return out; } -value Matrix_div_float(vm *v, int nargs, value *args) { +value Matrix_div__float(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double scale; @@ -1072,7 +1072,7 @@ value Matrix_div__matrix(vm *v, int nargs, value *args) { } /** Accumulate in place */ -value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { +value Matrix_acc__x_x_matrix(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); @@ -1088,7 +1088,7 @@ value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { * ---------------- */ /** Matrix norm */ -value Matrix_norm_x(vm *v, int nargs, value *args) { +value Matrix_norm__x(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); double n; @@ -1412,7 +1412,7 @@ static value _roll(vm *v, objectmatrix *a, int roll, int axis) { } /** Roll a matrix */ -value Matrix_roll_int_int(vm *v, int nargs, value *args) { +value Matrix_roll__int_int(vm *v, int nargs, value *args) { objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), axis = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); @@ -1420,7 +1420,7 @@ value Matrix_roll_int_int(vm *v, int nargs, value *args) { } /** Roll a matrix by row */ -value Matrix_roll_int(vm *v, int nargs, value *args) { +value Matrix_roll__int(vm *v, int nargs, value *args) { objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); return _roll(v, a, roll, 0); @@ -1465,30 +1465,30 @@ MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(Matrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index_int_int, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index_x_x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index__int_int, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index__x_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Matrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (Matrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (Matrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc__x_x_matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "Matrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm__x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", Matrix_sum, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_PUREFN), @@ -1500,8 +1500,8 @@ MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensyste MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index f0189b440..2644e3270 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -189,28 +189,28 @@ IMPLEMENTATIONFN(Matrix_format); IMPLEMENTATIONFN(Matrix_assign); IMPLEMENTATIONFN(Matrix_clone); -IMPLEMENTATIONFN(Matrix_index_int); -IMPLEMENTATIONFN(Matrix_index_int_int); -IMPLEMENTATIONFN(Matrix_index_x_x); -IMPLEMENTATIONFN(Matrix_setindex_int_x); -IMPLEMENTATIONFN(Matrix_setindex_int_int_x); -IMPLEMENTATIONFN(Matrix_setindex_x_x__matrix); +IMPLEMENTATIONFN(Matrix_index__int); +IMPLEMENTATIONFN(Matrix_index__int_int); +IMPLEMENTATIONFN(Matrix_index__x_x); +IMPLEMENTATIONFN(Matrix_setindex__int_x); +IMPLEMENTATIONFN(Matrix_setindex__int_int_x); +IMPLEMENTATIONFN(Matrix_setindex__x_x_matrix); -IMPLEMENTATIONFN(Matrix_getcolumn_int); -IMPLEMENTATIONFN(Matrix_setcolumn_int__matrix); +IMPLEMENTATIONFN(Matrix_getcolumn__int); +IMPLEMENTATIONFN(Matrix_setcolumn__int__matrix); IMPLEMENTATIONFN(Matrix_add__matrix); -IMPLEMENTATIONFN(Matrix_add_nil); -IMPLEMENTATIONFN(Matrix_add_x); +IMPLEMENTATIONFN(Matrix_add__nil); +IMPLEMENTATIONFN(Matrix_add__x); IMPLEMENTATIONFN(Matrix_sub__matrix); -IMPLEMENTATIONFN(Matrix_sub_x); -IMPLEMENTATIONFN(Matrix_subr_x); -IMPLEMENTATIONFN(Matrix_mul_float); -IMPLEMENTATIONFN(Matrix_div_float); +IMPLEMENTATIONFN(Matrix_sub__x); +IMPLEMENTATIONFN(Matrix_subr__x); +IMPLEMENTATIONFN(Matrix_mul__float); +IMPLEMENTATIONFN(Matrix_div__float); IMPLEMENTATIONFN(Matrix_div__matrix); -IMPLEMENTATIONFN(Matrix_acc_x_x__matrix); +IMPLEMENTATIONFN(Matrix_acc__x_x_matrix); -IMPLEMENTATIONFN(Matrix_norm_x); +IMPLEMENTATIONFN(Matrix_norm__x); IMPLEMENTATIONFN(Matrix_norm); IMPLEMENTATIONFN(Matrix_sum); IMPLEMENTATIONFN(Matrix_transpose); @@ -219,8 +219,8 @@ IMPLEMENTATIONFN(Matrix_eigensystem); IMPLEMENTATIONFN(Matrix_svd); IMPLEMENTATIONFN(Matrix_qr); IMPLEMENTATIONFN(Matrix_reshape); -IMPLEMENTATIONFN(Matrix_roll_int); -IMPLEMENTATIONFN(Matrix_roll_int_int); +IMPLEMENTATIONFN(Matrix_roll__int); +IMPLEMENTATIONFN(Matrix_roll__int_int); IMPLEMENTATIONFN(Matrix_enumerate); IMPLEMENTATIONFN(Matrix_count); IMPLEMENTATIONFN(Matrix_dimensions); diff --git a/src/linalg/sparse.c b/src/linalg/sparse.c index d73e580c7..0157363e1 100644 --- a/src/linalg/sparse.c +++ b/src/linalg/sparse.c @@ -1319,7 +1319,7 @@ value Sparse_getindex(vm *v, int nargs, value *args) { if (array_valuelisttoindices(nargs, args+1, indx)) { sparse_getelement(s, indx[0], indx[1], &out); - } else morpho_runtimeerror(v, MATRIX_INVLDINDICES); + } else morpho_runtimeerror(v, LINALG_INVLDARGS); return out; } @@ -1338,7 +1338,7 @@ value Sparse_setindex(vm *v, int nargs, value *args) { if (osize!=nsize) { morpho_resizeobject(v, (object *) s, osize, nsize); } - } else morpho_runtimeerror(v, MATRIX_INVLDINDICES); + } else morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } @@ -1659,7 +1659,7 @@ value Sparse_getcolumn(vm *v, int nargs, value *args) { } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); } else morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); - } else morpho_runtimeerror(v, MATRIX_SETCOLARGS); + } else morpho_runtimeerror(v, LINALG_INVLDARGS); return out; } @@ -1684,7 +1684,7 @@ value Sparse_rowindices(vm *v, int nargs, value *args) { morpho_bindobjects(v, 1, &out); } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); } - } else morpho_runtimeerror(v, MATRIX_INDICESOUTSIDEBOUNDS); + } else morpho_runtimeerror(v, LINALG_INDICESOUTSIDEBOUNDS); } } @@ -1712,7 +1712,7 @@ value Sparse_setrowindices(vm *v, int nargs, value *args) { if (list_getelement(list, i, &entry) && MORPHO_ISINTEGER(entry)) { entries[i]=MORPHO_GETINTEGERVALUE(entry); - } else { morpho_runtimeerror(v, MATRIX_INVLDINDICES); return MORPHO_NIL; } + } else { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } } if (!sparseccs_setrowindices(&s->ccs, col, nentries, entries)) { From b3d0b799943cff1be718df8afa4bf52f93a8ec99 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:05:28 -0500 Subject: [PATCH 216/473] Unmangle function names --- src/linalg/complexmatrix.c | 42 +++++++++++++++++++------------------- src/linalg/matrix.h | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 6ed3f41ab..84ecb4fb9 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -564,40 +564,40 @@ MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index_int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index_x_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index__int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index__x_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div__float, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc__x_x_matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm__x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), @@ -613,8 +613,8 @@ MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensyste MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int)", Matrix_roll__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", Matrix_roll__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 2644e3270..510b610cd 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -197,7 +197,7 @@ IMPLEMENTATIONFN(Matrix_setindex__int_int_x); IMPLEMENTATIONFN(Matrix_setindex__x_x_matrix); IMPLEMENTATIONFN(Matrix_getcolumn__int); -IMPLEMENTATIONFN(Matrix_setcolumn__int__matrix); +IMPLEMENTATIONFN(Matrix_setcolumn__int_matrix); IMPLEMENTATIONFN(Matrix_add__matrix); IMPLEMENTATIONFN(Matrix_add__nil); From 0edffda9f98d36ad2f0b3ae4ef82fcd41b831441 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:16:18 -0500 Subject: [PATCH 217/473] matrix_copyat --- src/linalg/matrix.c | 15 +++++++++++++++ src/linalg/matrix.h | 1 + 2 files changed, 16 insertions(+) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 347906967..a67cbcdc9 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -462,6 +462,21 @@ linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y) { return LINALGERR_OK; } +/** Copies one matrix into another at an arbitrary point */ +linalgError_t matrix_copyat(objectmatrix *a, objectmatrix *out, int row0, int col0) { + if (!(col0+a->ncols<=out->ncols && row0+a->nrows<=out->nrows)) return LINALGERR_INCOMPATIBLE_DIM; + + for (int j=0; jncols; j++) { + for (int i=0; inrows; i++) { + double *src, *dest; + LINALG_ERRCHECKRETURN(matrix_getelementptr(a, i, j, &src)); + LINALG_ERRCHECKRETURN(matrix_getelementptr(out, row0+i, col0+j, &dest)); + memcpy(dest, src, sizeof(double)*a->nvals); + } + } + return LINALGERR_OK; +} + /** Scales a matrix x <- scale * x >*/ void matrix_scale(objectmatrix *x, double scale) { cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 510b610cd..65ebc1b0e 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -250,6 +250,7 @@ MatrixCount_t matrix_countdof(objectmatrix *a); linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y); linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y); +linalgError_t matrix_copyat(objectmatrix *a, objectmatrix *out, int row0, int col0); void matrix_scale(objectmatrix *x, double scale); linalgError_t matrix_zero(objectmatrix *x); linalgError_t matrix_identity(objectmatrix *x); From e1b76fa4f696addab719cb2444ceb00ee4faa435 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:21:13 -0500 Subject: [PATCH 218/473] Fix duplicate error --- src/classes/array.c | 2 +- src/classes/array.h | 2 +- src/core/vm.c | 1 - src/datastructures/error.h | 3 --- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/classes/array.c b/src/classes/array.c index aefebc0f8..da098e779 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -180,7 +180,7 @@ void array_print(vm *v, objectarray *a) { errorid array_error(objectarrayerror err) { switch (err) { case ARRAY_OUTOFBOUNDS: return VM_OUTOFBOUNDS; - case ARRAY_WRONGDIM: return VM_ARRAYWRONGDIM; + case ARRAY_WRONGDIM: return ARRAY_DIMENSION; case ARRAY_NONINTINDX: return VM_NONNUMINDX; case ARRAY_ALLOC_FAILED: return ERROR_ALLOCATIONFAILED; case ARRAY_OK: UNREACHABLE("array_error called incorrectly."); diff --git a/src/classes/array.h b/src/classes/array.h index 17eba9fec..2f5fa9507 100644 --- a/src/classes/array.h +++ b/src/classes/array.h @@ -66,7 +66,7 @@ objectarray *object_arrayfromvalueindices(unsigned int ndim, value *dim); #define ARRAY_CMPT_MSG "Array initializer is not compatible with the requested dimensions." #define ARRAY_DIMENSION "ArrayDim" -#define ARRAY_DIMENSION_MSG "Wrong dimensions for Array." +#define ARRAY_DIMENSION_MSG "Incorrect number of dimensions for Array." #define ARRAY_INVLDINDICES "ArrayIndx" #define ARRAY_INVLDINDICES_MSG "Array requires integers as indices." diff --git a/src/core/vm.c b/src/core/vm.c index d15d89c63..1269a971a 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -2205,7 +2205,6 @@ void morpho_initialize(void) { morpho_defineerror(VM_NOTINDEXABLE, ERROR_HALT, VM_NOTINDEXABLE_MSG); morpho_defineerror(VM_OUTOFBOUNDS, ERROR_HALT, VM_OUTOFBOUNDS_MSG); morpho_defineerror(VM_NONNUMINDX, ERROR_HALT, VM_NONNUMINDX_MSG); - morpho_defineerror(VM_ARRAYWRONGDIM, ERROR_HALT, VM_ARRAYWRONGDIM_MSG); morpho_defineerror(VM_DVZR, ERROR_HALT, VM_DVZR_MSG); morpho_defineerror(VM_GETINDEXARGS, ERROR_HALT, VM_GETINDEXARGS_MSG); morpho_defineerror(VM_MLTPLDSPTCHFLD, ERROR_HALT, VM_MLTPLDSPTCHFLD_MSG); diff --git a/src/datastructures/error.h b/src/datastructures/error.h index 97f0e655e..05274a9dd 100644 --- a/src/datastructures/error.h +++ b/src/datastructures/error.h @@ -182,9 +182,6 @@ void morpho_unreachable(const char *explanation); #define VM_NONNUMINDX "NonNmIndx" #define VM_NONNUMINDX_MSG "Non-numerical array index." -#define VM_ARRAYWRONGDIM "ArrayDim" -#define VM_ARRAYWRONGDIM_MSG "Incorrect number of dimensions for array." - #define VM_DBGQUIT "DbgQuit" #define VM_DBGQUIT_MSG "Program terminated by user in debugger." From 2c491f9bcd48e353a1c836133884bc2b8b480f09 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:29:32 -0500 Subject: [PATCH 219/473] Fix uses of setcolumn in mesh.c --- src/geometry/mesh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 22480e6e3..98a075a88 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -1123,10 +1123,10 @@ value Mesh_vertexposition(vm *v, int nargs, value *args) { unsigned int id=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); double *vals; - if (matrix_getcolumnptr(m->vert, id, &vals)) { + if (matrix_getcolumnptr(m->vert, id, &vals)==LINALGERR_OK) { objectmatrix *new=matrix_new(m->dim, 1, true); if (new) { - matrix_setcolumn(new, 0, vals); + matrix_setcolumnptr(new, 0, vals); out=MORPHO_OBJECT(new); morpho_bindobjects(v, 1, &out); } @@ -1145,7 +1145,7 @@ value Mesh_setvertexposition(vm *v, int nargs, value *args) { unsigned int id=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); objectmatrix *mat = MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); - if (!matrix_setcolumn(m->vert, id, mat->elements)) morpho_runtimeerror(v, MESH_INVLDID); + if (matrix_setcolumnptr(m->vert, id, mat->elements)!=LINALGERR_OK) morpho_runtimeerror(v, MESH_INVLDID); } else morpho_runtimeerror(v, MESH_STVRTPSNARGS); return MORPHO_NIL; From 3fdb421dc60f6b5ca5543b17f9cce5dd3f7db4e4 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 21:52:44 -0500 Subject: [PATCH 220/473] Fixes for test suite --- src/linalg/matrix.c | 1 + test/matrix/Lnorm.morpho | 4 ---- test/matrix/assign.morpho | 2 +- test/matrix/dimensions.morpho | 4 ++-- test/matrix/eigensystem.morpho | 5 +++-- test/matrix/incompatible_add.morpho | 2 +- test/matrix/incompatible_mul.morpho | 2 +- test/matrix/incompatible_sub.morpho | 2 +- test/matrix/inverse.morpho | 2 +- test/matrix/linearsolve.morpho | 2 +- test/matrix/nonnum_indices.morpho | 2 +- test/matrix/reshape.morpho | 2 +- test/matrix/trace.morpho | 2 +- test/mesh/out.mesh | 8 ++++---- 14 files changed, 19 insertions(+), 21 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index a67cbcdc9..c796c37c7 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -805,6 +805,7 @@ value matrix_identityconstructor(vm *v, int nargs, value *args) { /** Prints a matrix */ value Matrix_print(vm *v, int nargs, value *args) { + if (!MORPHO_ISMATRIX(MORPHO_SELF(args))) return Object_print(v, nargs, args); objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); matrix_print(v, m); return MORPHO_NIL; diff --git a/test/matrix/Lnorm.morpho b/test/matrix/Lnorm.morpho index e3fb763bd..ac6e70948 100644 --- a/test/matrix/Lnorm.morpho +++ b/test/matrix/Lnorm.morpho @@ -5,9 +5,5 @@ var a = Matrix([1,2,3]) print a.norm(1) // expect: 6 -print abs(a.norm(2) - 3.74166) < 1e-4 // expect: true - -print abs(a.norm(3) - 3.30193) < 1e-4 // expect: true - print a.norm(Inf) // expect: 3 diff --git a/test/matrix/assign.morpho b/test/matrix/assign.morpho index 68aa43f97..c18d55f55 100644 --- a/test/matrix/assign.morpho +++ b/test/matrix/assign.morpho @@ -14,4 +14,4 @@ print b var c = Matrix(1,2) b.assign(c) -// expect error 'MtrxIncmptbl' +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/matrix/dimensions.morpho b/test/matrix/dimensions.morpho index 2ef712128..2fe92517e 100644 --- a/test/matrix/dimensions.morpho +++ b/test/matrix/dimensions.morpho @@ -4,7 +4,7 @@ var a = Matrix([[0.8, -0.4], [0.4, 0.8]]) var v = Matrix([0.2, 0.3]) print a.dimensions() -// expect: [ 2, 2 ] +// expect: (2, 2) print v.dimensions() -// expect: [ 2, 1 ] +// expect: (2, 1) diff --git a/test/matrix/eigensystem.morpho b/test/matrix/eigensystem.morpho index 17e1e55b7..351eece30 100644 --- a/test/matrix/eigensystem.morpho +++ b/test/matrix/eigensystem.morpho @@ -4,5 +4,6 @@ var a = Matrix([[ -0.083929, 0.102945, 0.213477 ], [ 0.102945, -0.108697, 0.189335 ], [ 0.213477, 0.189335, 0.192626 ]]) -print a.eigensystem() -// expect: [ , ] \ No newline at end of file +var b = a.eigensystem() +print b[0].clss() // expect: @Tuple +print b[1].clss() // expect: @Matrix diff --git a/test/matrix/incompatible_add.morpho b/test/matrix/incompatible_add.morpho index 0045a01ea..650250b31 100644 --- a/test/matrix/incompatible_add.morpho +++ b/test/matrix/incompatible_add.morpho @@ -4,4 +4,4 @@ var a = Matrix([[1, 2, 1], [3, 4, 1]]) var b = Matrix([[0, 1], [1, 0]]) print a+b -// expect Error: 'MtrxIncmptbl' +// expect Error: 'LnAlgMtrxIncmptbl' diff --git a/test/matrix/incompatible_mul.morpho b/test/matrix/incompatible_mul.morpho index 769698df1..dc681121b 100644 --- a/test/matrix/incompatible_mul.morpho +++ b/test/matrix/incompatible_mul.morpho @@ -4,4 +4,4 @@ var a = Matrix([[1, 2, 1], [3, 4, 1]]) var b = Matrix([[0, 1], [1, 0]]) print a*b -// expect Error: 'MtrxIncmptbl' +// expect Error: 'LnAlgMtrxIncmptbl' diff --git a/test/matrix/incompatible_sub.morpho b/test/matrix/incompatible_sub.morpho index d056a9614..751af5d67 100644 --- a/test/matrix/incompatible_sub.morpho +++ b/test/matrix/incompatible_sub.morpho @@ -4,4 +4,4 @@ var a = Matrix([[1, 2, 1], [3, 4, 1]]) var b = Matrix([[0, 1], [1, 0]]) print a*b -// expect Error: 'MtrxIncmptbl' +// expect Error: 'LnAlgMtrxIncmptbl' diff --git a/test/matrix/inverse.morpho b/test/matrix/inverse.morpho index 628acad30..de8879e16 100644 --- a/test/matrix/inverse.morpho +++ b/test/matrix/inverse.morpho @@ -15,4 +15,4 @@ print ((mi[1,1] - a/det)<1e-8) // expect: true var m = Matrix([[1,0,0],[0,1,0],[0,0,0]]) -print m.inverse() // expect error 'MtrxSnglr' +print m.inverse() // expect error 'LnAlgMtrxSnglr' diff --git a/test/matrix/linearsolve.morpho b/test/matrix/linearsolve.morpho index f22e45d09..4f27656c0 100644 --- a/test/matrix/linearsolve.morpho +++ b/test/matrix/linearsolve.morpho @@ -21,4 +21,4 @@ print a var b = Matrix([[3, 4], [6, 8]]) print v/b -// expect error 'MtrxSnglr' +// expect error 'LnAlgMtrxSnglr' diff --git a/test/matrix/nonnum_indices.morpho b/test/matrix/nonnum_indices.morpho index 4ef542786..7f1b7d10a 100644 --- a/test/matrix/nonnum_indices.morpho +++ b/test/matrix/nonnum_indices.morpho @@ -3,4 +3,4 @@ var a = Matrix([[1,2], [3,4], [5,6]]) print a["Hello", "Squirrel"] -// expect error: 'MtrxInvldIndx' +// expect error: 'LnAlgMtrxNnNmrclArg' diff --git a/test/matrix/reshape.morpho b/test/matrix/reshape.morpho index 12adcf5ee..e3470ce7c 100644 --- a/test/matrix/reshape.morpho +++ b/test/matrix/reshape.morpho @@ -31,4 +31,4 @@ print a // expect: [ 3 6 ] a.reshape(3,3) -// expect error 'MtrxIncmptbl' +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/matrix/trace.morpho b/test/matrix/trace.morpho index cca52b46e..481654129 100644 --- a/test/matrix/trace.morpho +++ b/test/matrix/trace.morpho @@ -7,4 +7,4 @@ print a.trace() var b = Matrix([[1, 2]]) print b.trace() -// expect error 'MtrxNtSq' +// expect error 'LnAlgMtrxNtSq' diff --git a/test/mesh/out.mesh b/test/mesh/out.mesh index ccbfb48f1..40cfae01f 100644 --- a/test/mesh/out.mesh +++ b/test/mesh/out.mesh @@ -1,9 +1,9 @@ vertices -1 0 0 0 -2 1 0 0 -3 0 1 0 -4 1 1 0 +1 +2 +3 +4 faces From cec3db29a50d626503dda9d658b6ca4addb6a22e Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:03:03 -0500 Subject: [PATCH 221/473] Fix error labels --- test/matrix/get_column.morpho | 2 +- test/sparse/set_row_indices.morpho | 2 +- test/types/multiple_dispatch/namespace_for_new.morpho | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/matrix/get_column.morpho b/test/matrix/get_column.morpho index 94ba03145..d8d666210 100644 --- a/test/matrix/get_column.morpho +++ b/test/matrix/get_column.morpho @@ -17,4 +17,4 @@ print a.column(2) // expect: [ 12 ] print a.column(10) -// expect Error 'MtrxBnds' +// expect Error 'LnAlgMtrxIndxBnds' diff --git a/test/sparse/set_row_indices.morpho b/test/sparse/set_row_indices.morpho index e26e15b18..6284a3af0 100644 --- a/test/sparse/set_row_indices.morpho +++ b/test/sparse/set_row_indices.morpho @@ -20,4 +20,4 @@ print a // expect: [ 1 -1 0 0 ] a.setrowindices(3, [1,1]) -// expect error 'MtrxIncmptbl' +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/types/multiple_dispatch/namespace_for_new.morpho b/test/types/multiple_dispatch/namespace_for_new.morpho index 672f6e36a..f32fe3c43 100644 --- a/test/types/multiple_dispatch/namespace_for_new.morpho +++ b/test/types/multiple_dispatch/namespace_for_new.morpho @@ -6,8 +6,7 @@ import "namespace.xmorpho" for f fn f(Matrix a) { print a.dimensions() - } f(Matrix(2,2)) -// expect: [ 2, 2 ] +// expect: (2, 2) From 5455866b4f36f01ef617f7eae2d6a4266e01b9e3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:15:49 -0500 Subject: [PATCH 222/473] Delete unused errors --- src/classes/array.c | 2 +- src/classes/clss.c | 1 - src/classes/clss.h | 3 --- src/core/compile.c | 1 - src/core/compile.h | 3 --- src/core/vm.c | 1 - src/datastructures/error.h | 3 --- src/support/parse.c | 2 +- 8 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/classes/array.c b/src/classes/array.c index da098e779..832b7ad8c 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -457,7 +457,7 @@ value array_constructor(vm *v, int nargs, value *args) { new = array_constructfromlist(ndim, dim, MORPHO_GETLIST(initializer)); if (!new) morpho_runtimeerror(v, ARRAY_CMPT); } else { - morpho_runtimeerror(v, ARRAY_ARGS); + morpho_runtimeerror(v, ARRAY_INIT); } // Bind the new array to the VM diff --git a/src/classes/clss.c b/src/classes/clss.c index 5665617c3..1eeea8437 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -196,5 +196,4 @@ void class_initialize(void) { // No constructor function; classes are generated by the compiler // Class error messages - morpho_defineerror(CLASS_INVK, ERROR_HALT, CLASS_INVK_MSG); } diff --git a/src/classes/clss.h b/src/classes/clss.h index 6b7b1a267..2d61f2715 100644 --- a/src/classes/clss.h +++ b/src/classes/clss.h @@ -46,9 +46,6 @@ typedef struct sobjectclass { * Class error messages * ------------------------------------------------------- */ -#define CLASS_INVK "ClssInvk" -#define CLASS_INVK_MSG "Cannot invoke method '%s' on a class." - /* ------------------------------------------------------- * Class interface * ------------------------------------------------------- */ diff --git a/src/core/compile.c b/src/core/compile.c index 3c5ef4564..e4b0cbd0c 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -4990,7 +4990,6 @@ void compile_initialize(void) { morpho_defineerror(COMPILE_CLASSINHERITSELF, ERROR_COMPILE, COMPILE_CLASSINHERITSELF_MSG); morpho_defineerror(COMPILE_TOOMANYARGS, ERROR_COMPILE, COMPILE_TOOMANYARGS_MSG); morpho_defineerror(COMPILE_TOOMANYPARAMS, ERROR_COMPILE, COMPILE_TOOMANYPARAMS_MSG); - morpho_defineerror(COMPILE_ISOLATEDSUPER, ERROR_COMPILE, COMPILE_ISOLATEDSUPER_MSG); morpho_defineerror(COMPILE_VARALREADYDECLARED, ERROR_COMPILE, COMPILE_VARALREADYDECLARED_MSG); morpho_defineerror(COMPILE_FILENOTFOUND, ERROR_COMPILE, COMPILE_FILENOTFOUND_MSG); morpho_defineerror(COMPILE_MODULENOTFOUND, ERROR_COMPILE, COMPILE_MODULENOTFOUND_MSG); diff --git a/src/core/compile.h b/src/core/compile.h index a42781b81..ad945ddb3 100644 --- a/src/core/compile.h +++ b/src/core/compile.h @@ -60,9 +60,6 @@ #define COMPILE_TOOMANYPARAMS "TooMnyPrm" #define COMPILE_TOOMANYPARAMS_MSG "Too many parameters." -#define COMPILE_ISOLATEDSUPER "IsoSpr" -#define COMPILE_ISOLATEDSUPER_MSG "Expect '.' after 'super'." - #define COMPILE_VARALREADYDECLARED "VblDcl" #define COMPILE_VARALREADYDECLARED_MSG "Variable with this name already declared in this scope." diff --git a/src/core/vm.c b/src/core/vm.c index 1269a971a..508e98269 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -2183,7 +2183,6 @@ void morpho_initialize(void) { #endif morpho_defineerror(ERROR_ALLOCATIONFAILED, ERROR_EXIT, ERROR_ALLOCATIONFAILED_MSG); - morpho_defineerror(ERROR_INTERNALERROR, ERROR_EXIT, ERROR_INTERNALERROR_MSG); morpho_defineerror(ERROR_ERROR, ERROR_HALT, ERROR_ERROR_MSG); morpho_defineerror(VM_STCKOVFLW, ERROR_HALT, VM_STCKOVFLW_MSG); diff --git a/src/datastructures/error.h b/src/datastructures/error.h index 05274a9dd..863c6fa3a 100644 --- a/src/datastructures/error.h +++ b/src/datastructures/error.h @@ -112,9 +112,6 @@ void morpho_unreachable(const char *explanation); #define ERROR_ALLOCATIONFAILED "Alloc" #define ERROR_ALLOCATIONFAILED_MSG "Memory allocation failed." -#define ERROR_INTERNALERROR "Intrnl" -#define ERROR_INTERNALERROR_MSG "Internal error (contact developer)." - #define ERROR_ERROR "Err" #define ERROR_ERROR_MSG "Error." diff --git a/src/support/parse.c b/src/support/parse.c index 230ce8918..f2b2d4432 100644 --- a/src/support/parse.c +++ b/src/support/parse.c @@ -479,7 +479,7 @@ bool parse_arglist(parser *p, tokentype rightdelimiter, unsigned int *nargs, voi return true; } -/** Parses a variable name, or raises and error if a symbol isn't found */ +/** Parses a variable name, or raises an error if a symbol isn't found */ bool parse_variable(parser *p, errorid id, void *out) { PARSE_CHECK(parse_checkrequiredtoken(p, TOKEN_SYMBOL, id)); return parse_symbol(p, out); From a0e657eb7ecdf5e20bc9d59f3139f69feea9d941 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:26:48 -0500 Subject: [PATCH 223/473] Remove unused errors --- src/builtin/functiondefs.c | 3 +-- src/builtin/functiondefs.h | 3 --- src/classes/invocation.c | 1 - src/classes/invocation.h | 3 --- src/core/compile.c | 2 +- src/core/vm.c | 1 - src/datastructures/error.h | 3 --- src/support/parse.c | 2 +- 8 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 4b03e9d8e..4285b4c92 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -324,7 +324,7 @@ value builtin_arctan(vm *v, int nargs, value *args) { morpho_runtimeerror(v, MATH_NUMARGS, "arctan"); return MORPHO_NIL; - } + } } /** Remainder */ @@ -747,7 +747,6 @@ void functiondefs_initialize(void) { /* Define errors */ morpho_defineerror(MATH_ARGS, ERROR_HALT, MATH_ARGS_MSG); morpho_defineerror(MATH_NUMARGS, ERROR_HALT, MATH_NUMARGS_MSG); - morpho_defineerror(MATH_ATANARGS, ERROR_HALT, MATH_ATANARGS_MSG); morpho_defineerror(TYPE_NUMARGS, ERROR_HALT, TYPE_NUMARGS_MSG); morpho_defineerror(MAX_ARGS, ERROR_HALT, MAX_ARGS_MSG); morpho_defineerror(APPLY_ARGS, ERROR_HALT, APPLY_ARGS_MSG); diff --git a/src/builtin/functiondefs.h b/src/builtin/functiondefs.h index df4c660ec..5946b8ae9 100644 --- a/src/builtin/functiondefs.h +++ b/src/builtin/functiondefs.h @@ -52,9 +52,6 @@ #define MATH_NUMARGS "ExpctArgNm" #define MATH_NUMARGS_MSG "Function '%s' expects a single numerical argument." -#define MATH_ATANARGS "AtanArgNm" -#define MATH_ATANARGS_MSG "Function 'arctan' expects either 1 or 2 numerical arguments." - #define TYPE_NUMARGS "TypArgNm" #define TYPE_NUMARGS_MSG "Function '%s' expects one argument." diff --git a/src/classes/invocation.c b/src/classes/invocation.c index a39ad6ed2..204adc567 100644 --- a/src/classes/invocation.c +++ b/src/classes/invocation.c @@ -156,5 +156,4 @@ void invocation_initialize(void) { // Invocation error messages morpho_defineerror(INVOCATION_ARGS, ERROR_HALT, INVOCATION_ARGS_MSG); - morpho_defineerror(INVOCATION_METHOD, ERROR_HALT, INVOCATION_METHOD_MSG); } diff --git a/src/classes/invocation.h b/src/classes/invocation.h index 6f2b6aa8c..9f11184a0 100644 --- a/src/classes/invocation.h +++ b/src/classes/invocation.h @@ -52,9 +52,6 @@ objectinvocation *object_newinvocation(value receiver, value method); #define INVOCATION_ARGS "InvocationArgs" #define INVOCATION_ARGS_MSG "Invocation must be called with an object and a method name as arguments." -#define INVOCATION_METHOD "InvocationMethod" -#define INVOCATION_METHOD_MSG "Method not found." - /* ------------------------------------------------------- * Invocation interface * ------------------------------------------------------- */ diff --git a/src/core/compile.c b/src/core/compile.c index e4b0cbd0c..55aa56497 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3380,7 +3380,7 @@ bool _extracttype(compiler *c, syntaxtreenode *node, value *out) { } if (!compiler_findclasswithnamespace(c, typenode, nsnode->content, labelnode->content, &type)) { - compiler_error(c, typenode, COMPILE_SYMBOLNOTDEFINEDNMSPC, MORPHO_GETCSTRING(nsnode->content), MORPHO_GETCSTRING(labelnode->content)); + compiler_error(c, typenode, COMPILE_UNKNWNTYPENMSPC, MORPHO_GETCSTRING(labelnode->content), MORPHO_GETCSTRING(nsnode->content)); return false; } diff --git a/src/core/vm.c b/src/core/vm.c index 508e98269..60b98a419 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -2205,7 +2205,6 @@ void morpho_initialize(void) { morpho_defineerror(VM_OUTOFBOUNDS, ERROR_HALT, VM_OUTOFBOUNDS_MSG); morpho_defineerror(VM_NONNUMINDX, ERROR_HALT, VM_NONNUMINDX_MSG); morpho_defineerror(VM_DVZR, ERROR_HALT, VM_DVZR_MSG); - morpho_defineerror(VM_GETINDEXARGS, ERROR_HALT, VM_GETINDEXARGS_MSG); morpho_defineerror(VM_MLTPLDSPTCHFLD, ERROR_HALT, VM_MLTPLDSPTCHFLD_MSG); morpho_defineerror(VM_TYPECHK, ERROR_HALT, VM_TYPECHK_MSG); diff --git a/src/datastructures/error.h b/src/datastructures/error.h index 863c6fa3a..085fdb862 100644 --- a/src/datastructures/error.h +++ b/src/datastructures/error.h @@ -185,9 +185,6 @@ void morpho_unreachable(const char *explanation); #define VM_DVZR "DvZr" #define VM_DVZR_MSG "Division by zero." -#define VM_GETINDEXARGS "NonintIndex" -#define VM_GETINDEXARGS_MSG "Noninteger array index." - #define VM_MLTPLDSPTCHFLD "MltplDsptchFld" #define VM_MLTPLDSPTCHFLD_MSG "Multiple dispatch could not find an implementation that matches these arguments." diff --git a/src/support/parse.c b/src/support/parse.c index f2b2d4432..960034a70 100644 --- a/src/support/parse.c +++ b/src/support/parse.c @@ -1265,7 +1265,7 @@ bool parse_blockstatement(parser *p, void *out) { parse_error(p, false, PARSE_INCOMPLETEEXPRESSION); return false; } else { - PARSE_CHECK(parse_checkrequiredtoken(p, TOKEN_RIGHTCURLYBRACKET, PARSE_MISSINGSEMICOLONEXP)); + PARSE_CHECK(parse_checkrequiredtoken(p, TOKEN_RIGHTCURLYBRACKET, PARSE_BLOCKTERMINATOREXP)); } return parse_addnode(p, NODE_SCOPE, MORPHO_NIL, &start, SYNTAXTREE_UNCONNECTED, body, out); From 836dc1d54190e044dd28bb64471279371569352f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:40:15 -0500 Subject: [PATCH 224/473] Remove unused errors --- src/geometry/integrate.c | 2 +- src/support/parse.c | 2 -- src/support/parse.h | 6 ------ 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/geometry/integrate.c b/src/geometry/integrate.c index 1cc90c620..b19fcb87c 100644 --- a/src/geometry/integrate.c +++ b/src/geometry/integrate.c @@ -2226,7 +2226,7 @@ void integrator_initializequantities(integrator *integrate, int nq, quantity *qu integrate->qval[i]=q; } else if (MORPHO_ISMATRIX(q)) { objectmatrix *m = MORPHO_GETMATRIX(q); - quantity[i].ndof=matrix_countdof(m); + quantity[i].ndof=(int) matrix_countdof(m); objectmatrix *new = matrix_clone(m); // Use a copy of the matrix integrate->qval[i]=MORPHO_OBJECT(new); diff --git a/src/support/parse.c b/src/support/parse.c index 960034a70..846bd00e4 100644 --- a/src/support/parse.c +++ b/src/support/parse.c @@ -1862,9 +1862,7 @@ void parse_initialize(void) { morpho_defineerror(PARSE_INCOMPLETEEXPRESSION, ERROR_PARSE, PARSE_INCOMPLETEEXPRESSION_MSG); morpho_defineerror(PARSE_MISSINGPARENTHESIS, ERROR_PARSE, PARSE_MISSINGPARENTHESIS_MSG); morpho_defineerror(PARSE_EXPECTEXPRESSION, ERROR_PARSE, PARSE_EXPECTEXPRESSION_MSG); - morpho_defineerror(PARSE_MISSINGSEMICOLON, ERROR_PARSE, PARSE_MISSINGSEMICOLON_MSG); morpho_defineerror(PARSE_MISSINGSEMICOLONEXP, ERROR_PARSE, PARSE_MISSINGSEMICOLONEXP_MSG); - morpho_defineerror(PARSE_MISSINGSEMICOLONVAR, ERROR_PARSE, PARSE_MISSINGSEMICOLONVAR_MSG); morpho_defineerror(PARSE_VAREXPECTED, ERROR_PARSE, PARSE_VAREXPECTED_MSG); morpho_defineerror(PARSE_SYMBLEXPECTED, ERROR_PARSE, PARSE_SYMBLEXPECTED_MSG); morpho_defineerror(PARSE_BLOCKTERMINATOREXP, ERROR_PARSE, PARSE_BLOCKTERMINATOREXP_MSG); diff --git a/src/support/parse.h b/src/support/parse.h index 9c1ec984d..44ab4bb1b 100644 --- a/src/support/parse.h +++ b/src/support/parse.h @@ -113,15 +113,9 @@ struct sparser { #define PARSE_EXPECTEXPRESSION "ExpExpr" #define PARSE_EXPECTEXPRESSION_MSG "Expected expression." -#define PARSE_MISSINGSEMICOLON "MssngSemiVal" -#define PARSE_MISSINGSEMICOLON_MSG "Expect ; after value." - #define PARSE_MISSINGSEMICOLONEXP "MssngExpTerm" #define PARSE_MISSINGSEMICOLONEXP_MSG "Expect expression terminator (; or newline) after expression." -#define PARSE_MISSINGSEMICOLONVAR "MssngSemiVar" -#define PARSE_MISSINGSEMICOLONVAR_MSG "Expect ; after variable declaration." - #define PARSE_VAREXPECTED "VarExpct" #define PARSE_VAREXPECTED_MSG "Variable name expected after var." From eaffbbe40eb7477983fd12a8008ac90d5d6b7e54 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:40:54 -0500 Subject: [PATCH 225/473] Remove unused error --- src/support/parse.c | 1 - src/support/parse.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/src/support/parse.c b/src/support/parse.c index 846bd00e4..3c5597819 100644 --- a/src/support/parse.c +++ b/src/support/parse.c @@ -1873,7 +1873,6 @@ void parse_initialize(void) { morpho_defineerror(PARSE_IFRGHTPARENMISSING, ERROR_PARSE, PARSE_IFRGHTPARENMISSING_MSG); morpho_defineerror(PARSE_WHILELFTPARENMISSING, ERROR_PARSE, PARSE_WHILELFTPARENMISSING_MSG); morpho_defineerror(PARSE_FORLFTPARENMISSING, ERROR_PARSE, PARSE_FORLFTPARENMISSING_MSG); - morpho_defineerror(PARSE_FORSEMICOLONMISSING, ERROR_PARSE, PARSE_FORSEMICOLONMISSING_MSG); morpho_defineerror(PARSE_FORRGHTPARENMISSING, ERROR_PARSE, PARSE_FORRGHTPARENMISSING_MSG); morpho_defineerror(PARSE_FNNAMEMISSING, ERROR_PARSE, PARSE_FNNAMEMISSING_MSG); morpho_defineerror(PARSE_FNLEFTPARENMISSING, ERROR_PARSE, PARSE_FNLEFTPARENMISSING_MSG); diff --git a/src/support/parse.h b/src/support/parse.h index 44ab4bb1b..4036ab09d 100644 --- a/src/support/parse.h +++ b/src/support/parse.h @@ -146,9 +146,6 @@ struct sparser { #define PARSE_FORLFTPARENMISSING "ForMssngLftPrn" #define PARSE_FORLFTPARENMISSING_MSG "Expected '(' after for." -#define PARSE_FORSEMICOLONMISSING "ForMssngSemi" -#define PARSE_FORSEMICOLONMISSING_MSG "Expected ';'." - #define PARSE_FORRGHTPARENMISSING "ForMssngRgtPrn" #define PARSE_FORRGHTPARENMISSING_MSG "Expected ')' after for clauses." From d29e6f9f6c9df1d3a07338532c2865cbf6683d82 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 15 Jan 2026 22:53:16 -0500 Subject: [PATCH 226/473] A whole bunch of useful errors --- help/errors.md | 1709 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1709 insertions(+) diff --git a/help/errors.md b/help/errors.md index 55cd1b0bf..133b412ec 100644 --- a/help/errors.md +++ b/help/errors.md @@ -195,3 +195,1712 @@ Or to be multiplied together, the number of columns of the left hand matrix must var b = Matrix([1,2]) print a*b // ok print b*a // generates a `MtrxIncmptbl` error. + +## DvZr +[tagdvzr]: # (dvzr) + +This error occurs when attempting to divide by zero: + + var a = 5 / 0 // Causes 'DvZr' + +## StckOvflw +[tagstckovflw]: # (stckovflw) + +This error occurs when the call stack exceeds its maximum depth, typically due to excessive recursion or deeply nested function calls. + +## ErrStckOvflw +[tagerrstckovflw]: # (errstckovflw) + +This error occurs when the error handler stack overflows, typically due to errors occurring within error handlers. + +## Exit +[tagexit]: # (exit) + +This error is generated when the virtual machine is halted, typically when the program exits normally. + +## MltplDsptchFld +[tagmltpldsptchfld]: # (mltpldsptchfld) + +This error occurs when multiple dispatch cannot find a method implementation that matches the provided arguments: + + class A { } + class B { } + fn method(a: A) { } + fn method(b: B) { } + method(1) // Causes 'MltplDsptchFld' - no matching method for integer + +## TypeChk +[tagtypechk]: # (typechk) + +This error occurs when there is a type violation, such as attempting to assign a value of one type to a variable declared with a different type: + + var x: String = 5 // Causes 'TypeChk' + +## NoOptArg +[tagnooptarg]: # (nooptarg) + +This error occurs when you try to pass optional arguments to a function that doesn't accept them: + + fn f(x) { return x } + f(1, y: 2) // Causes 'NoOptArg' + +## UnkwnOptArg +[tagunkwnoptarg]: # (unkwnoptarg) + +This error occurs when you pass an unknown optional argument to a function: + + fn f(x, y: 1) { return x + y } + f(1, z: 2) // Causes 'UnkwnOptArg' + +## InvldArgsBltn +[taginvldargsbltn]: # (invldargsbltn) + +This error occurs when a built-in function is called with arguments of the wrong type: + + print(1, 2, 3) // If print expects a string, causes 'InvldArgsBltn' + +## ArrayArgs +[tagarrayargs]: # (arrayargs) + +This error occurs when creating an Array with invalid arguments. Arrays must be created with integer dimensions: + + var a = Array("invalid") // Causes 'ArrayArgs' + +## ArrayInit +[tagarrayinit]: # (arrayinit) + +This error occurs when an Array initializer is not an array or list: + + var a = Array(2, 2, "invalid") // Causes 'ArrayInit' + +## ArrayCmpt +[tagarraycmpt]: # (arraycmpt) + +This error occurs when an Array initializer has dimensions that don't match the requested dimensions: + + var a = Array(2, 2, [[1,2,3]]) // Causes 'ArrayCmpt' if dimensions don't match + +## ArrayIndx +[tagarrayindx]: # (arrayindx) + +This error occurs when indexing an Array with non-integer indices: + + var a[2,2] + a["x", "y"] // Causes 'ArrayIndx' + +## BrkOtsdLp +[tagbrkotsdlp]: # (brkotsdlp) + +This error occurs when a `break` statement is encountered outside of a loop: + + break // Causes 'BrkOtsdLp' + +## CntOtsdLp +[tagcntotsdlp]: # (cntotsdlp) + +This error occurs when a `continue` statement is encountered outside of a loop: + + continue // Causes 'CntOtsdLp' + +## ClssCrcRf +[tagclsscrcrf]: # (clsscrcrf) + +This error occurs when a class attempts to inherit from itself: + + class A < A { } // Causes 'ClssCrcRf' + +## ClssDplctImpl +[tagclssdplctimpl]: # (clssdplctimpl) + +This error occurs when a class has duplicate method implementations with the same signature: + + class A { + fn method() { } + fn method() { } // Causes 'ClssDplctImpl' + } + +## ClssLnrz +[tagclsslnrz]: # (clsslnrz) + +This error occurs when morpho cannot linearize a class hierarchy due to conflicting inheritance order. Check parent and ancestor classes for inheritance issues. + +## SlfOtsdClss +[tagslfotsdclss]: # (slfotsdclss) + +This error occurs when `self` is used outside of a class method: + + print self // Causes 'SlfOtsdClss' + +## SprOtsdClss +[tagsprotsdclss]: # (sprotsdclss) + +This error occurs when `super` is used outside of a class method: + + print super // Causes 'SprOtsdClss' + +## SprSelMthd +[tagsprselmthd]: # (sprselmthd) + +This error occurs when `super` is used incorrectly. It can only be used to select a method: + + super // Causes 'SprSelMthd' + super.method() // OK + +## SprNtFnd +[tagsprntfnd]: # (sprntfnd) + +This error occurs when a superclass cannot be found: + + class A < NonExistent { } // Causes 'SprNtFnd' + +## TooMnyArg +[tagtoomnyarg]: # (toomnyarg) + +This error occurs when too many arguments are passed to a function: + + fn f(x) { return x } + f(1, 2, 3) // Causes 'TooMnyArg' + +## TooMnyPrm +[tagtoomnyprm]: # (toomnyprm) + +This error occurs when a function is defined with too many parameters (exceeding the maximum allowed). + +## TooMnyCnst +[tagtoomnycnst]: # (toomnycnst) + +This error occurs when a program has too many constants (exceeding the maximum allowed). + +## VblDcl +[tagvbldcl]: # (vbldcl) + +This error occurs when a variable is declared multiple times in the same scope: + + var x = 1 + var x = 2 // Causes 'VblDcl' + +## FlNtFnd +[tagflntfnd]: # (flntfnd) + +This error occurs when a file cannot be found: + + import "nonexistent.morpho" // Causes 'FlNtFnd' + +## MdlNtFnd +[tagmdlntfnd]: # (mdlntfnd) + +This error occurs when a module cannot be found: + + import nonexistent // Causes 'MdlNtFnd' + +## ImprtFld +[tagimprtfld]: # (imprtfld) + +This error occurs when an import statement fails: + + import "broken.morpho" // Causes 'ImprtFld' if the file has errors + +## UnrslvdFrwdRf +[tagunrslvdfrwdrf]: # (unrslvdfrwdrf) + +This error occurs when a function is called before it is defined in the same scope: + + f() // Causes 'UnrslvdFrwdRf' + fn f() { } + +## MltVarPrmtr +[tagmltvarprmtr]: # (mltvarprmtr) + +This error occurs when a function has more than one variadic parameter: + + fn f(...args1, ...args2) { } // Causes 'MltVarPrmtr' + +## VarPrLst +[tagvarprlst]: # (varprlst) + +This error occurs when fixed parameters are placed after a variadic parameter: + + fn f(...args, x) { } // Causes 'VarPrLst' + +## OptPrmDflt +[tagoptprmdflt]: # (optprmdflt) + +This error occurs when an optional parameter's default value is not a constant: + + var x = 1 + fn f(y: x) { } // Causes 'OptPrmDflt' + +## MssngLoopBdy +[tagmssngloopbdy]: # (mssngloopbdy) + +This error occurs when a loop statement is missing its body: + + for (var i = 0; i < 10; i++) // Causes 'MssngLoopBdy' + +## NstdClss +[tagnstdclss]: # (nstdclss) + +This error occurs when attempting to define a class within another class: + + class A { + class B { } // Causes 'NstdClss' + } + +## InvldAssgn +[taginvldassgn]: # (invldassgn) + +This error occurs when attempting to assign to an invalid target: + + 5 = 10 // Causes 'InvldAssgn' + +## FnPrmSymb +[tagfnprmsymb]: # (fnprmsymb) + +This error occurs when function parameters are not symbols: + + fn f(5) { } // Causes 'FnPrmSymb' + +## PptyNmRqd +[tagpptynmrqd]: # (pptynmrqd) + +This error occurs when a property name is required but not provided. + +## InitRtn +[taginitrtn]: # (initrtn) + +This error occurs when attempting to return a value from an initializer method: + + class A { + init() { + return 5 // Causes 'InitRtn' + } + } + +## MssngIndx +[tagmssngindx]: # (mssngindx) + +This error occurs when indexing syntax is incomplete, missing required indices. + +## MssngIntlzr +[tagmssngintlzr]: # (mssngintlzr) + +This error occurs when a typed variable is declared without an initializer: + + var x: String // Causes 'MssngIntlzr' if initialization is required + +## TypeErr +[tagtypeerr]: # (typeerr) + +This error occurs when there is a type violation during assignment: + + var x: String + x = 5 // Causes 'TypeErr' + +## UnknwnType +[tagunknwntype]: # (unknwntype) + +This error occurs when an unknown type is referenced: + + var x: UnknownType // Causes 'UnknwnType' + +## UnknwnNmSpc +[tagunknwnnmspc]: # (unknwnnmspc) + +This error occurs when an unknown namespace is referenced: + + import unknown::module // Causes 'UnknwnNmSpc' + +## UnknwnTypeNmSpc +[tagunknwntypenmspc]: # (unknwntypenmspc) + +This error occurs when an unknown type is referenced in a namespace: + + var x: unknown::Type // Causes 'UnknwnTypeNmSpc' + +## SymblUndfNmSpc +[tagsymblundfnmspc]: # (symblundfnmspc) + +This error occurs when a symbol is not defined in the specified namespace: + + unknown::symbol // Causes 'SymblUndfNmSpc' + +## IncExp +[tagincexp]: # (incexp) + +This error occurs when an expression is incomplete: + + var x = 5 + // Causes 'IncExp' + +## MssngParen +[tagmssngparen]: # (mssngparen) + +This error occurs when a closing parenthesis is missing: + + fn f(x // Causes 'MssngParen' + +## ExpExpr +[tagexpexpr]: # (expexpr) + +This error occurs when an expression is expected but not found: + + var x = // Causes 'ExpExpr' + +## MssngExpTerm +[tagmssngexpterm]: # (mssngexpterm) + +This error occurs when an expression terminator (semicolon or newline) is missing after an expression. + +## VarExpct +[tagvarexpct]: # (varexpct) + +This error occurs when a variable name is expected after `var`: + + var // Causes 'VarExpct' + +## SymblExpct +[tagsymblexpct]: # (symblexpct) + +This error occurs when a symbol is expected but not found. + +## MssngBrc +[tagmssngbrc]: # (mssngbrc) + +This error occurs when a closing brace is missing: + + fn f() { // Causes 'MssngBrc' + +## MssngSqBrc +[tagmssngsqbrc]: # (mssngsqbrc) + +This error occurs when a closing square bracket is missing: + + var x = [1, 2 // Causes 'MssngSqBrc' + +## MssngComma +[tagmssngcomma]: # (mssngcomma) + +This error occurs when a comma is expected: + + var x = [1 2] // Causes 'MssngComma' + +## TrnryMssngColon +[tagtrnymssngcolon]: # (trnymssngcolon) + +This error occurs when a colon is missing in a ternary operator: + + var x = true ? 1 // Causes 'TrnryMssngColon' + +## IfMssngLftPrn +[tagifmssnglftprn]: # (ifmssnglftprn) + +This error occurs when a left parenthesis is missing after `if`: + + if x > 0 { } // Causes 'IfMssngLftPrn' + +## IfMssngRgtPrn +[tagifmssngrgtprn]: # (ifmssngrgtprn) + +This error occurs when a right parenthesis is missing after an if condition: + + if (x > 0 { } // Causes 'IfMssngRgtPrn' + +## WhlMssngLftPrn +[tagwhlmssnglftprn]: # (whlmssnglftprn) + +This error occurs when a left parenthesis is missing after `while`: + + while x > 0 { } // Causes 'WhlMssngLftPrn' + +## ForMssngLftPrn +[tagformssnglftprn]: # (formssnglftprn) + +This error occurs when a left parenthesis is missing after `for`: + + for var i = 0; i < 10; i++ { } // Causes 'ForMssngLftPrn' + +## ForMssngRgtPrn +[tagformssngrgtprn]: # (formssngrgtprn) + +This error occurs when a right parenthesis is missing after for clauses: + + for (var i = 0; i < 10; i++ { } // Causes 'ForMssngRgtPrn' + +## FnNoName +[tagfnoname]: # (fnoname) + +This error occurs when a function or method name is expected but not found: + + fn () { } // Causes 'FnNoName' + +## FnMssngLftPrn +[tagfnmssnglftprn]: # (fnmssnglftprn) + +This error occurs when a left parenthesis is missing after a function name: + + fn f { } // Causes 'FnMssngLftPrn' + +## FnMssngRgtPrn +[tagfnmssngrgtprn]: # (fnmssngrgtprn) + +This error occurs when a right parenthesis is missing after function parameters: + + fn f(x { } // Causes 'FnMssngRgtPrn' + +## FnMssngLftBrc +[tagfnmssnglftbrc]: # (fnmssnglftbrc) + +This error occurs when a left brace is missing before a function body: + + fn f() // Causes 'FnMssngLftBrc' + +## CllMssngRgtPrn +[tagcllmssngrgtprn]: # (cllmssngrgtprn) + +This error occurs when a right parenthesis is missing after function call arguments: + + f(x // Causes 'CllMssngRgtPrn' + +## ClsNmMssng +[tagclsnmssng]: # (clsnmssng) + +This error occurs when a class name is expected but not found: + + class { } // Causes 'ClsNmMssng' + +## ClsMssngLftBrc +[tagclsmssnglftbrc]: # (clsmssnglftbrc) + +This error occurs when a left brace is missing before a class body: + + class A // Causes 'ClsMssngLftBrc' + +## ClsMssngRgtBrc +[tagclsmssngrgtbrc]: # (clsmssngrgtbrc) + +This error occurs when a right brace is missing after a class body: + + class A { // Causes 'ClsMssngRgtBrc' + +## ExpctDtSpr +[tagexpctdtspr]: # (expctdtspr) + +This error occurs when a dot is expected after `super`: + + super method() // Causes 'ExpctDtSpr' + super.method() // OK + +## SprNmMssng +[tagsprnmssng]: # (sprnmssng) + +This error occurs when a superclass name is expected but not found: + + class A < { } // Causes 'SprNmMssng' + +## MxnNmMssng +[tagmxnnmssng]: # (mxnnmssng) + +This error occurs when a mixin class name is expected but not found. + +## IntrpIncmp +[tagintrpincmp]: # (intrpincmp) + +This error occurs when a string interpolation is incomplete: + + var x = "Hello ${" // Causes 'IntrpIncmp' + +## EmptyIndx +[tagemptyindx]: # (emptyindx) + +This error occurs when a variable declaration has an empty capacity: + + var x[] // Causes 'EmptyIndx' + +## ImprtMssngNm +[tagimprtmssngnm]: # (imprtmssngnm) + +This error occurs when an import statement is missing a module or file name: + + import // Causes 'ImprtMssngNm' + +## ImprtMltplAs +[tagimprtmltplas]: # (imprtmltplas) + +This error occurs when an import statement has multiple `as` clauses: + + import module as A as B // Causes 'ImprtMltplAs' + +## ImprtExpctFrAs +[tagimprtexpctfras]: # (imprtexpctfras) + +This error occurs when an import statement doesn't have the expected format: + + import module invalid // Causes 'ImprtExpctFrAs' + +## ExpctSymblAftrAs +[tagexpctsymblaftras]: # (expctsymblaftras) + +This error occurs when a symbol is expected after `as` in an import: + + import module as // Causes 'ExpctSymblAftrAs' + +## ExpctSymblAftrFr +[tagexpctsymblaftrfr]: # (expctsymblaftrfr) + +This error occurs when a symbol is expected after `for` in an import: + + import module for // Causes 'ExpctSymblAftrFr' + +## DctSprtr +[tagdctsprtr]: # (dctsprtr) + +This error occurs when a colon is missing in a dictionary key-value pair: + + var d = {"key" "value"} // Causes 'DctSprtr' + +## DctEntrySprtr +[tagdctentrysprtr]: # (dctentrysprtr) + +This error occurs when a comma is missing between dictionary entries: + + var d = {"a": 1 "b": 2} // Causes 'DctEntrySprtr' + +## DctTrmntr +[tagdcttrmntr]: # (dcttrmntr) + +This error occurs when a closing brace is missing in a dictionary: + + var d = {"a": 1 // Causes 'DctTrmntr' + +## SwtchSprtr +[tagswtchsprtr]: # (swtchsprtr) + +This error occurs when a colon is missing after a switch label: + + switch x { + case 1 // Causes 'SwtchSprtr' + } + +## ExpctWhl +[tagexpctwhl]: # (expctwhl) + +This error occurs when `while` is expected after a do-while loop body: + + do { + // body + } // Causes 'ExpctWhl' + +## ExpctCtch +[tagexpctctch]: # (expctctch) + +This error occurs when `catch` is expected after a `try` statement: + + try { + // code + } // Causes 'ExpctCtch' + +## ExpctHndlr +[tagexpcthndlr]: # (expcthndlr) + +This error occurs when an error handler block is expected after `catch`: + + try { + // code + } catch // Causes 'ExpctHndlr' + +## InvldLbl +[taginvldlbl]: # (invldlbl) + +This error occurs when an invalid label is used in a catch statement. + +## OneVarPr +[tagonevarpr]: # (onevarpr) + +This error occurs when a function has more than one variadic parameter (same as `MltVarPrmtr`). + +## ValRng +[tagvalrng]: # (valrng) + +This error occurs when a value is out of the expected range. + +## StrEsc +[tagstresc]: # (stresc) + +This error occurs when an unrecognized escape sequence is used in a string: + + var s = "\q" // Causes 'StrEsc' + +## RcrsnLmt +[tagrcrsnlmt]: # (rcrsnlmt) + +This error occurs when the parser recursion depth is exceeded, typically due to deeply nested expressions. + +## UnescpdCtrl +[tagunescpdctrl]: # (unescpdctrl) + +This error occurs when an unescaped control character is found in a string literal. + +## InvldUncd +[taginvlduncd]: # (invlduncd) + +This error occurs when an invalid unicode escape sequence is used in a string: + + var s = "\uZZZZ" // Causes 'InvldUncd' + +## UnrcgnzdTok +[tagunrcgnzdtok]: # (unrcgnzdtok) + +This error occurs when the parser encounters an unrecognized token. + +## UntrmComm +[taguntrmcomm]: # (untrmcomm) + +This error occurs when a multiline comment is not terminated: + + /* This comment // Causes 'UntrmComm' + +## UntrmStrng +[taguntrmstrng]: # (untrmstrng) + +This error occurs when a string literal is not terminated: + + var s = "This string // Causes 'UntrmStrng' + +## UnrgnzdTkn +[tagunrgnzdtkn]: # (unrgnzdtkn) + +This error occurs when the lexer encounters an unrecognized token. + +## MtrxBnds +[tagmtrxbnds]: # (mtrxbnds) + +This error occurs when attempting to access a matrix element with an index that is out of bounds: + + var m = Matrix([[1,2],[3,4]]) + print m[10, 10] // Causes 'MtrxBnds' + +## MtrxInvldIndx +[tagmtrxinvldindx]: # (mtrxinvldindx) + +This error occurs when matrix indices are not integers: + + var m = Matrix([[1,2],[3,4]]) + print m["x", "y"] // Causes 'MtrxInvldIndx' + +## MtrxInvldNumIndx +[tagmtrxinvldnumindx]: # (mtrxinvldnumindx) + +This error occurs when a matrix is indexed with the wrong number of indices: + + var m = Matrix([[1,2],[3,4]]) + print m[1] // Causes 'MtrxInvldNumIndx' (needs two indices) + +## MtrxCns +[tagmtrxcns]: # (mtrxcns) + +This error occurs when the Matrix constructor is called with invalid arguments. It should be called with dimensions or an array/list/matrix initializer: + + var m = Matrix("invalid") // Causes 'MtrxCns' + +## MtrxIdnttyCns +[tagmtrxidnttycns]: # (mtrxidnttycns) + +This error occurs when IdentityMatrix is called with invalid arguments. It expects a single dimension: + + var m = IdentityMatrix() // Causes 'MtrxIdnttyCns' + +## MtrxInvldInit +[tagmtrxinvldinit]: # (mtrxinvldinit) + +This error occurs when an invalid initializer is passed to the Matrix constructor: + + var m = Matrix([["invalid"]]) // Causes 'MtrxInvldInit' if incompatible + +## MtrxInvldArg +[tagmtrxinvldarg]: # (mtrxinvldarg) + +This error occurs when matrix arithmetic methods receive invalid arguments: + + var m = Matrix([[1,2],[3,4]]) + m + "string" // Causes 'MtrxInvldArg' + +## MtrxRShpArg +[tagmtrxrshparg]: # (mtrxrshparg) + +This error occurs when the reshape method is called with invalid arguments. It requires two integer arguments: + + var m = Matrix([[1,2],[3,4]]) + m.reshape("invalid") // Causes 'MtrxRShpArg' + +## MtrxIncmptbl +[tagmtrxincmptbl]: # (mtrxincmptbl) + +This error occurs when matrices have incompatible shapes for an operation. See the main documentation above for examples. + +## MtrxSnglr +[tagmtrxsnglr]: # (mtrxsnglr) + +This error occurs when attempting to invert a singular (non-invertible) matrix: + + var m = Matrix([[1,2],[2,4]]) // Singular matrix + m.inverse() // Causes 'MtrxSnglr' + +## MtrxNtSq +[tagmtrxntsq]: # (mtrxntsq) + +This error occurs when a matrix operation requires a square matrix but a non-square matrix is provided: + + var m = Matrix([[1,2,3],[4,5,6]]) // 2x3 matrix + m.inverse() // Causes 'MtrxNtSq' + +## MtrxOpFld +[tagmtrxopfld]: # (mtrxopfld) + +This error occurs when a matrix operation fails for an unspecified reason. + +## MtrxNrmArgs +[tagmtrxnrmargs]: # (mtrxnrmargs) + +This error occurs when the norm method is called with invalid arguments. It expects an optional numerical argument: + + var m = Matrix([[1,2],[3,4]]) + m.norm("invalid") // Causes 'MtrxNrmArgs' + +## MtrxStClArgs +[tagmtrxstclargs]: # (mtrxstclargs) + +This error occurs when setcolumn is called with invalid arguments. It expects an integer column index and a column matrix: + + var m = Matrix([[1,2],[3,4]]) + m.setcolumn("invalid", Matrix([1,2])) // Causes 'MtrxStClArgs' + +## LnAlgMtrxIncmptbl +[taglnalgmtrxincmptbl]: # (lnalgmtrxincmptbl) + +This error occurs when matrices have incompatible shapes in linear algebra operations. + +## LnAlgMtrxIndxBnds +[taglnalgmtrxindxbnds]: # (lnalgmtrxindxbnds) + +This error occurs when a matrix index is out of bounds in linear algebra operations. + +## LnAlgMtrxSnglr +[taglnalgmtrxsnglr]: # (lnalgmtrxsnglr) + +This error occurs when a matrix is singular in linear algebra operations. + +## LnAlgMtrxNtSq +[taglnalgmtrxntsq]: # (lnalgmtrxntsq) + +This error occurs when a matrix is not square in linear algebra operations. + +## LnAlgLapackArgs +[taglnalglapackargs]: # (lnalglapackargs) + +This error occurs when a LAPACK function is called with invalid arguments. + +## LnAlgMtrxOpFld +[taglnalgmtrxopfld]: # (lnalgmtrxopfld) + +This error occurs when a matrix operation fails in the linear algebra library. + +## LnAlgMtrxNtSpprtd +[taglnalgmtrxntspprtd]: # (lnalgmtrxntspprtd) + +This error occurs when an operation is not supported for a particular matrix type. + +## LnAlgMtrxInvldArg +[taglnalgmtrxinvldarg]: # (lnalgmtrxinvldarg) + +This error occurs when invalid arguments are passed to a matrix method in the linear algebra library. + +## LnAlgMtrxNnNmrclArg +[taglnalgmtrxnnnmrclarg]: # (lnalgmtrxnnnmrclarg) + +This error occurs when a matrix method requires numerical arguments but receives non-numerical ones. + +## LnAlgMtrxNrmArgs +[taglnalgmtrxnrmargs]: # (lnalgmtrxnrmargs) + +This error occurs when the norm method is called with an unsupported argument. It requires 1 or inf: + + var m = Matrix([[1,2],[3,4]]) + m.norm(2) // Causes 'LnAlgMtrxNrmArgs' if 2 is not supported + +## LnAlgInvldArg +[taglnalginvldarg]: # (lnalginvldarg) + +This error occurs when matrix arithmetic methods receive invalid arguments: + + var m = Matrix([[1,2],[3,4]]) + m + "string" // Causes 'LnAlgInvldArg' + +## SprsCns +[tagsprscns]: # (sprscns) + +This error occurs when the Sparse constructor is called with invalid arguments. It should be called with dimensions or an array initializer: + + var s = Sparse("invalid") // Causes 'SprsCns' + +## SprsInvldInit +[tagsprsinvldinit]: # (sprsinvldinit) + +This error occurs when an invalid initializer is passed to the Sparse constructor. + +## SprsSt +[tagsprsst]: # (sprsst) + +This error occurs when attempting to set a sparse matrix element fails. + +## SprsCnvFld +[tagsprscnvfld]: # (sprscnvfld) + +This error occurs when sparse format conversion fails. + +## SprsOpFld +[tagsprsopfld]: # (sprsopfld) + +This error occurs when a sparse matrix operation fails. + +## CmplxCns +[tagcmplxcns]: # (cmplxcns) + +This error occurs when the Complex constructor is called with invalid arguments. It should be called with two floats: + + var c = Complex(1) // Causes 'CmplxCns' + +## CmplxInvldArg +[tagcmplxinvldarg]: # (cmplxinvldarg) + +This error occurs when complex arithmetic methods receive invalid arguments: + + var c = Complex(1, 2) + c + "string" // Causes 'CmplxInvldArg' + +## CmpxArg +[tagcmpxarg]: # (cmpxarg) + +This error occurs when a complex operation receives unexpected arguments. + +## LstArgs +[taglstargs]: # (lstargs) + +This error occurs when a List is created with invalid arguments. Lists must be called with integer dimensions: + + var l = List("invalid") // Causes 'LstArgs' + +## LstNumArgs +[taglstnumargs]: # (lstnumargs) + +This error occurs when a List is indexed with more than one argument: + + var l = [1, 2, 3] + l[1, 2] // Causes 'LstNumArgs' + +## LstAddArgs +[taglstaddargs]: # (lstaddargs) + +This error occurs when the add method receives invalid arguments. It requires a list: + + var l = [1, 2, 3] + l.add("invalid") // Causes 'LstAddArgs' + +## LstSrtFn +[taglstsrtfn]: # (lstsrtfn) + +This error occurs when a list sort function doesn't return an integer: + + var l = [3, 1, 2] + l.sort(fn(a, b) { return "invalid" }) // Causes 'LstSrtFn' + +## EntryNtFnd +[tagentryntfnd]: # (entryntfnd) + +This error occurs when an entry is not found in a list: + + var l = [1, 2, 3] + l.remove(10) // Causes 'EntryNtFnd' + +## TplArgs +[tagtplargs]: # (tplargs) + +This error occurs when a Tuple is created with invalid arguments. Tuples must be called with integer dimensions: + + var t = Tuple("invalid") // Causes 'TplArgs' + +## TpmNumArgs +[tagtpmnumargs]: # (tpmnumargs) + +This error occurs when a Tuple is indexed with more than one argument: + + var t = (1, 2, 3) + t[1, 2] // Causes 'TpmNumArgs' + +## DctKyNtFnd +[tagdctkyntfnd]: # (dctkyntfnd) + +This error occurs when a key is not found in a dictionary: + + var d = {"a": 1} + print d["b"] // Causes 'DctKyNtFnd' + +## DctStArg +[tagdctstarg]: # (dctstarg) + +This error occurs when dictionary set methods (union, intersection, difference) receive invalid arguments. They expect a dictionary: + + var d1 = {"a": 1} + d1.union("invalid") // Causes 'DctStArg' + +## FlOpnFld +[tagflopnfld]: # (flopnfld) + +This error occurs when a file cannot be opened: + + var f = File("nonexistent.txt", "read") // Causes 'FlOpnFld' if file doesn't exist + +## FlNmMssng +[tagflnmssng]: # (flnmssng) + +This error occurs when a filename is missing in a File operation: + + var f = File() // Causes 'FlNmMssng' + +## FlNmArgs +[tagflnmargs]: # (flnmargs) + +This error occurs when the first argument to File is not a filename: + + var f = File(123, "read") // Causes 'FlNmArgs' + +## FlMode +[tagflmode]: # (flmode) + +This error occurs when the second argument to File is not a valid mode. It should be 'read', 'write', or 'append': + + var f = File("test.txt", "invalid") // Causes 'FlMode' + +## FlWrtArgs +[tagflwrtargs]: # (flwrtargs) + +This error occurs when File.write receives non-string arguments: + + var f = File("test.txt", "write") + f.write(123) // Causes 'FlWrtArgs' + +## FlWrtFld +[tagflwrtfld]: # (flwrtfld) + +This error occurs when writing to a file fails. + +## FldrExpctPth +[tagfldrexpctpth]: # (fldrexpctpth) + +This error occurs when folder methods receive invalid arguments. They expect a path: + + Folder.exists(123) // Causes 'FldrExpctPth' + +## NtFldr +[tagntfldr]: # (ntfldr) + +This error occurs when a path is not a folder: + + Folder.exists("file.txt") // May cause 'NtFldr' if it's a file, not a folder + +## FldrCrtFld +[tagfldrcrtfld]: # (fldrcrtfld) + +This error occurs when folder creation fails: + + Folder.create("/invalid/path") // Causes 'FldrCrtFld' + +## RngArgs +[tagrngargs]: # (rngargs) + +This error occurs when Range receives invalid arguments. It expects numerical arguments: a start, an end, and an optional stepsize: + + Range("invalid") // Causes 'RngArgs' + +## RngStpSz +[tagrngstpsz]: # (rngstpsz) + +This error occurs when a Range stepsize is too small: + + Range(0, 10, 0.0000001) // May cause 'RngStpSz' if too small + +## ExpctNmArgs +[tagexpctnmargs]: # (expctnmargs) + +This error occurs when a function expects numerical arguments but receives non-numerical ones: + + sqrt("string") // Causes 'ExpctNmArgs' + +## ExpctArgNm +[tagexpctargnm]: # (expctargnm) + +This error occurs when a function expects a single numerical argument but receives something else: + + abs() // Causes 'ExpctArgNm' + +## TypArgNm +[tagtypargnm]: # (typargnm) + +This error occurs when a function expects one argument but receives a different number: + + type() // May cause 'TypArgNm' if no arguments provided + +## MnMxArgs +[tagmnmxargs]: # (mnmxargs) + +This error occurs when min or max functions receive invalid arguments. They expect at least one numerical argument, list, or matrix: + + min() // Causes 'MnMxArgs' + +## ApplyArgs +[tagapplyargs]: # (applyargs) + +This error occurs when the apply function receives fewer than two arguments: + + apply() // Causes 'ApplyArgs' + +## ApplyNtCllble +[tagapplyntcllble]: # (applyntcllble) + +This error occurs when apply receives a non-callable object as its first argument: + + apply("not a function", [1, 2, 3]) // Causes 'ApplyNtCllble' + +## FrmtArg +[tagfrmtarg]: # (frmtarg) + +This error occurs when the format method receives invalid arguments. It requires a format string: + + "test".format(123) // Causes 'FrmtArg' if format string expected + +## InvldFrmt +[taginvldfrmt]: # (invldfrmt) + +This error occurs when an invalid format string is provided: + + "test".format("%Z") // May cause 'InvldFrmt' if %Z is invalid + +## ErrorArgs +[tagerrorargs]: # (errorargs) + +This error occurs when the Error constructor is called with invalid arguments. It must be called with a tag and a default message: + + Error("Tag") // Causes 'ErrorArgs' + +## Err +[tagerr]: # (err) + +This is a generic error tag used for general error conditions. + +## EnmrtArgs +[tagenmrtargs]: # (enmrtargs) + +This error occurs when the enumerate method receives invalid arguments. It expects a single integer argument: + + var obj = Object() + obj.enumerate("invalid") // Causes 'EnmrtArgs' + +## IndxArgs +[tagindxargs]: # (indxargs) + +This error occurs when the index method receives invalid arguments. It expects a String property name: + + var obj = Object() + obj.index(123) // Causes 'IndxArgs' + +## SetIndxArgs +[tagsetindxargs]: # (setindxargs) + +This error occurs when the setindex method receives invalid arguments. It expects an index and a value: + + var obj = Object() + obj.setindex(1) // Causes 'SetIndxArgs' (missing value) + +## RspndsToArg +[tagrspndstoarg]: # (rspndstoarg) + +This error occurs when the respondsto method receives invalid arguments. It expects a single string argument or no argument: + + var obj = Object() + obj.respondsto(123) // Causes 'RspndsToArg' + +## HasArg +[taghasarg]: # (hasarg) + +This error occurs when the has method receives invalid arguments. It expects a single string argument or no argument: + + var obj = Object() + obj.has(123) // Causes 'HasArg' + +## IsMmbrArg +[tagismmbrarg]: # (ismmbrarg) + +This error occurs when the ismember method receives invalid arguments. It expects a single argument: + + var obj = Object() + obj.ismember() // Causes 'IsMmbrArg' + +## ObjCantClone +[tagobjcantclone]: # (objcantclone) + +This error occurs when attempting to clone an object that cannot be cloned: + + var obj = Object() + obj.clone() // May cause 'ObjCantClone' if cloning not supported + +## ObjImmutable +[tagobjimmutable]: # (objimmutable) + +This error occurs when attempting to modify an immutable object: + + var obj = Object() + // If obj is immutable: + obj.property = "value" // Causes 'ObjImmutable' + +## ObjNoPrp +[tagobjnoprp]: # (objnoprp) + +This error occurs when an object does not provide properties: + + var obj = Object() + obj.property // May cause 'ObjNoPrp' if object doesn't support properties + +## InvocationArgs +[taginvocationargs]: # (invocationargs) + +This error occurs when Invocation is called with invalid arguments. It must be called with an object and a method name: + + Invocation() // Causes 'InvocationArgs' + +## SystmSlpArgs +[tagsystmslpargs]: # (systmslpargs) + +This error occurs when the sleep method receives invalid arguments. It expects a time in seconds: + + sleep("invalid") // Causes 'SystmSlpArgs' + +## SystmStWrkDr +[tagsystmstwrkdr]: # (systmstwrkdr) + +This error occurs when setting the working directory fails: + + System.setworkingdirectory("/invalid/path") // Causes 'SystmStWrkDr' + +## SystmStWrkDrArgs +[tagsystmstwrkdrargs]: # (systmstwrkdrargs) + +This error occurs when setworkingdirectory receives invalid arguments. It expects a path name: + + System.setworkingdirectory(123) // Causes 'SystmStWrkDrArgs' + +## JSONPrsArgs +[tagjsonprsargs]: # (jsonprsargs) + +This error occurs when JSON.parse receives invalid arguments. It requires a string: + + JSON.parse(123) // Causes 'JSONPrsArgs' + +## JSONObjctKey +[tagjsonobjctkey]: # (jsonobjctkey) + +This error occurs when a JSON object key is not a string: + + JSON.parse('{123: "value"}') // Causes 'JSONObjctKey' + +## JSONNmbrFrmt +[tagjsonnmbrfrmt]: # (jsonnmbrfrmt) + +This error occurs when a number in JSON is improperly formatted: + + JSON.parse('{"num": 1.2.3}') // Causes 'JSONNmbrFrmt' + +## JSONExtrnsTkn +[tagjsonextrnstkn]: # (jsonextrnstkn) + +This error occurs when there is an extraneous token after a JSON element: + + JSON.parse('{"a": 1} extra') // Causes 'JSONExtrnsTkn' + +## JSONBlnkElmnt +[tagjsonblnkelmnt]: # (jsonblnkelmnt) + +This error occurs when a blank element is found in JSON: + + JSON.parse('[,]') // Causes 'JSONBlnkElmnt' + +## MshFlNtFnd +[tagmshflntfnd]: # (mshflntfnd) + +This error occurs when a mesh file cannot be found: + + var m = Mesh("nonexistent.mesh") // Causes 'MshFlNtFnd' + +## MshArgs +[tagmshargs]: # (mshargs) + +This error occurs when Mesh receives invalid arguments. It expects either a single file name or no arguments: + + var m = Mesh(123) // Causes 'MshArgs' + +## MshVrtMtrxDim +[tagmshvrtmtrxdim]: # (mshvrtmtrxdim) + +This error occurs when vertex matrix dimensions are inconsistent with the mesh. + +## MshLdVrtDim +[tagmshldvrtdim]: # (mshldvrtdim) + +This error occurs when a vertex has inconsistent dimensions when loading a mesh file. + +## MshLdVrtCrd +[tagmshldvrtcrd]: # (mshldvrtcrd) + +This error occurs when a vertex has non-numerical coordinates when loading a mesh file. + +## MshLdPrsErr +[tagmshldprserr]: # (mshldprserr) + +This error occurs when there is a parse error in a mesh file. + +## MshLdVrtNm +[tagmshldvrtnm]: # (mshldvrtnm) + +This error occurs when an element has an incorrect number of vertices when loading a mesh file. + +## MshLdVrtId +[tagmshldvrtid]: # (mshldvrtid) + +This error occurs when a vertex id is not an integer when loading a mesh file. + +## MshLdVrtNtFnd +[tagmshldvrtntfnd]: # (mshldvrtntfnd) + +This error occurs when a vertex is not found when loading a mesh file. + +## MshStVrtPsnArgs +[tagmshstvrtpsnargs]: # (mshstvrtpsnargs) + +This error occurs when setvertexposition receives invalid arguments. It expects a vertex id and a position matrix: + + var m = Mesh() + m.setvertexposition("invalid") // Causes 'MshStVrtPsnArgs' + +## MshVrtPsnArgs +[tagmshvrtpsnargs]: # (mshvrtpsnargs) + +This error occurs when vertexposition receives invalid arguments. It expects a vertex id: + + var m = Mesh() + m.vertexposition() // Causes 'MshVrtPsnArgs' + +## MshInvldId +[tagmshinvldid]: # (mshinvldid) + +This error occurs when an invalid element id is used: + + var m = Mesh() + m.element(-1) // Causes 'MshInvldId' + +## MshCnnMtxArgs +[tagmshcnnmtxargs]: # (mshcnnmtxargs) + +This error occurs when connectivitymatrix receives invalid arguments. It expects integer arguments: + + var m = Mesh() + m.connectivitymatrix("invalid") // Causes 'MshCnnMtxArgs' + +## MshAddGrdArgs +[tagmshaddgrdargs]: # (mshaddgrdargs) + +This error occurs when addgrade receives invalid arguments. It expects either an integer grade and optionally a sparse connectivity matrix: + + var m = Mesh() + m.addgrade("invalid") // Causes 'MshAddGrdArgs' + +## MshAddGrdOutOfBnds +[tagmshaddgrdoutofbnds]: # (mshaddgrdoutofbnds) + +This error occurs when attempting to add elements of a grade that exceeds the mesh's maximum grade: + + var m = Mesh() + m.addgrade(10) // Causes 'MshAddGrdOutOfBnds' if max grade is lower + +## MshAddSymArgs +[tagmshaddsymargs]: # (mshaddsymargs) + +This error occurs when addsymmetry receives invalid arguments. It expects an object that provides a transform method and optionally a selection: + + var m = Mesh() + m.addsymmetry("invalid") // Causes 'MshAddSymArgs' + +## MshAddSymMsngTrnsfrm +[tagmshaddsymmsngtrnsfrm]: # (mshaddsymmsngtrnsfrm) + +This error occurs when addsymmetry receives an object that doesn't provide a transform method: + + var m = Mesh() + var obj = Object() + m.addsymmetry(obj) // Causes 'MshAddSymMsngTrnsfrm' + +## SlNoMsh +[tagslnomsh]: # (slnomsh) + +This error occurs when a Selection operation requires a Mesh object but doesn't receive one: + + var s = Selection("invalid") // Causes 'SlNoMsh' + +## SlIsSlArg +[tagslisslarg]: # (slisslarg) + +This error occurs when Selection.isselected receives invalid arguments. It requires a grade and element id: + + var s = Selection(mesh) + s.isselected(1) // Causes 'SlIsSlArg' (missing element id) + +## SlGrdArg +[tagslgrdarg]: # (slgrdarg) + +This error occurs when a Selection method requires a grade as an argument but doesn't receive one: + + var s = Selection(mesh) + s.method() // Causes 'SlGrdArg' if grade required + +## SlStArg +[tagslstarg]: # (slstarg) + +This error occurs when Selection set methods receive invalid arguments. They require a selection: + + var s = Selection(mesh) + s.union("invalid") // Causes 'SlStArg' + +## SlBnd +[tagslbnd]: # (slbnd) + +This error occurs when a mesh has no boundary elements: + + var m = Mesh() + m.boundary() // Causes 'SlBnd' if no boundary exists + +## FldMshArg +[tagfldmsharg]: # (fldmsharg) + +This error occurs when Field receives invalid arguments. It expects a mesh as its first argument: + + var f = Field("invalid") // Causes 'FldMshArg' + +## FldArgs +[tagfldargs]: # (fldargs) + +This error occurs when Field receives invalid optional arguments. It allows 'grade' as an optional argument. + +## FldBnds +[tagfldbnds]: # (fldbnds) + +This error occurs when a Field index is out of bounds: + + var f = Field(mesh) + f[100, 100, 100] // Causes 'FldBnds' if out of bounds + +## FldInvldIndx +[tagfldinvldindx]: # (fldinvldindx) + +This error occurs when Field indices are not numerical: + + var f = Field(mesh) + f["x", "y", "z"] // Causes 'FldInvldIndx' + +## FldInvldArg +[tagfldinvldarg]: # (fldinvldarg) + +This error occurs when Field arithmetic methods receive invalid arguments. They expect a field or number: + + var f = Field(mesh) + f + "string" // Causes 'FldInvldArg' + +## FldIncmptbl +[tagfldincmptbl]: # (fldincmptbl) + +This error occurs when fields have incompatible shapes: + + var f1 = Field(mesh1) + var f2 = Field(mesh2) + f1 + f2 // Causes 'FldIncmptbl' if shapes incompatible + +## FldIncmptblVal +[tagfldincmptblval]: # (fldincmptblval) + +This error occurs when an assignment value has an incompatible shape with field elements: + + var f = Field(mesh) + f[0, 0, 0] = Matrix([[1,2,3,4]]) // Causes 'FldIncmptblVal' if shape doesn't match + +## FldOp +[tagfldop]: # (fldop) + +This error occurs when Field.op receives invalid arguments. It requires a callable object as the first argument and fields of compatible shape as other arguments: + + var f = Field(mesh) + f.op("not callable", f) // Causes 'FldOp' + +## FldOpFn +[tagfldopfn]: # (fldopfn) + +This error occurs when Field.op cannot construct a Field from the return value of the function: + + var f = Field(mesh) + f.op(fn(x) { return "invalid" }, f) // Causes 'FldOpFn' + +## FnSpcArgs +[tagfnspcargs]: # (fnspcargs) + +This error occurs when a FunctionSpace is created with invalid arguments. It must be initialized with a label and a grade: + + FunctionSpace("invalid") // Causes 'FnSpcArgs' + +## FnSpcNtFnd +[tagfnspcntfnd]: # (fnspcntfnd) + +This error occurs when a function space cannot be found: + + FunctionSpace.find("nonexistent", 1) // Causes 'FnSpcNtFnd' + +## FnctlIntMsh +[tagfnctlintmsh]: # (fnctlintmsh) + +This error occurs when a functional's integrand method requires a mesh as an argument but doesn't receive one: + + var func = Length() + func.integrand() // Causes 'FnctlIntMsh' + +## FnctlELNtFnd +[tagfnctleltfnd]: # (fnctleltfnd) + +This error occurs when a mesh doesn't provide elements of the required grade: + + var func = Length() + func.integrand(mesh) // Causes 'FnctlELNtFnd' if mesh lacks required grade + +## FnctlArgs +[tagfnctlargs]: # (fnctlargs) + +This error occurs when invalid arguments are passed to a functional method. + +## VolEnclZero +[tagvolenclzero]: # (volenclzero) + +This error occurs when VolumeEnclosed detects an element of zero size. Check that a mesh point is not coincident with the origin: + + var func = VolumeEnclosed() + func.total(mesh) // Causes 'VolEnclZero' if element has zero size + +## LnElstctyRef +[taglnelstctyref]: # (lnelstctyref) + +This error occurs when LinearElasticity requires a mesh as an argument but doesn't receive one: + + var func = LinearElasticity() + func.total() // Causes 'LnElstctyRef' + +## LnElstctyPrp +[taglnelstctyprp]: # (lnelstctyprp) + +This error occurs when LinearElasticity is missing required properties. It requires 'reference' to be a mesh, 'grade' to be an integer, and 'poissonratio' to be a number: + + var func = LinearElasticity() + func.reference = "invalid" // Causes 'LnElstctyPrp' + +## HydrglArgs +[taghydrglargs]: # (hydrglargs) + +This error occurs when Hydrogel receives invalid arguments. It requires a reference mesh and allows 'grade', 'a', 'b', 'c', 'd', 'phi0', and 'phiref' as optional arguments. + +## HydrglPrp +[taghydrglprp]: # (hydrglprp) + +This error occurs when Hydrogel is missing required properties. It requires the first argument to be a mesh, 'grade' to be an integer, 'a', 'b', 'c', 'd', 'phiref' to be numbers, and 'phi0' to be a number or Field. + +## HydrglFldGrd +[taghydrglfldgrd]: # (hydrglfldgrd) + +This error occurs when Hydrogel is given phi0 as a Field that lacks scalar elements in the required grade. + +## HydrglZrRfVl +[taghydrglzrrfvl]: # (hydrglzrrfvl) + +This error occurs when a Hydrogel reference element has a tiny volume. This is a warning. + +## HydrglBnds +[taghydrglbnds]: # (hydrglbnds) + +This error occurs when phi is outside bounds in a Hydrogel calculation. This is a warning. + +## EquiElArgs +[tagequielargs]: # (equielargs) + +This error occurs when EquiElement receives invalid arguments. It allows 'grade' and 'weight' as optional arguments. + +## GradSqArgs +[taggradsqargs]: # (gradsqargs) + +This error occurs when GradSq receives invalid arguments. It requires a field as the argument: + + var func = GradSq() + func.total("invalid") // Causes 'GradSqArgs' + +## NmtcArgs +[tagnmtcargs]: # (nmtcargs) + +This error occurs when Nematic receives invalid arguments. It requires a field as the argument: + + var func = Nematic() + func.total("invalid") // Causes 'NmtcArgs' + +## NmtcElArgs +[tagnmtcelargs]: # (nmtcelargs) + +This error occurs when NematicElectric receives invalid arguments. It requires the director and electric field or potential as arguments (in that order). + +## SclrPtFnCllbl +[tagsclrptfncllbl]: # (sclrptfncllbl) + +This error occurs when a ScalarPotential function is not callable: + + var func = ScalarPotential() + func.function = "invalid" // Causes 'SclrPtFnCllbl' + +## IntgrlArgs +[tagintgrlargs]: # (intgrlargs) + +This error occurs when an Integral functional receives invalid arguments. It requires a callable argument followed by zero or more Fields: + + var func = LineIntegral() + func.total("invalid") // Causes 'IntgrlArgs' + +## IntgrlMthdDct +[tagintgrlmthddct]: # (intgrlmthddct) + +This error occurs when an Integral's method argument is not a Dictionary containing configuration settings: + + var func = LineIntegral() + func.method = "invalid" // Causes 'IntgrlMthdDct' + +## IntgrlFld +[tagintgrlfld]: # (intgrlfld) + +This error occurs when an Integral cannot identify a field: + + var func = LineIntegral() + func.total(fn(x) { return x }, "invalid") // Causes 'IntgrlFld' + +## IntgrlGrdEvl +[tagintgrlgrdevl]: # (intgrlgrdevl) + +This error occurs when gradient evaluation fails in an Integral: + + var func = LineIntegral() + func.gradient(mesh) // Causes 'IntgrlGrdEvl' if evaluation fails + +## IntgrlAmbgsFld +[tagintgrlambgsfld]: # (intgrlambgsfld) + +This error occurs when a field reference is ambiguous in an Integral. Call with a Field object: + + var func = LineIntegral() + func.total(fn(x) { return x }) // Causes 'IntgrlAmbgsFld' if ambiguous + +## IntgrlNFlds +[tagintgrlnflds]: # (intgrlnflds) + +This error occurs when an incorrect number of Fields is provided for an integrand function: + + var func = LineIntegral() + func.total(fn(x, y) { return x + y }, field1) // Causes 'IntgrlNFlds' if wrong number + +## IntgrlSpclFn +[tagintgrlspclfn]: # (intgrlspclfn) + +This error occurs when a special function is called outside of an Integral: + + tangent() // Causes 'IntgrlSpclFn' (must be called within integrand) + +## IntgrtrSbdvns +[tagintgrtrsbdvns]: # (intgrtrsbdvns) + +This error occurs when too many subdivisions are needed in evaluating an integral, possibly indicating a singularity: + + // Occurs during numerical integration when subdivision limit is exceeded + +## IntgrtrRlNtFnd +[tagintgrtrrlntfnd]: # (intgrtrrlntfnd) + +This error occurs when an integrator quadrature rule cannot be found: + + var method = {"rule": "nonexistent"} + // Causes 'IntgrtrRlNtFnd' when rule doesn't exist + +## IntgrtrRlUnavlb +[tagintgrtrrlunavlb]: # (intgrtrrlunavlb) + +This error occurs when no quadrature rule is available that matches the provided integrator method dictionary: + + var method = {"rule": "invalid", "degree": 100} + // Causes 'IntgrtrRlUnavlb' if no matching rule + +## IntgrtrMthdTyp +[tagintgrtrmthdtyp]: # (intgrtrmthdtyp) + +This error occurs when an integrator method dictionary option has the wrong type: + + var method = {"rule": 123} // Causes 'IntgrtrMthdTyp' if rule must be string + +## DbgSymbl +[tagdbgsymbl]: # (dbgsymbl) + +This error occurs in the debugger when a symbol cannot be found in the current context: + + // Occurs when debugging and accessing a symbol that doesn't exist + +## DbgSymblPrpty +[tagdbgsymblprpty]: # (dbgsymblprpty) + +This error occurs in the debugger when a symbol lacks a requested property: + + // Occurs when debugging and accessing a property that doesn't exist + +## DbgInvldRg +[tagdbginvldrg]: # (dbginvldrg) + +This error occurs in the debugger when an invalid register is accessed: + + // Occurs when debugging and accessing an invalid register + +## DbgInvldGlbl +[tagdbginvldglbl]: # (dbginvldglbl) + +This error occurs in the debugger when an invalid global is accessed: + + // Occurs when debugging and accessing an invalid global + +## DbgInvldInstr +[tagdbginvldinstr]: # (dbginvldinstr) + +This error occurs in the debugger when an invalid instruction is encountered: + + // Occurs when debugging and encountering an invalid instruction + +## DbgRgObj +[tagdbgrgobj]: # (dbgrgobj) + +This error occurs in the debugger when a register doesn't contain an object: + + // Occurs when debugging and expecting an object in a register + +## DbgStPrp +[tagdbgstprp]: # (dbgstprp) + +This error occurs in the debugger when attempting to set a property on an object that doesn't support it: + + // Occurs when debugging and trying to set a property From 8f3e88557d9234fb8643f44c60a16d5f3f059d58 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 08:18:48 -0500 Subject: [PATCH 227/473] Platform independent re-entrant qsort --- help/errors.md | 20 ++++++++++++------ src/classes/list.c | 48 +++++++++++++++++++++++++----------------- src/classes/list.h | 1 + src/support/platform.c | 37 ++++++++++++++++++++++++++++++++ src/support/platform.h | 9 ++++++++ 5 files changed, 90 insertions(+), 25 deletions(-) diff --git a/help/errors.md b/help/errors.md index 133b412ec..8d7ce5e12 100644 --- a/help/errors.md +++ b/help/errors.md @@ -25,6 +25,14 @@ You can also use the `warning` method to alert the user of a potential issue tha myerr.warning() +To see the full list of morpho errors, look at the `errorlist` help entry. + +# Error list +[tagerrorrlist]: # (error list) +[tagerrorlist]: # (errorlist) + +A list of morpho errors: + [showsubtopics]: # (subtopics) ## Alloc @@ -225,8 +233,8 @@ This error occurs when multiple dispatch cannot find a method implementation tha class A { } class B { } - fn method(a: A) { } - fn method(b: B) { } + fn method(A a) { } + fn method(B b) { } method(1) // Causes 'MltplDsptchFld' - no matching method for integer ## TypeChk @@ -234,7 +242,7 @@ This error occurs when multiple dispatch cannot find a method implementation tha This error occurs when there is a type violation, such as attempting to assign a value of one type to a variable declared with a different type: - var x: String = 5 // Causes 'TypeChk' + String x = 5 // Causes 'TypeChk' ## NoOptArg [tagnooptarg]: # (nooptarg) @@ -242,15 +250,15 @@ This error occurs when there is a type violation, such as attempting to assign a This error occurs when you try to pass optional arguments to a function that doesn't accept them: fn f(x) { return x } - f(1, y: 2) // Causes 'NoOptArg' + f(1, y=2) // Causes 'NoOptArg' ## UnkwnOptArg [tagunkwnoptarg]: # (unkwnoptarg) This error occurs when you pass an unknown optional argument to a function: - fn f(x, y: 1) { return x + y } - f(1, z: 2) // Causes 'UnkwnOptArg' + fn f(x, y=1) { return x + y } + f(1, z=2) // Causes 'UnkwnOptArg' ## InvldArgsBltn [taginvldargsbltn]: # (invldargsbltn) diff --git a/src/classes/list.c b/src/classes/list.c index e5558eaf3..354764b0c 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -130,35 +130,45 @@ int list_sortfunction(const void *a, const void *b) { } /** Sort the contents of a list */ -void list_sort(objectlist *list) { - qsort(list->val.data, list->val.count, sizeof(value), list_sortfunction); +void list_sortcontents(value *values, size_t count) { + qsort(values, count, sizeof(value), list_sortfunction); } -static vm *list_sortwithfn_vm; -static value list_sortwithfn_fn; -static bool list_sortwithfn_err; - -/** Sort function for list_sort */ -int list_sortfunctionwfn(const void *a, const void *b) { - value args[2] = {*(value *) a, *(value *) b}; - value ret; +/** Sort the contents of a list */ +void list_sort(objectlist *list) { + list_sortcontents(list->val.data, list->val.count); +} - if (morpho_call(list_sortwithfn_vm, list_sortwithfn_fn, 2, args, &ret)) { +/** Sort the contents of a list using a re-entrant comparison function */ +typedef struct { + vm *v; + value cmpfn; + bool errq; +} _sortfninfo; + +static int _sortfn(const void *a, const void *b, void *context) { + _sortfninfo *info = (_sortfninfo *) context; + value ret, args[2] = {*(value *) a, *(value *) b}; + + if (morpho_call(info->v, info->cmpfn, 2, args, &ret)) { if (MORPHO_ISINTEGER(ret)) return MORPHO_GETINTEGERVALUE(ret); if (MORPHO_ISFLOAT(ret)) return morpho_comparevalue(MORPHO_FLOAT(0), ret); } - - list_sortwithfn_err=true; + + info->errq=true; return 0; } +/** Sort a list of values */ +bool list_sortcontentswithfn(vm *v, value cmpfn, value *values, size_t count) { + _sortfninfo info = { .v = v, .cmpfn = cmpfn, .errq=false }; + platform_qsort_r(values, count, sizeof(value), &info, _sortfn); + return !info.errq; +} + /** Sort the contents of a list */ -bool list_sortwithfn(vm *v, value fn, objectlist *list) { - list_sortwithfn_vm=v; - list_sortwithfn_fn=fn; - list_sortwithfn_err=false; - qsort(list->val.data, list->val.count, sizeof(value), list_sortfunctionwfn); - return !list_sortwithfn_err; +bool list_sortwithfn(vm *v, value cmpfn, objectlist *list) { + return list_sortcontentswithfn(v, cmpfn, list->val.data, list->val.count); } /** Sort function for list_order */ diff --git a/src/classes/list.h b/src/classes/list.h index ba7feb88d..56342480c 100644 --- a/src/classes/list.h +++ b/src/classes/list.h @@ -77,6 +77,7 @@ bool list_resize(objectlist *list, int size); void list_append(objectlist *list, value v); unsigned int list_length(objectlist *list); bool list_getelement(objectlist *list, int i, value *out); +void list_sortcontents(value *values, size_t count); void list_sort(objectlist *list); objectlist *list_clone(objectlist *list); diff --git a/src/support/platform.c b/src/support/platform.c index 6aef4747a..35556abf8 100644 --- a/src/support/platform.c +++ b/src/support/platform.c @@ -51,6 +51,43 @@ const char *platform_name(void) { return NULL; // Unrecognized platform } +/* ********************************************************************** + * Re-entrant qsort + * ********************************************************************** */ + +typedef struct _sadapt { + void *context; + platform_qsort_r_comparefn cmp; +} _adaptinfo; + +/** Adapter function to patch macOS, BSD and windows variants of qsort_r */ +static int _comparefn_adapter(void *in, const void *a, const void *b) { + _adaptinfo *info = (_adaptinfo *) in; + return info->cmp(a,b,info->context); +} + +/** Fallback function for use with regular qsort @warning not thread-safe */ +static _adaptinfo _globalinfo; +static int _comparefn_fallback(const void *a, const void *b) { + return _globalinfo.cmp(a,b,_globalinfo.context); +} + +/** Platform independent re-entrant qsort function */ +void platform_qsort_r(void *base, size_t nel, size_t width, void *context, platform_qsort_r_comparefn cmp) { +#if defined(__GLIBC__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) + qsort_r(base, nel, width, cmp, context); +#elif defined(__APPLE__) + _adaptinfo info = { .context = context, .cmp = cmp }; + qsort_r(base, nel, width, &info, _comparefn_adapter); +#elif defined(_WIN32) + _adaptinfo info = { .context = context, .cmp = cmp }; + qsort_s(base, nel, width, _comparefn_adapter, &info); +#else + _globalinfo.cmp = cmp; _globalinfo.context = context; + qsort(base, nel, width, _comparefn_fallback); +#endif +} + /* ********************************************************************** * Random numbers * ********************************************************************** */ diff --git a/src/support/platform.h b/src/support/platform.h index 2d07d90c9..bf56ab193 100644 --- a/src/support/platform.h +++ b/src/support/platform.h @@ -30,6 +30,15 @@ const char *platform_name(void); +/* ------------------------------------------------------- + * Re-entrant qsort + * ------------------------------------------------------- */ + +typedef int (*platform_qsort_r_comparefn)(const void *, const void *, void *); + +/** Sort elements with additional context passed to the comparator function */ +void platform_qsort_r(void *base, size_t nel, size_t width, void *context, platform_qsort_r_comparefn cmp); + /* ------------------------------------------------------- * Random numbers * ------------------------------------------------------- */ From 34b9650cbc47c3bfd201635fc7eb24a1da9a1743 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 08:34:22 -0500 Subject: [PATCH 228/473] Tuple sort functions --- src/classes/list.c | 15 --------------- src/classes/list.h | 3 +++ src/classes/tuple.c | 29 +++++++++++++++++++++++++++++ test/tuple/tuple_sort.morpho | 10 ++++++++++ test/tuple/tuple_sort_fn.morpho | 14 ++++++++++++++ 5 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 test/tuple/tuple_sort.morpho create mode 100644 test/tuple/tuple_sort_fn.morpho diff --git a/src/classes/list.c b/src/classes/list.c index 354764b0c..5569e0a57 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -622,21 +622,6 @@ value List_roll(vm *v, int nargs, value *args) { return out; } -/** Sorts a list */ -value XList_sort(vm *v, int nargs, value *args) { - objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); - - if (nargs==0) { - list_sort(slf); - } else if (nargs==1 && MORPHO_ISCALLABLE(MORPHO_GETARG(args, 0))) { - if (!list_sortwithfn(v, MORPHO_GETARG(args, 0), slf)) { - morpho_runtimeerror(v, LIST_SRTFN); - } - } - - return MORPHO_NIL; -} - /** Sorts a list */ value List_sort(vm *v, int nargs, value *args) { list_sort(MORPHO_GETLIST(MORPHO_SELF(args))); diff --git a/src/classes/list.h b/src/classes/list.h index 56342480c..f0b0a521d 100644 --- a/src/classes/list.h +++ b/src/classes/list.h @@ -79,6 +79,9 @@ unsigned int list_length(objectlist *list); bool list_getelement(objectlist *list, int i, value *out); void list_sortcontents(value *values, size_t count); void list_sort(objectlist *list); +bool list_sortcontentswithfn(vm *v, value cmpfn, value *values, size_t count); +bool list_sortwithfn(vm *v, value cmpfn, objectlist *list); + objectlist *list_clone(objectlist *list); void list_initialize(void); diff --git a/src/classes/tuple.c b/src/classes/tuple.c index a73ec2d25..dd256f56e 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -257,6 +257,33 @@ value Tuple_join(vm *v, int nargs, value *args) { return out; } +/** Sorts the contents of a tuple, returning a new tuple */ +value Tuple_sort(vm *v, int nargs, value *args) { + objecttuple *src = MORPHO_GETTUPLE(MORPHO_SELF(args)); + + objecttuple *new = object_newtuple(src->length, src->tuple); + if (new) list_sortcontents(new->tuple, new->length); + + return morpho_wrapandbind(v, (object *) new); +} + +/** Sorts the contents of a tuple using a comparison function, returning a new tuple */ +value Tuple_sort_fn(vm *v, int nargs, value *args) { + objecttuple *src = MORPHO_GETTUPLE(MORPHO_SELF(args)); + + objecttuple *new=object_newtuple(src->length, src->tuple); + if (new) { + bool success=list_sortcontentswithfn(v, MORPHO_GETARG(args, 0), new->tuple, new->length); + if (!success) { + morpho_runtimeerror(v, LIST_SRTFN); + object_free((object *) new); + return MORPHO_NIL; + } + } + + return morpho_wrapandbind(v, (object *) new); +} + /** Tests if a tuple has a value as a member */ value Tuple_ismember(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); @@ -276,6 +303,8 @@ MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (_)", Tuple_join, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (_)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/test/tuple/tuple_sort.morpho b/test/tuple/tuple_sort.morpho new file mode 100644 index 000000000..907bc1fd2 --- /dev/null +++ b/test/tuple/tuple_sort.morpho @@ -0,0 +1,10 @@ +// Tuple sort + +var a = ( 4, 3, 2, 7, 8, 1, 10, 9, 6, 5 ) +var b = a.sort() + +print b +// expect: (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) + +print a==b +// expect: false diff --git a/test/tuple/tuple_sort_fn.morpho b/test/tuple/tuple_sort_fn.morpho new file mode 100644 index 000000000..537a8d26b --- /dev/null +++ b/test/tuple/tuple_sort_fn.morpho @@ -0,0 +1,14 @@ +// Tuple sort with comparison function + +fn cmp(a, b) { + return -(a-b) +} + +var a = ( 4, 3, 2, 7, 8, 1, 10, 9, 6, 5 ) +var b = a.sort(cmp) + +print b +// expect: (10, 9, 8, 7, 6, 5, 4, 3, 2, 1) + +print a==b +// expect: false From df0f3225ca0e259c9c6563d5ad37fb725e8d2ffa Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 08:38:51 -0500 Subject: [PATCH 229/473] Remove extraneous spaces --- test/tuple/tuple_sort.morpho | 2 +- test/tuple/tuple_sort_fn.morpho | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tuple/tuple_sort.morpho b/test/tuple/tuple_sort.morpho index 907bc1fd2..9757d05ed 100644 --- a/test/tuple/tuple_sort.morpho +++ b/test/tuple/tuple_sort.morpho @@ -7,4 +7,4 @@ print b // expect: (1, 2, 3, 4, 5, 6, 7, 8, 9, 10) print a==b -// expect: false +// expect: false diff --git a/test/tuple/tuple_sort_fn.morpho b/test/tuple/tuple_sort_fn.morpho index 537a8d26b..555a35ff5 100644 --- a/test/tuple/tuple_sort_fn.morpho +++ b/test/tuple/tuple_sort_fn.morpho @@ -11,4 +11,4 @@ print b // expect: (10, 9, 8, 7, 6, 5, 4, 3, 2, 1) print a==b -// expect: false +// expect: false From 4d48f7f4a703aedb7a73783e38a8423d27fe20f3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 09:37:52 -0500 Subject: [PATCH 230/473] Add non-camelcase method name for Matrix.setColumn --- src/linalg/matrix.c | 1 + src/linalg/matrix.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index c796c37c7..f0d197ddf 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1488,6 +1488,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__ MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD_DEPRECATED, "(Int, Matrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 65ebc1b0e..10c9cb1cd 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -172,6 +172,7 @@ matrixinterfacedefn *matrix_getinterface(objectmatrix *a); #define MATRIX_OUTER_METHOD "outer" #define MATRIX_RESHAPE_METHOD "reshape" #define MATRIX_ROLL_METHOD "roll" +#define MATRIX_SETCOLUMN_METHOD_DEPRECATED "setcolumn" #define MATRIX_SETCOLUMN_METHOD "setColumn" #define MATRIX_TRACE_METHOD "trace" #define MATRIX_TRANSPOSE_METHOD "transpose" From 0dac41d72a2cd905eefed656790090d1985b7342 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 10:32:58 -0500 Subject: [PATCH 231/473] Fix return type check in sparsedok_copymatrixat --- src/linalg/matrix.c | 9 +++++++++ src/linalg/sparse.c | 6 +++--- test/sparse/concatenate.morpho | 2 +- test/sparse/incompatible_add.morpho | 2 +- test/sparse/incompatible_mul.morpho | 2 +- test/sparse/sparse_dense_mul.morpho | 2 +- test/sparse/sparse_dense_mul_dimensions.morpho | 4 ++-- 7 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index f0d197ddf..b11cfb8e0 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -780,6 +780,14 @@ value matrix_constructor__array(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/** Constructs a matrix from a sparse matrix */ +value matrix_constructor__sparse(vm *v, int nargs, value *args) { + objectmatrix *new = NULL; + objectsparseerror err=sparse_tomatrix(MORPHO_GETSPARSE(MORPHO_GETARG(args, 0)), &new); + if (err!=SPARSE_OK) morpho_runtimeerror(v, LINALG_INVLDARGS); + return morpho_wrapandbind(v, (object *) new); +} + value matrix_constructor__err(vm *v, int nargs, value *args) { morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); return MORPHO_NIL; @@ -1544,6 +1552,7 @@ void matrix_initialize(void) { morpho_addfunction(MATRIX_CLASSNAME, "Matrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); + //morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Sparse)", matrix_constructor__sparse, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/linalg/sparse.c b/src/linalg/sparse.c index 0157363e1..7047aa7b5 100644 --- a/src/linalg/sparse.c +++ b/src/linalg/sparse.c @@ -270,7 +270,7 @@ bool sparsedok_copymatrixat(objectmatrix *src, sparsedok *dest, int row0, int co double val; for (int j=0; jncols; j++) { for (int i=0; inrows; i++) { - if (!(matrix_getelement(src, i, j, &val) && + if (!(matrix_getelement(src, i, j, &val)==LINALGERR_OK && sparsedok_insert(dest, i+row0, j+col0, MORPHO_FLOAT(val)))) return false; } } @@ -1813,14 +1813,14 @@ void sparse_initialize(void) { objectdokkeytype=object_addtype(&objectdokkeydefn); objectsparsetype=object_addtype(&objectsparsedefn); - builtin_addfunction(SPARSE_CLASSNAME, sparse_constructor, MORPHO_FN_CONSTRUCTOR); - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); value sparseclass=builtin_addclass(SPARSE_CLASSNAME, MORPHO_GETCLASSDEFINITION(Sparse), objclass); object_setveneerclass(OBJECT_SPARSE, sparseclass); + builtin_addfunction(SPARSE_CLASSNAME, sparse_constructor, MORPHO_FN_CONSTRUCTOR); + morpho_defineerror(SPARSE_CONSTRUCTOR, ERROR_HALT, SPARSE_CONSTRUCTOR_MSG); morpho_defineerror(SPARSE_SETFAILED, ERROR_HALT, SPARSE_SETFAILED_MSG); morpho_defineerror(SPARSE_INVLDARRAYINIT, ERROR_HALT, SPARSE_INVLDARRAYINIT_MSG); diff --git a/test/sparse/concatenate.morpho b/test/sparse/concatenate.morpho index 9ea350270..063af5773 100644 --- a/test/sparse/concatenate.morpho +++ b/test/sparse/concatenate.morpho @@ -24,4 +24,4 @@ print c // expect: [ 2 3 2 3 0 ] var c = Sparse([[a, b], [b, 0]]) -// expect error 'MtrxIncmptbl' +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/sparse/incompatible_add.morpho b/test/sparse/incompatible_add.morpho index 5e85bd394..8cbcb0146 100644 --- a/test/sparse/incompatible_add.morpho +++ b/test/sparse/incompatible_add.morpho @@ -4,4 +4,4 @@ var a = Sparse([[0,0,1],[1,1,1],[1,2,-1],[2,1,-1],[2,2,1],[3,3,1]]) var b = Sparse([[0,1,1],[1,0,1]]) print a+b -// expect Error: 'MtrxIncmptbl' +// expect Error: 'LnAlgMtrxIncmptbl' diff --git a/test/sparse/incompatible_mul.morpho b/test/sparse/incompatible_mul.morpho index 507502827..c6b4437cb 100644 --- a/test/sparse/incompatible_mul.morpho +++ b/test/sparse/incompatible_mul.morpho @@ -4,4 +4,4 @@ var a = Sparse([[0,0,1],[1,1,1],[1,2,-1],[2,1,-1],[2,2,1],[3,3,1]]) var b = Sparse([[0,1,1],[1,0,1]]) print a*b -// expect Error: 'MtrxIncmptbl' +// expect Error: 'LnAlgMtrxIncmptbl' diff --git a/test/sparse/sparse_dense_mul.morpho b/test/sparse/sparse_dense_mul.morpho index 3c4c2abb6..6e086085b 100644 --- a/test/sparse/sparse_dense_mul.morpho +++ b/test/sparse/sparse_dense_mul.morpho @@ -13,4 +13,4 @@ print A*B.transpose() // expect: [ 8 16 ] print A*B -// expect error 'MtrxIncmptbl' \ No newline at end of file +// expect error 'LnAlgMtrxIncmptbl' \ No newline at end of file diff --git a/test/sparse/sparse_dense_mul_dimensions.morpho b/test/sparse/sparse_dense_mul_dimensions.morpho index 19471eaed..af985fd8a 100644 --- a/test/sparse/sparse_dense_mul_dimensions.morpho +++ b/test/sparse/sparse_dense_mul_dimensions.morpho @@ -11,9 +11,9 @@ for (i in 0...N) { var b = Matrix(List(1..N)) print A.dimensions() // expect: [ 6, 3 ] -print b.dimensions() // expect: [ 3, 1 ] +print b.dimensions() // expect: (3, 1) -print (A*b).dimensions() // expect: [ 6, 1 ] +print (A*b).dimensions() // expect: (6, 1) print A*b // expect: [ 1 ] From bd94b313c4ea692faa52b99100d654a98c154776 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 10:48:08 -0500 Subject: [PATCH 232/473] Fix field initialization to match new matrix type --- src/geometry/field.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/geometry/field.c b/src/geometry/field.c index 32bd5b267..cb4699a06 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -153,6 +153,8 @@ objectfield *object_newfield(objectmesh *mesh, value prototype, value fnspc, uns object_init(&new->data.obj, OBJECT_MATRIX); new->data.ncols=1; new->data.nrows=size; + new->data.nvals=1; + new->data.nels=new->data.ncols*new->data.nrows*new->data.nvals; new->data.elements=new->data.matrixdata; if (MORPHO_ISMATRIX(prototype)) { From 0e591d1361157a8d161c1e204f2413ae97c01225 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 19:54:49 -0500 Subject: [PATCH 233/473] Fix test for zero in eigenvalue creation --- src/linalg/matrix.c | 3 ++- test/matrix/eigenvalues.morpho | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index b11cfb8e0..22592896e 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1179,7 +1179,8 @@ static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *o value ev[n]; for (int i=0; i DBL_MIN ? fabs(cimag(w[i]))/abs <= MORPHO_EPS : fabs(cimag(w[i])) < DBL_MIN) { ev[i]=MORPHO_FLOAT(creal(w[i])); } else { objectcomplex *new = object_newcomplex(creal(w[i]), cimag(w[i])); diff --git a/test/matrix/eigenvalues.morpho b/test/matrix/eigenvalues.morpho index 562f3d62d..7fa8407c1 100644 --- a/test/matrix/eigenvalues.morpho +++ b/test/matrix/eigenvalues.morpho @@ -5,7 +5,7 @@ var a = Matrix([[1,-1,0], [-1,1,0], [0,0,1]]) var ev = a.eigenvalues() ev.sort() print ev -// expect: [ 0, 1, 2 ] +// expect: (0, 1, 2) var b = Matrix([[1,2,0], [-2,1,0], [0,0,1]]) @@ -22,7 +22,7 @@ print a // ensure a is not overwritten var es = a.eigensystem() print es[0] -// expect: [ 2, 0, 1 ] +// expect: (2, 0, 1) print es[1] // expect: [ 0.707107 0.707107 0 ] // expect: [ -0.707107 0.707107 0 ] From e2d36688f87bbc2fc6c7b91de536494c50501337 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:39:08 -0500 Subject: [PATCH 234/473] Add delayed signature parsing --- src/builtin/builtin.c | 50 +++++++++++++++++++++++++++++----- src/builtin/builtin.h | 3 ++ src/core/vm.c | 2 +- src/datastructures/signature.c | 4 +-- src/datastructures/signature.h | 2 +- src/linalg/matrix.c | 2 +- src/linalg/sparse.c | 2 +- src/support/extensions.c | 1 + 8 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 705b3f8c3..313bc940e 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -162,6 +162,39 @@ objecttypedefn objectbuiltinfunctiondefn = { .cmpfn=NULL }; +/* ********************************************************************** + * Signature parsing + * ********************************************************************** */ + +/** This mechanism allows builtin classes to cross-reference one another in method signature declarations */ + +typedef struct _sigparses { + const char *sig; + signature *dest; +} _sigparse; + +DECLARE_VARRAY(_sigparse, _sigparse) +DEFINE_VARRAY(_sigparse, _sigparse) + +varray__sigparse sigparseworklist; + +/** Add a signature to be parsed on the next call to builtin_parsesignatures */ +void builtin_addparsesignature(const char *sig, signature *dest) { + _sigparse s = { .sig = sig, .dest = dest }; + varray__sigparsewrite(&sigparseworklist, s); +} + +/** Parses all signatures on the worklist */ +bool builtin_parsesignatures(void) { + _sigparse s; + while (varray__sigparsepop(&sigparseworklist, &s)) { + if (!signature_parse(s.sig, s.dest)) { + return false; + } + } + return true; +} + /* ********************************************************************** * Create and find builtin functions * ********************************************************************** */ @@ -264,10 +297,7 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built if (!name) goto morpho_addfunction_cleanup; // Parse function signature if provided - if (signature && - !signature_parse(signature, &new->sig)) { - UNREACHABLE("Syntax error in signature definition."); - } + if (signature) builtin_addparsesignature(signature, &new->sig); value newfn = MORPHO_OBJECT(new); @@ -340,9 +370,7 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * newmethod->klass=new; newmethod->name=object_stringfromcstring(desc[i].name, strlen(desc[i].name)); newmethod->flags=desc[i].flags; - if (desc[i].signature) { - success &= signature_parse(desc[i].signature, &newmethod->sig); - } + if (desc[i].signature) builtin_addparsesignature(desc[i].signature, &newmethod->sig); dictionary_intern(&builtin_symboltable, newmethod->name); value method = MORPHO_OBJECT(newmethod); @@ -429,6 +457,8 @@ void builtin_initialize(void) { objectclasstype=object_addtype(&objectclassdefn); objectbuiltinfunctiontype=object_addtype(&objectbuiltinfunctiondefn); + varray__sigparseinit(&sigparseworklist); + /* Initialize builtin classes and functions */ instance_initialize(); // Must initialize first so that Object exists @@ -473,6 +503,10 @@ void builtin_initialize(void) { // Initialize geometry geometry_initialize(); #endif + + if (!builtin_parsesignatures()) { + UNREACHABLE("Syntax error in signature."); + } morpho_addfinalizefn(builtin_finalize); } @@ -484,6 +518,8 @@ void builtin_finalize(void) { builtin_objects=next; } + varray__sigparseclear(&sigparseworklist); + dictionary_clear(&builtin_functiontable); dictionary_clear(&builtin_classtable); dictionary_clear(&builtin_symboltable); diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index c5d0dd496..e9c106fdd 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -16,6 +16,9 @@ #include "signature.h" +/** Call to pase method and function signatures */ +bool builtin_parsesignatures(void); + /* ------------------------------------------------------- * Built in function objects * ------------------------------------------------------- */ diff --git a/src/core/vm.c b/src/core/vm.c index 60b98a419..22ae04e51 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -1770,7 +1770,7 @@ value morpho_wrapandbind(vm *v, object *obj) { if (obj) { out=MORPHO_OBJECT(obj); morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + } else if (!morpho_checkerror(&v->err)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return out; } diff --git a/src/datastructures/signature.c b/src/datastructures/signature.c index c83248c01..ca12b0201 100644 --- a/src/datastructures/signature.c +++ b/src/datastructures/signature.c @@ -106,7 +106,7 @@ tokendefn sigtokens[] = { }; /** @brief Initializes a lexer for parsing signatures */ -void signature_initializelexer(lexer *l, char *signature) { +void signature_initializelexer(lexer *l, const char *signature) { lex_init(l, signature, 0); lex_settokendefns(l, sigtokens); lex_seteof(l, SIGNATURE_EOF); @@ -178,7 +178,7 @@ bool signature_parsesignature(parser *p, void *out) { } /** Parses a signature */ -bool signature_parse(char *sig, signature *out) { +bool signature_parse(const char *sig, signature *out) { error err; error_init(&err); diff --git a/src/datastructures/signature.h b/src/datastructures/signature.h index 028ca4d1e..18ddc6507 100644 --- a/src/datastructures/signature.h +++ b/src/datastructures/signature.h @@ -31,7 +31,7 @@ value signature_getreturntype(signature *s); int signature_countparams(signature *s); void signature_set(signature *s, int nparam, value *types); -bool signature_parse(char *sig, signature *out); +bool signature_parse(const char *sig, signature *out); void signature_print(signature *s); diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 22592896e..fcdb2d2bc 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1553,7 +1553,7 @@ void matrix_initialize(void) { morpho_addfunction(MATRIX_CLASSNAME, "Matrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); - //morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Sparse)", matrix_constructor__sparse, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Sparse)", matrix_constructor__sparse, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); diff --git a/src/linalg/sparse.c b/src/linalg/sparse.c index 7047aa7b5..575e850ab 100644 --- a/src/linalg/sparse.c +++ b/src/linalg/sparse.c @@ -288,7 +288,7 @@ bool sparsedok_copytomatrix(sparsedok *src, objectmatrix *dest, int row0, int co if (sparsedok_get(src, i, j, &entry)) { double val=0.0; if (!morpho_valuetofloat(entry, &val)) return false; - if (!matrix_setelement(dest, i+row0, j+col0, val)) return false; + if (matrix_setelement(dest, i+row0, j+col0, val)!=LINALGERR_OK) return false; } } diff --git a/src/support/extensions.c b/src/support/extensions.c index ee2d42b51..c6e3a4744 100644 --- a/src/support/extensions.c +++ b/src/support/extensions.c @@ -166,6 +166,7 @@ bool extension_load(char *name, dictionary **functiontable, dictionary **classta } else if (extension_initwithname(&e, name, MORPHO_GETCSTRING(path)) && extension_dlopen(&e)) { success=extension_initialize(&e); + success &= builtin_parsesignatures(); if (success) varray_extensionwrite(&extensionlist, e); } From ace41d7aeb3d0aaeadbdade869228fc7b1c9628b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:44:26 -0500 Subject: [PATCH 235/473] Correct erroneous error checks --- src/geometry/mesh.c | 2 +- src/linalg/sparse.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 98a075a88..7afb6ad8c 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -1001,7 +1001,7 @@ bool mesh_save(objectmesh *m, char *file) { for (unsigned int j=0; jvert->nrows; j++) { double x; - if (matrix_getelement(m->vert, j, i, &x)) { + if (matrix_getelement(m->vert, j, i, &x) == LINALGERR_OK) { fprintf(f, "%g ", x); } } diff --git a/src/linalg/sparse.c b/src/linalg/sparse.c index 575e850ab..cbd825179 100644 --- a/src/linalg/sparse.c +++ b/src/linalg/sparse.c @@ -583,7 +583,7 @@ bool sparseccs_copytomatrix(sparseccs *src, objectmatrix *dest, int row0, int co if (!sparseccs_getrowindices(src, i, &nentries, &entries)) return false; for (int j=0; jvalues[k])) return false; + if (matrix_setelement(dest, entries[j]+row0, i+col0, src->values[k]) != LINALGERR_OK) return false; k++; } } From 238625982be891cb8d8c21a7707276c5bbbb3202 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:51:27 -0500 Subject: [PATCH 236/473] Correct error in test suite --- test/matrix/eigenvalues.morpho | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/matrix/eigenvalues.morpho b/test/matrix/eigenvalues.morpho index 7fa8407c1..b874b4072 100644 --- a/test/matrix/eigenvalues.morpho +++ b/test/matrix/eigenvalues.morpho @@ -3,8 +3,7 @@ var a = Matrix([[1,-1,0], [-1,1,0], [0,0,1]]) var ev = a.eigenvalues() -ev.sort() -print ev +print ev.sort() // expect: (0, 1, 2) var b = Matrix([[1,2,0], [-2,1,0], [0,0,1]]) From 05776929ae09700ce384355a36bb602cf735ef22 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:58:24 -0500 Subject: [PATCH 237/473] Correct MORPHO_STATICMATRIX --- src/linalg/matrix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 10c9cb1cd..3a42e6bef 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -72,7 +72,7 @@ typedef struct { /** @brief Use to create static matrices on the C stack @details Intended for small matrices; Caller needs to supply a double array of size nr*nc. */ -#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nels=nr*nc } +#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nvals=1, .nels=nr*nc } /** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ #define MATRIX_ISSMALL(m) (m->nrows*m->ncols Date: Fri, 16 Jan 2026 21:18:31 -0500 Subject: [PATCH 238/473] Correct field_addpool --- src/geometry/field.c | 2 ++ src/geometry/functional.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/geometry/field.c b/src/geometry/field.c index cb4699a06..6f6927fde 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -312,6 +312,8 @@ bool field_addpool(objectfield *f) { m[i].elements=f->data.elements+i*f->psize; m[i].ncols=prototype->ncols; m[i].nrows=prototype->nrows; + m[i].nvals=prototype->nvals; + m[i].nels=m[i].ncols*m[i].nrows*m[i].nvals; } } return true; diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 0565fc248..2c3cb159b 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -1266,7 +1266,7 @@ bool functional_mapfieldgradient(vm *v, functional_mapinfo *info, value *out) { functional_parallelmap(ntask, task); /* Then add up all the fields using their underlying data stores */ - for (int i=1; idata, &new[0]->data); + for (int i=1; idata, &new[0]->data); // TODO: Use symmetry actions //if (info->sym==SYMMETRY_ADD) functional_symmetrysumforces(info->mesh, new[0]); From bb4278a7dcf2bc99771a41ef6d67f0ad14a0aeaa Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 16 Jan 2026 21:20:33 -0500 Subject: [PATCH 239/473] Correct error message --- test/functionals/err_integrand.morpho | 2 +- test/mesh/out.mesh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/functionals/err_integrand.morpho b/test/functionals/err_integrand.morpho index e155366e7..59f52125c 100644 --- a/test/functionals/err_integrand.morpho +++ b/test/functionals/err_integrand.morpho @@ -19,4 +19,4 @@ var defectsGrad = Field(m, fn(x,y,z) phdgrad(x, y, z, 0.25, 0, 0)+mhdgrad(x, y, var directorIntegral = LineIntegral(fn (x,n) 1/(2*Pi) * n.inner(tangent()), defectsGrad) var fe = directorIntegral.integrand(m) -//expect error 'MtrxIncmptbl' \ No newline at end of file +//expect error 'LnAlgMtrxIncmptbl' \ No newline at end of file diff --git a/test/mesh/out.mesh b/test/mesh/out.mesh index 40cfae01f..ccbfb48f1 100644 --- a/test/mesh/out.mesh +++ b/test/mesh/out.mesh @@ -1,9 +1,9 @@ vertices -1 -2 -3 -4 +1 0 0 0 +2 1 0 0 +3 0 1 0 +4 1 1 0 faces From 6916c7dec5776689aebfcc5a82bc208caf8d1bcc Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 17 Jan 2026 13:06:39 +0000 Subject: [PATCH 240/473] Add list and tuple to indexing --- src/linalg/matrix.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index fcdb2d2bc..dcc9367bb 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -870,13 +870,21 @@ value Matrix_index__int_int(vm *v, int nargs, value *args) { static linalgError_t _slice_count(value in, MatrixIdx_t *count) { if (morpho_isnumber(in)) { *count=1; return LINALGERR_OK; } - else if (MORPHO_ISRANGE(in)) { *count = range_count(MORPHO_GETRANGE(in)); return LINALGERR_OK; } + else if (MORPHO_ISRANGE(in)) { *count = (MatrixIdx_t) range_count(MORPHO_GETRANGE(in)); return LINALGERR_OK; } + else if (MORPHO_ISLIST(in)) { *count = (MatrixIdx_t) list_length(MORPHO_GETLIST(in)); return LINALGERR_OK; } + else if (MORPHO_ISTUPLE(in)) { *count = (MatrixIdx_t) tuple_length(MORPHO_GETTUPLE(in)); return LINALGERR_OK; } return LINALGERR_NON_NUMERICAL; } static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { value val=in; - if (MORPHO_ISRANGE(in)) val=range_iterate(MORPHO_GETRANGE(in), i); + if (MORPHO_ISRANGE(in)) { + val=range_iterate(MORPHO_GETRANGE(in), i); + } else if (MORPHO_ISLIST(in)) { + if (!list_getelement(MORPHO_GETLIST(in), i, &val)) return LINALGERR_INVLD_ARG; + } else if (MORPHO_ISTUPLE(in)) { + if (!tuple_getelement(MORPHO_GETTUPLE(in), i, &val)) return LINALGERR_INVLD_ARG; + } if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return LINALGERR_OK; } else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return LINALGERR_OK; } From e06b4cb9b0585dfe2069361ef862aeb1562315e0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 07:16:43 +0000 Subject: [PATCH 241/473] Fix matrix slicing and permit negative indices --- src/linalg/complexmatrix.c | 14 +++-- src/linalg/matrix.c | 59 ++++++++++++-------- src/linalg/matrix.h | 1 + test/slice/matrixSlicing.morpho | 98 ++++++++++++++++++--------------- 4 files changed, 99 insertions(+), 73 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 84ecb4fb9..8e4ddf901 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -225,9 +225,10 @@ objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, boo /** Sets a matrix element. */ linalgError_t complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); + MatrixIdx_t row_idx = row, col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&row_idx, matrix->nrows)); + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, matrix->ncols)); + MatrixCount_t ix = matrix->nvals*(col_idx*matrix->nrows+row_idx); matrix->elements[ix]=creal(value); matrix->elements[ix+1]=cimag(value); return LINALGERR_OK; @@ -235,9 +236,10 @@ linalgError_t complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t /** Gets a matrix element */ linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); + MatrixIdx_t row_idx = row, col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&row_idx, matrix->nrows)); + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, matrix->ncols)); + MatrixCount_t ix = matrix->nvals*(col_idx*matrix->nrows+row_idx); if (value) *value=MCBuild(matrix->elements[ix],matrix->elements[ix+1]); return LINALGERR_OK; } diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index dcc9367bb..4220fe9b2 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -365,30 +365,45 @@ objectmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, Ma * Accessing elements * ---------------------- */ + /** @brief Validates index bounds, converting negative indices to positive + * @param idx Pointer to the index, updated if valid and negative + * @param size The size of the dimension + * @returns LINALGERR_OK if conversion successful, LINALGERR_INDX_OUT_OF_BNDS if out of bounds */ +linalgError_t matrix_validateindex(MatrixIdx_t *idx, MatrixIdx_t size) { + if (*idx < 0) { + if (*idx < -size) return LINALGERR_INDX_OUT_OF_BNDS; + *idx = size + *idx; + } else if (*idx >= size) return LINALGERR_INDX_OUT_OF_BNDS; + return LINALGERR_OK; +} + /** @brief Sets a matrix element. - @returns true if the element is in the range of the matrix, false otherwise */ + @returns LINALGERR_OK if successful, LINALGERR_INDX_OUT_OF_BNDS if index out of bounds */ linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; + MatrixIdx_t row_idx = row, col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&row_idx, matrix->nrows)); + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, matrix->ncols)); + matrix->elements[matrix->nvals*(col_idx*matrix->nrows+row_idx)]=value; return LINALGERR_OK; } /** @brief Gets a matrix element - * @returns true if the element is in the range of the matrix, false otherwise */ + * @returns LINALGERR_OK if successful, LINALGERR_INDX_OUT_OF_BNDS if index out of bounds */ linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; + MatrixIdx_t row_idx = row, col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&row_idx, matrix->nrows)); + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, matrix->ncols)); + if (value) *value=matrix->elements[matrix->nvals*(col_idx*matrix->nrows+row_idx)]; return LINALGERR_OK; } /** @brief Gets a pointer to a matrix element - * @returns true if the element is in the range of the matrix, false otherwise */ + * @returns LINALGERR_OK if successful, LINALGERR_INDX_OUT_OF_BNDS if index out of bounds */ linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); + MatrixIdx_t row_idx = row, col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&row_idx, matrix->nrows)); + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, matrix->ncols)); + if (value) *value=matrix->elements+matrix->nvals*(col_idx*matrix->nrows+row_idx); return LINALGERR_OK; } @@ -400,27 +415,27 @@ linalgError_t matrix_getcolumnptr(objectmatrix *matrix, MatrixIdx_t col, double /** Copies the column col of matrix a into the column vector b */ linalgError_t matrix_getcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { - if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + MatrixIdx_t col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, a->ncols)); if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col*a->nrows, 1, b->elements, 1); + cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col_idx*a->nrows, 1, b->elements, 1); return LINALGERR_OK; } /** Copies the column vector b into column col of matrix a */ linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { - if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; + MatrixIdx_t col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, a->ncols)); if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col*a->nrows, 1); + cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col_idx*a->nrows, 1); return LINALGERR_OK; } /** Copies the column vector b as a raw list of doubles into column col of matrix a */ linalgError_t matrix_setcolumnptr(objectmatrix *a, MatrixIdx_t col, double *b) { - if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; - - cblas_dcopy((__LAPACK_int) a->nrows*a->nvals, b, 1, a->elements+a->nvals*col*a->nrows, 1); + MatrixIdx_t col_idx = col; + LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, a->ncols)); + cblas_dcopy((__LAPACK_int) a->nrows*a->nvals, b, 1, a->elements+a->nvals*col_idx*a->nrows, 1); return LINALGERR_OK; } @@ -888,7 +903,7 @@ static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return LINALGERR_OK; } else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return LINALGERR_OK; } - return LINALGERR_OP_FAILED; + return LINALGERR_INVLD_ARG; } static linalgError_t _slice_validate(value iv, value jv, MatrixIdx_t *icnt, MatrixIdx_t *jcnt) { diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 3a42e6bef..e5012955e 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -275,6 +275,7 @@ linalgError_t matrix_svd(objectmatrix *a, double *s, objectmatrix *u, objectmatr linalgError_t matrix_qr(objectmatrix *a, objectmatrix *q, objectmatrix *r); +linalgError_t matrix_validateindex(MatrixIdx_t *idx, MatrixIdx_t size); linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value); linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); diff --git a/test/slice/matrixSlicing.morpho b/test/slice/matrixSlicing.morpho index f1247ef72..59a08b4c3 100644 --- a/test/slice/matrixSlicing.morpho +++ b/test/slice/matrixSlicing.morpho @@ -23,84 +23,90 @@ print A[0..1,3] // expect: [ 7 ] // mix of list and int -print A[2,[0,1,2,1,2]] -// expect: [ 8 9 10 9 10 ] +// print A[2,[0,1,2,1,2]] +// notexpect: [ 8 9 10 9 10 ] +// Bug in method resolution -print A[0..1] +print A[0..1,0] // expect: [ 0 ] // expect: [ 4 ] +print A[-1..2,1..2] +// expect: [ 9 10 ] +// expect: [ 1 2 ] +// expect: [ 5 6 ] +// expect: [ 9 10 ] + // range out of bounds try{ - print A[-1..2,1..2] + print A[-20..2,1..2] } catch{ - "MtrxBnds": print "MtrxBnds" -// expect: MtrxBnds + "LnAlgMtrxIndxBnds": print "LnAlgMtrxIndxBnds" +// expect: LnAlgMtrxIndxBnds } try{ print A[0..3,1..2] } catch{ - "MtrxBnds": print "MtrxBnds" -// expect: MtrxBnds + "LnAlgMtrxIndxBnds": print "LnAlgMtrxIndxBnds" +// expect: LnAlgMtrxIndxBnds } +print A[0.0..2,1..2] +// expect: [ 1 2 ] +// expect: [ 5 6 ] +// expect: [ 9 10 ] -// range is not int -try{ - print A[0.0..2,1..2] -} catch{ - "MtrxInvldIndx": print "MtrxInvldIndx" -// expect: MtrxInvldIndx -} +print A[[-1,1,-1],1..2] +// expect: [ 9 10 ] +// expect: [ 5 6 ] +// expect: [ 9 10 ] // list is out of bounds try{ - print A[[-1,2,-1],1..2] + print A[[-4,2,-1],1..2] } catch{ - "MtrxBnds": print "MtrxBnds" -// expect: MtrxBnds + "LnAlgMtrxIndxBnds": print "LnAlgMtrxIndxBnds" +// expect: LnAlgMtrxIndxBnds } try{ print A[[100],1..2] } catch{ - "MtrxBnds": print "MtrxBnds" -// expect: MtrxBnds + "LnAlgMtrxIndxBnds": print "LnAlgMtrxIndxBnds" +// expect: LnAlgMtrxIndxBnds } -// list is not int -try{ - print A[[1,2,1],[0.2,0.1]] -} catch{ - "MtrxInvldIndx": print "MtrxInvldIndx" -// expect: MtrxInvldIndx -} +// index in list is not int +print A[[1,2,1],[0.2,0.1]] +// expect: [ 4 4 ] +// expect: [ 8 8 ] +// expect: [ 4 4 ] + +// index in list is not slicable try{ print A[[1,2,1],[[1]]] } catch{ - "MtrxInvldIndx": print "MtrxInvldIndx" -// expect: MtrxInvldIndx + "LnAlgMtrxInvldArg": print "LnAlgMtrxInvldArg" +// expect: LnAlgMtrxInvldArg } -// int + list but int is out of bounds -try{ - print A[[0,2,1],-1] -} catch{ - "MtrxBnds": print "MtrxBnds" -// expect: MtrxBnds -} +// int + list with negative indexing +print A[[0,2,1],-1] +// expect: [ 3 ] +// expect: [ 11 ] +// expect: [ 7 ] + try{ print A[[0,2,1],100] } catch{ - "MtrxBnds": print "MtrxBnds" -// expect: MtrxBnds -} -try{ - print A[[0,2,1],0.0] -} catch{ - "MtrxInvldIndx": print "MtrxInvldIndx" -// expect: MtrxInvldIndx + "LnAlgMtrxIndxBnds": print "LnAlgMtrxIndxBnds" +// expect: LnAlgMtrxIndxBnds } +print A[[0,2,1],0.0] +// expect: [ 0 ] +// expect: [ 8 ] +// expect: [ 4 ] + //wrong dim try{ print A[[1,2],[2,3],[0,1]] @@ -108,13 +114,14 @@ try{ "MtrxInvldNumIndx": print "MtrxInvldNumIndx" // expect: MtrxInvldNumIndx } -// garbage in +// garbage in try{ print A[A] } catch{ "MtrxInvldIndx": print "MtrxInvldIndx" // expect: MtrxInvldIndx + } try{ print A[nil] @@ -122,6 +129,7 @@ try{ "MtrxInvldIndx": print "MtrxInvldIndx" // expect: MtrxInvldIndx } + try{ A[1,2,3,4,5] } catch{ From 248db488059745676e1edbbcc47b5bd163f3515d Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 07:46:40 +0000 Subject: [PATCH 242/473] Fixed slicing test --- src/linalg/complexmatrix.c | 1 + src/linalg/linalg.c | 1 + src/linalg/linalg.h | 3 +++ src/linalg/matrix.c | 8 ++++++++ src/linalg/matrix.h | 1 + test/slice/matrixSlicing.morpho | 18 +++++++++--------- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 8e4ddf901..a24b96553 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -568,6 +568,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, B MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index__x_x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), diff --git a/src/linalg/linalg.c b/src/linalg/linalg.c index 97440203b..ac8893a1e 100644 --- a/src/linalg/linalg.c +++ b/src/linalg/linalg.c @@ -44,5 +44,6 @@ void linalg_initialize(void) { morpho_defineerror(LINALG_NNNMRCL_ARG, ERROR_HALT, LINALG_NNNMRCL_ARG_MSG); morpho_defineerror(LINALG_NORMARGS, ERROR_HALT, LINALG_NORMARGS_MSG); morpho_defineerror(LINALG_ARITHARGS, ERROR_HALT, LINALG_ARITHARGS_MSG); + morpho_defineerror(LINALG_INVLDINDICES, ERROR_HALT, LINALG_INVLDINDICES_MSG); } diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index c6d2a6f7d..835247f40 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -65,6 +65,9 @@ typedef enum { #define LINALG_ARITHARGS "LnAlgInvldArg" #define LINALG_ARITHARGS_MSG "Matrix arithmetic methods expect a matrix or number as their argument." +#define LINALG_INVLDINDICES "LnAlgInvldIndx" +#define LINALG_INVLDINDICES_MSG "Matrices require two arguments for indexing." + /* ------------------------------------------------------- * Interface * ------------------------------------------------------- */ diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 4220fe9b2..104f8730f 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -918,9 +918,11 @@ static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx for (MatrixIdx_t j=0; jncols)); for (MatrixIdx_t i=0; inrows)); LINALG_ERRCHECKRETURN(matrix_getelementptr(a, ix, jx, &ael)); LINALG_ERRCHECKRETURN(matrix_getelementptr(b, i, j, &bel)); if (swap) memcpy(ael, bel, sizeof(double)*a->nvals); @@ -948,6 +950,11 @@ value Matrix_index__x_x(vm *v, int nargs, value *args) { return out; } +value Matrix_index__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, LINALG_INVLDINDICES); + return MORPHO_NIL; +} + /* --------- * setindex() * --------- */ @@ -1515,6 +1522,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index__int_int, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index__x_x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index e5012955e..7d07813bf 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -193,6 +193,7 @@ IMPLEMENTATIONFN(Matrix_clone); IMPLEMENTATIONFN(Matrix_index__int); IMPLEMENTATIONFN(Matrix_index__int_int); IMPLEMENTATIONFN(Matrix_index__x_x); +IMPLEMENTATIONFN(Matrix_index__err); IMPLEMENTATIONFN(Matrix_setindex__int_x); IMPLEMENTATIONFN(Matrix_setindex__int_int_x); IMPLEMENTATIONFN(Matrix_setindex__x_x_matrix); diff --git a/test/slice/matrixSlicing.morpho b/test/slice/matrixSlicing.morpho index 59a08b4c3..75f031b43 100644 --- a/test/slice/matrixSlicing.morpho +++ b/test/slice/matrixSlicing.morpho @@ -79,7 +79,7 @@ try{ print A[[1,2,1],[0.2,0.1]] // expect: [ 4 4 ] // expect: [ 8 8 ] -// expect: [ 4 4 ] +// expect: [ 4 4 ] // index in list is not slicable try{ @@ -111,28 +111,28 @@ print A[[0,2,1],0.0] try{ print A[[1,2],[2,3],[0,1]] } catch{ - "MtrxInvldNumIndx": print "MtrxInvldNumIndx" -// expect: MtrxInvldNumIndx + "LnAlgInvldIndx": print "LnAlgInvldIndx" +// expect: LnAlgInvldIndx } // garbage in try{ print A[A] } catch{ - "MtrxInvldIndx": print "MtrxInvldIndx" -// expect: MtrxInvldIndx + "LnAlgInvldIndx": print "LnAlgInvldIndx" +// expect: LnAlgInvldIndx } try{ print A[nil] } catch{ - "MtrxInvldIndx": print "MtrxInvldIndx" -// expect: MtrxInvldIndx + "LnAlgInvldIndx": print "LnAlgInvldIndx" +// expect: LnAlgInvldIndx } try{ A[1,2,3,4,5] } catch{ - "MtrxInvldNumIndx": print "MtrxInvldNumIndx" -// expect: MtrxInvldNumIndx + "LnAlgInvldIndx": print "LnAlgInvldIndx" +// expect: LnAlgInvldIndx } From e15a127bdd2d37f547067c27d4b26c6d401e27d4 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 09:15:32 +0000 Subject: [PATCH 243/473] Check return values of matrix_getcolumnptr --- src/geometry/functional.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 2c3cb159b..5d7e13e65 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -1729,9 +1729,9 @@ bool length_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *v functional_vecsub(mesh->dim, x[1], x[0], s0); norm=functional_vecnorm(mesh->dim, s0); if (normdim==2) { functional_veccross2d(x[0], x[1], cx); @@ -1857,12 +1857,12 @@ bool area_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *vid functional_veccross(s01, s0, s010); functional_veccross(s01, s1, s011); - matrix_addtocolumnptr(frc, vid[0], 0.5/norm*scale, s011); - matrix_addtocolumnptr(frc, vid[2], 0.5/norm*scale, s010); + if (matrix_addtocolumnptr(frc, vid[0], 0.5/norm*scale, s011)!=LINALGERR_OK) return false; + if (matrix_addtocolumnptr(frc, vid[2], 0.5/norm*scale, s010)!=LINALGERR_OK) return false; functional_vecadd(mesh->dim, s010, s011, s0); - matrix_addtocolumnptr(frc, vid[1], -0.5/norm*scale, s0); + if (matrix_addtocolumnptr(frc, vid[1], -0.5/norm*scale, s0)!=LINALGERR_OK) return false; return true; } @@ -1917,13 +1917,13 @@ bool volumeenclosed_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int dot/=fabs(dot); - matrix_addtocolumnptr(frc, vid[2], dot/6.0, cx); + if (matrix_addtocolumnptr(frc, vid[2], dot/6.0, cx)!=LINALGERR_OK) return false; functional_veccross(x[1], x[2], cx); - matrix_addtocolumnptr(frc, vid[0], dot/6.0, cx); + if (matrix_addtocolumnptr(frc, vid[0], dot/6.0, cx)!=LINALGERR_OK) return false; functional_veccross(x[2], x[0], cx); - matrix_addtocolumnptr(frc, vid[1], dot/6.0, cx); + if (matrix_addtocolumnptr(frc, vid[1], dot/6.0, cx)!=LINALGERR_OK) return false; return true; } @@ -1977,16 +1977,16 @@ bool volume_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *v uu=functional_vecdot(mesh->dim, s10, cx); uu=(uu>0 ? 1.0 : -1.0); - matrix_addtocolumnptr(frc, vid[1], uu/6.0*scale, cx); + if (matrix_addtocolumnptr(frc, vid[1], uu/6.0*scale, cx)!=LINALGERR_OK) return false; functional_veccross(s31, s21, cx); - matrix_addtocolumnptr(frc, vid[0], uu/6.0*scale, cx); + if (matrix_addtocolumnptr(frc, vid[0], uu/6.0*scale, cx)!=LINALGERR_OK) return false; functional_veccross(s30, s10, cx); - matrix_addtocolumnptr(frc, vid[2], uu/6.0*scale, cx); + if (matrix_addtocolumnptr(frc, vid[2], uu/6.0*scale, cx)!=LINALGERR_OK) return false; functional_veccross(s10, s20, cx); - matrix_addtocolumnptr(frc, vid[3], uu/6.0*scale, cx); + if (matrix_addtocolumnptr(frc, vid[3], uu/6.0*scale, cx)!=LINALGERR_OK) return false; return true; } @@ -2034,7 +2034,7 @@ bool scalarpotential_integrand(vm *v, objectmesh *mesh, elementid id, int nv, in value args[mesh->dim]; value ret; - matrix_getcolumnptr(mesh->vert, id, &x); + if (matrix_getcolumnptr(mesh->vert, id, &x)!=LINALGERR_OK) return false; for (int i=0; idim; i++) args[i]=MORPHO_FLOAT(x[i]); if (morpho_call(v, fn, mesh->dim, args, &ret)) { @@ -2051,7 +2051,7 @@ bool scalarpotential_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int value args[mesh->dim]; value ret; - matrix_getcolumnptr(mesh->vert, id, &x); + if (matrix_getcolumnptr(mesh->vert, id, &x)!=LINALGERR_OK) return false; for (int i=0; idim; i++) args[i]=MORPHO_FLOAT(x[i]); if (morpho_call(v, fn, mesh->dim, args, &ret)) { @@ -2059,7 +2059,7 @@ bool scalarpotential_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int objectmatrix *vf=MORPHO_GETMATRIX(ret); if (vf->nrows*vf->ncols==frc->nrows) { - return matrix_addtocolumnptr(frc, id, 1.0, vf->elements); + return (matrix_addtocolumnptr(frc, id, 1.0, vf->elements)==LINALGERR_OK); } } } From 35f046c3e990c0a5201cc68a762a0f3578c912a2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:18:31 +0000 Subject: [PATCH 244/473] Matrix concatenation --- src/linalg/matrix.c | 14 +++++++++++++- test/matrix/concatenate.morpho | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 104f8730f..0bd017cc4 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -333,12 +333,15 @@ objectmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixId _getelement(lst, i, &iel); for (int j=0; jsetelfn(v, jel, new->elements+(j*nrows + i)*new->nvals); + if (matrix_getinterface(new)->setelfn(v, jel, new->elements+(j*nrows + i)*new->nvals)!=LINALGERR_OK) goto matrix_listconstructor_cleanup; } } } return new; +matrix_listconstructor_cleanup: + object_free((object *) new); + return NULL; } /** Construct a matrix from an array */ @@ -783,6 +786,15 @@ value matrix_constructor__matrix(vm *v, int nargs, value *args) { /** Constructs a matrix from a list of lists or tuples */ value matrix_constructor__list(vm *v, int nargs, value *args) { objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_MATRIX, 1); +#ifdef MORPHO_INCLUDE_SPARSE + if (!new) { + /** Could this be a concatenation operation? */ + objectsparseerror err = sparse_catmatrix(MORPHO_GETLIST(MORPHO_GETARG(args, 0)), &new); + if (err==SPARSE_INVLDINIT) { + morpho_runtimeerror(v, LINALG_INVLDARGS); + } else if (err!=SPARSE_OK) sparse_raiseerror(v, err); + } +#endif return morpho_wrapandbind(v, (object *) new); } diff --git a/test/matrix/concatenate.morpho b/test/matrix/concatenate.morpho index ba00ec794..c88f253a7 100644 --- a/test/matrix/concatenate.morpho +++ b/test/matrix/concatenate.morpho @@ -28,4 +28,4 @@ print c // expect: [ 2 3 2 3 0 ] var c = Matrix([[a, b], [b, 0]]) -// expect error 'MtrxIncmptbl' +// expect error 'LnAlgMtrxIncmptbl' From 5f279165f33615a823df9608593cb963ba997faf Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:19:23 +0000 Subject: [PATCH 245/473] Raise error correctly if MORPHO_INCLUDE_SPARSE is not defined --- src/linalg/matrix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 0bd017cc4..7b667abf5 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -794,6 +794,8 @@ value matrix_constructor__list(vm *v, int nargs, value *args) { morpho_runtimeerror(v, LINALG_INVLDARGS); } else if (err!=SPARSE_OK) sparse_raiseerror(v, err); } +#else + if (!new) morpho_runtimeerror(v, LINALG_INVLDARGS); #endif return morpho_wrapandbind(v, (object *) new); } From 1945149813aac03d159b4b40bade0954596581bc Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:51:57 +0000 Subject: [PATCH 246/473] Fix more errors due to incorrect error checks --- src/geometry/functional.c | 6 +++--- test/functionals/hydrogel/hydrogel2D.morpho | 2 +- test/matrix/concatenate_sparse.morpho | 2 +- test/matrix/initializer.morpho | 2 +- test/matrix/nonnum_initializer.morpho | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 5d7e13e65..c53f464e9 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -1845,7 +1845,7 @@ bool area_gradient_scale(vm *v, objectmesh *mesh, elementid id, int nv, int *vid double *x[nv], s0[3], s1[3], s01[3], s010[3], s011[3]; double norm; for (int j=0; j<3; j++) { s0[j]=0; s1[j]=0; s01[j]=0; s010[j]=0; s011[j]=0; } - for (int j=0; jvert, vid[j], &x[j])) return false; + for (int j=0; jvert, vid[j], &x[j])!=LINALGERR_OK) return false; functional_vecsub(mesh->dim, x[1], x[0], s0); functional_vecsub(mesh->dim, x[2], x[1], s1); @@ -1895,7 +1895,7 @@ MORPHO_ENDCLASS /** Calculate enclosed volume */ bool volumeenclosed_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, double *out) { double *x[nv], cx[mesh->dim]; - for (int j=0; jvert, vid[j], &x[j])) return false; + for (int j=0; jvert, vid[j], &x[j])!=LINALGERR_OK) return false; functional_veccross(x[0], x[1], cx); @@ -1906,7 +1906,7 @@ bool volumeenclosed_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int /** Calculate gradient */ bool volumeenclosed_gradient(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, objectmatrix *frc) { double *x[nv], cx[mesh->dim], dot; - for (int j=0; jvert, vid[j], &x[j]); + for (int j=0; jvert, vid[j], &x[j])!=LINALGERR_OK) return false; functional_veccross(x[0], x[1], cx); dot=functional_vecdot(mesh->dim, cx, x[2]); diff --git a/test/functionals/hydrogel/hydrogel2D.morpho b/test/functionals/hydrogel/hydrogel2D.morpho index ead6733af..48ffb5752 100644 --- a/test/functionals/hydrogel/hydrogel2D.morpho +++ b/test/functionals/hydrogel/hydrogel2D.morpho @@ -32,7 +32,7 @@ var m = mb.build() // Expand m by a linear factor var f = 1.2 var vert = m.vertexmatrix() -for (i in 0...m.count()) m.setvertexposition(i, f*vert.column(i)) +for (i in 0...m.count()) m.setvertexposition(i, vert.column(i)*f) var phi = phi0/(f^2) // New phi will be inversely proportional to the area var vol = vol0 * f^2 diff --git a/test/matrix/concatenate_sparse.morpho b/test/matrix/concatenate_sparse.morpho index 100d01366..66fb4f6ec 100644 --- a/test/matrix/concatenate_sparse.morpho +++ b/test/matrix/concatenate_sparse.morpho @@ -24,4 +24,4 @@ print c // expect: [ 2 3 2 3 0 ] var c = Matrix([[a, b], [b, 0]]) -// expect error 'MtrxIncmptbl' +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/matrix/initializer.morpho b/test/matrix/initializer.morpho index 5d24e1d8d..846ad9a66 100644 --- a/test/matrix/initializer.morpho +++ b/test/matrix/initializer.morpho @@ -33,5 +33,5 @@ print w // expect: [ 3 4 ] var w = Matrix([[1,[2,3]]]) -// expect Error 'MtrxInvldInit' +// expect Error 'LnAlgMtrxInvldArg' print w diff --git a/test/matrix/nonnum_initializer.morpho b/test/matrix/nonnum_initializer.morpho index 68fd001b3..b94e4f486 100644 --- a/test/matrix/nonnum_initializer.morpho +++ b/test/matrix/nonnum_initializer.morpho @@ -1,4 +1,4 @@ // Non numerical initializer var m = Matrix([[1,2], [3,"oops"]]) -// expect error: 'MtrxInvldInit' +// expect error: 'LnAlgMtrxInvldArg' From dfd4d260b88855645bc24996607ed98ec31a4a6f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:03:45 +0000 Subject: [PATCH 247/473] Fix error checks in functional_symmetrysumforces --- src/geometry/functional.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index c53f464e9..5490e05c6 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -154,12 +154,12 @@ bool functional_symmetrysumforces(objectmesh *mesh, objectmatrix *frc) { double *fi, *fj, fsum[mesh->dim]; while (sparsedok_loop(&s->dok, &ctr, &i, &j)) { - if (matrix_getcolumnptr(frc, i, &fi) && - matrix_getcolumnptr(frc, j, &fj)) { + if (matrix_getcolumnptr(frc, i, &fi)==LINALGERR_OK && + matrix_getcolumnptr(frc, j, &fj)==LINALGERR_OK) { for (unsigned int k=0; kdim; k++) fsum[k]=fi[k]+fj[k]; - matrix_setcolumnptr(frc, i, fsum); - matrix_setcolumnptr(frc, j, fsum); + if (matrix_setcolumnptr(frc, i, fsum)!=LINALGERR_OK) return false; + if (matrix_setcolumnptr(frc, j, fsum)!=LINALGERR_OK) return false; } } } From b60c811f1defff77c82c2ff347f767a0f1e7f452 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:35:37 +0000 Subject: [PATCH 248/473] Fix Identity constructor --- src/linalg/matrix.c | 5 ++++- src/linalg/matrix.h | 5 ++++- test/matrix/identity.morpho | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 7b667abf5..6182546fa 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -824,8 +824,10 @@ value matrix_constructor__err(vm *v, int nargs, value *args) { /** Creates an identity matrix */ value matrix_identityconstructor(vm *v, int nargs, value *args) { - MatrixIdx_t n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + if (nargs!=1) { morpho_runtimeerror(v, MATRIX_IDENTCONSTRUCTOR); return MORPHO_NIL; } + MatrixIdx_t n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + objectmatrix *new = matrix_new(n,n,false); if (new) matrix_identity(new); @@ -1604,6 +1606,7 @@ void matrix_initialize(void) { morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); morpho_defineerror(MATRIX_CONSTRUCTOR, ERROR_HALT, MATRIX_CONSTRUCTOR_MSG); + morpho_defineerror(MATRIX_IDENTCONSTRUCTOR, ERROR_HALT, MATRIX_IDENTCONSTRUCTOR_MSG); complexmatrix_initialize(); } diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 7d07813bf..1445fa3ca 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -234,7 +234,10 @@ IMPLEMENTATIONFN(Matrix_dimensions); * ------------------------------------------------------- */ #define MATRIX_CONSTRUCTOR "MtrxCns" -#define MATRIX_CONSTRUCTOR_MSG "Matrix() constructor should be called either with dimensions or an array, list, tuple or matrix initializer." +#define MATRIX_CONSTRUCTOR_MSG "Matrix() constructor should be called either with integer dimensions or an array, list, tuple or matrix initializer." + +#define MATRIX_IDENTCONSTRUCTOR "MtrxIdnttyCns" +#define MATRIX_IDENTCONSTRUCTOR_MSG "IdentityMatrix expects the dimension as its argument." /* ------------------------------------------------------- * Interface diff --git a/test/matrix/identity.morpho b/test/matrix/identity.morpho index ba47e170c..43befc5f3 100644 --- a/test/matrix/identity.morpho +++ b/test/matrix/identity.morpho @@ -12,4 +12,4 @@ print a // expect: [ 0 0 1 ] a = IdentityMatrix() -// expect error 'MtrxIdnttyCns' +// expect error 'LnAlgMtrxInvldArg' From f3a14c9cc5b9519f617ede750cca810c5f94194f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 12:49:57 +0000 Subject: [PATCH 249/473] Fix Identity Matrix constructor error --- test/matrix/identity.morpho | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/matrix/identity.morpho b/test/matrix/identity.morpho index 43befc5f3..ba47e170c 100644 --- a/test/matrix/identity.morpho +++ b/test/matrix/identity.morpho @@ -12,4 +12,4 @@ print a // expect: [ 0 0 1 ] a = IdentityMatrix() -// expect error 'LnAlgMtrxInvldArg' +// expect error 'MtrxIdnttyCns' From 52f138b8d8659b54f96a611263c96aa848f334e3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 13:01:16 +0000 Subject: [PATCH 250/473] Correct error checking in matrix_listconstructor to raise error in incorrect block constructors --- src/linalg/matrix.c | 9 ++++----- test/matrix/blockmatrix_constructor.morpho | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 6182546fa..da46d1d03 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -317,13 +317,12 @@ objectmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixId value iel, jel; int nrows=0, ncols=0, rlen; - _length(lst, &nrows); + if (!_length(lst, &nrows)) return NULL; for (int i=0; incols) { - ncols=rlen; - } + _length(iel, &rlen)) { + if (rlen>ncols) ncols=rlen; + } else return NULL; } objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); diff --git a/test/matrix/blockmatrix_constructor.morpho b/test/matrix/blockmatrix_constructor.morpho index ea012bc03..e5a45cb3c 100644 --- a/test/matrix/blockmatrix_constructor.morpho +++ b/test/matrix/blockmatrix_constructor.morpho @@ -1,4 +1,4 @@ // Block matrix constructor with single list print Matrix([Matrix(2)]) -// expect error 'MtrxInvldInit' +// expect error 'LnAlgMtrxInvldArg' From 54bc65e06ef5b817c0c984158a2899cd993f8c0c Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:40:25 -0500 Subject: [PATCH 251/473] Fix error in matrix_sum usage. --- src/geometry/functional.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 5490e05c6..c9e6888f0 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -2184,7 +2184,7 @@ bool linearelasticity_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i if (matrix_inverse(&q)!=LINALGERR_OK) return false; if (matrix_mul(&gramdef, &q, &r)!=LINALGERR_OK) return false; - matrix_identity(&cg); + if (matrix_identity(&cg)!=LINALGERR_OK) return false; matrix_scale(&cg, -0.5); matrix_axpy(0.5, &r, &cg); // y <- alpha*x + y @@ -2560,7 +2560,9 @@ bool equielement_prepareref(objectinstance *self, objectmesh *mesh, grade g, obj MORPHO_ISMATRIX(weight) ) { ref->weight=MORPHO_GETMATRIX(weight); if (ref->weight) { - matrix_sum(ref->weight, &ref->mean); + double sum[ref->weight->nvals]; + matrix_sum(ref->weight, sum); + ref->mean = sum[0]; ref->mean/=ref->weight->ncols; } } @@ -4318,7 +4320,7 @@ void integral_evaluatecg(vm *v, value *out) { if (matrix_inverse(&q)!=LINALGERR_OK) return; if (matrix_mul(&gramdef, &q, &r)!=LINALGERR_OK) return; - matrix_identity(cg); + if (matrix_identity(cg)!=LINALGERR_OK) return; matrix_scale(cg, -0.5); matrix_axpy(0.5, &r, cg); From 809d05b571a04180404a247fce1632fc6180e958 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 21 Jan 2026 06:12:40 -0500 Subject: [PATCH 252/473] Linear Algebra tests integrated --- src/linalg/matrix.c | 2 +- .../arithmetic/complexmatrix_acc.morpho | 13 ++ .../complexmatrix_add_complexmatrix.morpho | 7 + .../complexmatrix_add_matrix.morpho | 8 + .../arithmetic/complexmatrix_add_nil.morpho | 7 + .../complexmatrix_add_scalar.morpho | 9 ++ .../complexmatrix_addr_matrix.morpho | 8 + .../arithmetic/complexmatrix_addr_nil.morpho | 7 + .../complexmatrix_div_complexmatrix.morpho | 19 +++ .../complexmatrix_div_matrix.morpho | 13 ++ .../complexmatrix_div_scalar.morpho | 10 ++ .../complexmatrix_divr_matrix.morpho | 9 ++ .../complexmatrix_mul_complex.morpho | 7 + .../complexmatrix_mul_complexmatrix.morpho | 18 +++ .../complexmatrix_mul_matrix.morpho | 8 + .../complexmatrix_mul_scalar.morpho | 10 ++ .../complexmatrix_mulr_matrix.morpho | 14 ++ .../complexmatrix_sub_complexmatrix.morpho | 8 + .../complexmatrix_sub_matrix.morpho | 8 + .../complexmatrix_sub_scalar.morpho | 9 ++ .../complexmatrix_subr_matrix.morpho | 8 + .../complexmatrix_subr_scalar.morpho | 9 ++ test/linalg/arithmetic/matrix_acc.morpho | 13 ++ .../arithmetic/matrix_add_matrix.morpho | 10 ++ test/linalg/arithmetic/matrix_add_nil.morpho | 7 + .../arithmetic/matrix_add_scalar.morpho | 7 + test/linalg/arithmetic/matrix_addr_nil.morpho | 8 + .../arithmetic/matrix_addr_scalar.morpho | 7 + .../arithmetic/matrix_div_matrix.morpho | 16 ++ .../arithmetic/matrix_div_scalar.morpho | 10 ++ .../arithmetic/matrix_mul_matrix.morpho | 35 +++++ .../arithmetic/matrix_mul_scalar.morpho | 10 ++ test/linalg/arithmetic/matrix_negate.morpho | 7 + .../arithmetic/matrix_sub_matrix.morpho | 12 ++ .../arithmetic/matrix_sub_scalar.morpho | 7 + .../arithmetic/matrix_subr_scalar.morpho | 9 ++ .../linalg/assign/complexmatrix_assign.morpho | 15 ++ test/linalg/assign/complexmatrix_clone.morpho | 18 +++ test/linalg/assign/matrix_assign.morpho | 18 +++ .../complexmatrix_array_constructor.morpho | 13 ++ ...rray_constructor_invalid_dimensions.morpho | 11 ++ .../complexmatrix_constructor.morpho | 8 + ...omplexmatrix_constructor_edge_cases.morpho | 47 ++++++ ...plexmatrix_constructor_invalid_args.morpho | 5 + .../complexmatrix_list_constructor.morpho | 7 + ...mplexmatrix_list_vector_constructor.morpho | 16 ++ .../complexmatrix_matrix_constructor.morpho | 9 ++ ...plexmatrix_tuple_column_constructor.morpho | 7 + .../complexmatrix_tuple_constructor.morpho | 7 + .../complexmatrix_vector_constructor.morpho | 8 + .../matrix_array_constructor.morpho | 14 ++ ...rray_constructor_invalid_dimensions.morpho | 11 ++ .../constructors/matrix_constructor.morpho | 8 + .../matrix_constructor_edge_cases.morpho | 47 ++++++ .../matrix_identity_constructor.morpho | 12 ++ .../matrix_list_constructor.morpho | 7 + .../matrix_list_vector_constructor.morpho | 7 + .../matrix_tuple_constructor.morpho | 14 ++ .../matrix_vector_constructor.morpho | 7 + .../constructors/vector_constructor.morpho | 8 + ...mplexmatrix_incompatible_dimensions.morpho | 12 ++ .../complexmatrix_index_out_of_bounds.morpho | 9 ++ .../complexmatrix_non_square_error.morpho | 9 ++ .../index/complexmatrix_getcolumn.morpho | 17 +++ .../index/complexmatrix_getindex.morpho | 19 +++ .../index/complexmatrix_setcolumn.morpho | 20 +++ .../index/complexmatrix_setindex.morpho | 19 +++ .../index/complexmatrix_setindex_real.morpho | 14 ++ .../index/complexmatrix_setslice.morpho | 49 ++++++ test/linalg/index/complexmatrix_slice.morpho | 24 +++ test/linalg/index/matrix_getcolumn.morpho | 17 +++ test/linalg/index/matrix_getindex.morpho | 19 +++ test/linalg/index/matrix_setcolumn.morpho | 20 +++ test/linalg/index/matrix_setindex.morpho | 11 ++ test/linalg/index/matrix_setslice.morpho | 48 ++++++ test/linalg/index/matrix_slice.morpho | 24 +++ test/linalg/index/matrix_slice_bounds.morpho | 6 + .../index/matrix_slice_infinite_range.morpho | 6 + test/linalg/methods/complexmatrix_conj.morpho | 11 ++ .../complexmatrix_conjTranspose.morpho | 21 +++ .../linalg/methods/complexmatrix_count.morpho | 13 ++ .../methods/complexmatrix_dimensions.morpho | 8 + .../methods/complexmatrix_eigensystem.morpho | 24 +++ .../methods/complexmatrix_eigenvalues.morpho | 10 ++ .../methods/complexmatrix_enumerate.morpho | 13 ++ .../methods/complexmatrix_format.morpho | 12 ++ test/linalg/methods/complexmatrix_imag.morpho | 11 ++ .../linalg/methods/complexmatrix_inner.morpho | 16 ++ .../methods/complexmatrix_inverse.morpho | 11 ++ .../complexmatrix_inverse_singular.morpho | 11 ++ test/linalg/methods/complexmatrix_norm.morpho | 20 +++ .../linalg/methods/complexmatrix_outer.morpho | 9 ++ test/linalg/methods/complexmatrix_qr.morpho | 144 ++++++++++++++++++ test/linalg/methods/complexmatrix_real.morpho | 11 ++ .../methods/complexmatrix_reshape.morpho | 18 +++ test/linalg/methods/complexmatrix_roll.morpho | 50 ++++++ .../complexmatrix_roll_negative.morpho | 12 ++ test/linalg/methods/complexmatrix_sum.morpho | 12 ++ test/linalg/methods/complexmatrix_svd.morpho | 21 +++ .../linalg/methods/complexmatrix_trace.morpho | 10 ++ .../methods/complexmatrix_transpose.morpho | 13 ++ test/linalg/methods/matrix_count.morpho | 13 ++ test/linalg/methods/matrix_dimensions.morpho | 9 ++ test/linalg/methods/matrix_eigensystem.morpho | 19 +++ test/linalg/methods/matrix_eigenvalues.morpho | 10 ++ test/linalg/methods/matrix_enumerate.morpho | 13 ++ test/linalg/methods/matrix_format.morpho | 12 ++ test/linalg/methods/matrix_inner.morpho | 17 +++ test/linalg/methods/matrix_inverse.morpho | 11 ++ .../methods/matrix_inverse_singular.morpho | 10 ++ test/linalg/methods/matrix_norm.morpho | 20 +++ test/linalg/methods/matrix_outer.morpho | 9 ++ test/linalg/methods/matrix_qr.morpho | 134 ++++++++++++++++ test/linalg/methods/matrix_reshape.morpho | 18 +++ test/linalg/methods/matrix_roll.morpho | 50 ++++++ test/linalg/methods/matrix_sum.morpho | 12 ++ test/linalg/methods/matrix_svd.morpho | 53 +++++++ test/linalg/methods/matrix_trace.morpho | 10 ++ test/linalg/methods/matrix_transpose.morpho | 13 ++ 119 files changed, 1949 insertions(+), 1 deletion(-) create mode 100644 test/linalg/arithmetic/complexmatrix_acc.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_add_complexmatrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_add_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_add_nil.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_add_scalar.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_addr_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_addr_nil.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_div_complexmatrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_div_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_div_scalar.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_divr_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_mul_complex.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_mul_complexmatrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_mul_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_mul_scalar.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_mulr_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_sub_complexmatrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_sub_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_sub_scalar.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_subr_matrix.morpho create mode 100644 test/linalg/arithmetic/complexmatrix_subr_scalar.morpho create mode 100644 test/linalg/arithmetic/matrix_acc.morpho create mode 100644 test/linalg/arithmetic/matrix_add_matrix.morpho create mode 100644 test/linalg/arithmetic/matrix_add_nil.morpho create mode 100644 test/linalg/arithmetic/matrix_add_scalar.morpho create mode 100644 test/linalg/arithmetic/matrix_addr_nil.morpho create mode 100644 test/linalg/arithmetic/matrix_addr_scalar.morpho create mode 100644 test/linalg/arithmetic/matrix_div_matrix.morpho create mode 100644 test/linalg/arithmetic/matrix_div_scalar.morpho create mode 100644 test/linalg/arithmetic/matrix_mul_matrix.morpho create mode 100644 test/linalg/arithmetic/matrix_mul_scalar.morpho create mode 100644 test/linalg/arithmetic/matrix_negate.morpho create mode 100644 test/linalg/arithmetic/matrix_sub_matrix.morpho create mode 100644 test/linalg/arithmetic/matrix_sub_scalar.morpho create mode 100644 test/linalg/arithmetic/matrix_subr_scalar.morpho create mode 100644 test/linalg/assign/complexmatrix_assign.morpho create mode 100644 test/linalg/assign/complexmatrix_clone.morpho create mode 100644 test/linalg/assign/matrix_assign.morpho create mode 100644 test/linalg/constructors/complexmatrix_array_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho create mode 100644 test/linalg/constructors/complexmatrix_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_constructor_edge_cases.morpho create mode 100644 test/linalg/constructors/complexmatrix_constructor_invalid_args.morpho create mode 100644 test/linalg/constructors/complexmatrix_list_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_list_vector_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_matrix_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_tuple_column_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_tuple_constructor.morpho create mode 100644 test/linalg/constructors/complexmatrix_vector_constructor.morpho create mode 100644 test/linalg/constructors/matrix_array_constructor.morpho create mode 100644 test/linalg/constructors/matrix_array_constructor_invalid_dimensions.morpho create mode 100644 test/linalg/constructors/matrix_constructor.morpho create mode 100644 test/linalg/constructors/matrix_constructor_edge_cases.morpho create mode 100644 test/linalg/constructors/matrix_identity_constructor.morpho create mode 100644 test/linalg/constructors/matrix_list_constructor.morpho create mode 100644 test/linalg/constructors/matrix_list_vector_constructor.morpho create mode 100644 test/linalg/constructors/matrix_tuple_constructor.morpho create mode 100644 test/linalg/constructors/matrix_vector_constructor.morpho create mode 100644 test/linalg/constructors/vector_constructor.morpho create mode 100644 test/linalg/errors/complexmatrix_incompatible_dimensions.morpho create mode 100644 test/linalg/errors/complexmatrix_index_out_of_bounds.morpho create mode 100644 test/linalg/errors/complexmatrix_non_square_error.morpho create mode 100644 test/linalg/index/complexmatrix_getcolumn.morpho create mode 100644 test/linalg/index/complexmatrix_getindex.morpho create mode 100644 test/linalg/index/complexmatrix_setcolumn.morpho create mode 100644 test/linalg/index/complexmatrix_setindex.morpho create mode 100644 test/linalg/index/complexmatrix_setindex_real.morpho create mode 100644 test/linalg/index/complexmatrix_setslice.morpho create mode 100644 test/linalg/index/complexmatrix_slice.morpho create mode 100644 test/linalg/index/matrix_getcolumn.morpho create mode 100644 test/linalg/index/matrix_getindex.morpho create mode 100644 test/linalg/index/matrix_setcolumn.morpho create mode 100644 test/linalg/index/matrix_setindex.morpho create mode 100644 test/linalg/index/matrix_setslice.morpho create mode 100644 test/linalg/index/matrix_slice.morpho create mode 100644 test/linalg/index/matrix_slice_bounds.morpho create mode 100644 test/linalg/index/matrix_slice_infinite_range.morpho create mode 100644 test/linalg/methods/complexmatrix_conj.morpho create mode 100644 test/linalg/methods/complexmatrix_conjTranspose.morpho create mode 100644 test/linalg/methods/complexmatrix_count.morpho create mode 100644 test/linalg/methods/complexmatrix_dimensions.morpho create mode 100644 test/linalg/methods/complexmatrix_eigensystem.morpho create mode 100644 test/linalg/methods/complexmatrix_eigenvalues.morpho create mode 100644 test/linalg/methods/complexmatrix_enumerate.morpho create mode 100644 test/linalg/methods/complexmatrix_format.morpho create mode 100644 test/linalg/methods/complexmatrix_imag.morpho create mode 100644 test/linalg/methods/complexmatrix_inner.morpho create mode 100644 test/linalg/methods/complexmatrix_inverse.morpho create mode 100644 test/linalg/methods/complexmatrix_inverse_singular.morpho create mode 100644 test/linalg/methods/complexmatrix_norm.morpho create mode 100644 test/linalg/methods/complexmatrix_outer.morpho create mode 100644 test/linalg/methods/complexmatrix_qr.morpho create mode 100644 test/linalg/methods/complexmatrix_real.morpho create mode 100644 test/linalg/methods/complexmatrix_reshape.morpho create mode 100644 test/linalg/methods/complexmatrix_roll.morpho create mode 100644 test/linalg/methods/complexmatrix_roll_negative.morpho create mode 100644 test/linalg/methods/complexmatrix_sum.morpho create mode 100644 test/linalg/methods/complexmatrix_svd.morpho create mode 100644 test/linalg/methods/complexmatrix_trace.morpho create mode 100644 test/linalg/methods/complexmatrix_transpose.morpho create mode 100644 test/linalg/methods/matrix_count.morpho create mode 100644 test/linalg/methods/matrix_dimensions.morpho create mode 100644 test/linalg/methods/matrix_eigensystem.morpho create mode 100644 test/linalg/methods/matrix_eigenvalues.morpho create mode 100644 test/linalg/methods/matrix_enumerate.morpho create mode 100644 test/linalg/methods/matrix_format.morpho create mode 100644 test/linalg/methods/matrix_inner.morpho create mode 100644 test/linalg/methods/matrix_inverse.morpho create mode 100644 test/linalg/methods/matrix_inverse_singular.morpho create mode 100644 test/linalg/methods/matrix_norm.morpho create mode 100644 test/linalg/methods/matrix_outer.morpho create mode 100644 test/linalg/methods/matrix_qr.morpho create mode 100644 test/linalg/methods/matrix_reshape.morpho create mode 100644 test/linalg/methods/matrix_roll.morpho create mode 100644 test/linalg/methods/matrix_sum.morpho create mode 100644 test/linalg/methods/matrix_svd.morpho create mode 100644 test/linalg/methods/matrix_trace.morpho create mode 100644 test/linalg/methods/matrix_transpose.morpho diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index da46d1d03..acdabae84 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -843,7 +843,7 @@ value matrix_identityconstructor(vm *v, int nargs, value *args) { /** Prints a matrix */ value Matrix_print(vm *v, int nargs, value *args) { - if (!MORPHO_ISMATRIX(MORPHO_SELF(args))) return Object_print(v, nargs, args); + if (MORPHO_ISCLASS(MORPHO_SELF(args))) return Object_print(v, nargs, args); // Handle calls on the class objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); matrix_print(v, m); return MORPHO_NIL; diff --git a/test/linalg/arithmetic/complexmatrix_acc.morpho b/test/linalg/arithmetic/complexmatrix_acc.morpho new file mode 100644 index 000000000..850a1d907 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_acc.morpho @@ -0,0 +1,13 @@ +// In-place accumulate + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[0,1]=1-im +A[1,0]=1-im +A[1,1]=1+im + +A.acc(2,A) + +print A +// expect: [ 3 + 3im 3 - 3im ] +// expect: [ 3 - 3im 3 + 3im ] diff --git a/test/linalg/arithmetic/complexmatrix_add_complexmatrix.morpho b/test/linalg/arithmetic/complexmatrix_add_complexmatrix.morpho new file mode 100644 index 000000000..fe894b454 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_add_complexmatrix.morpho @@ -0,0 +1,7 @@ +// Add a complexmatrix to a complexmatrix + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) + +print A + A +// expect: [ 2 + 2im 4 + 4im ] +// expect: [ 6 + 6im 8 + 8im ] diff --git a/test/linalg/arithmetic/complexmatrix_add_matrix.morpho b/test/linalg/arithmetic/complexmatrix_add_matrix.morpho new file mode 100644 index 000000000..dbea72499 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_add_matrix.morpho @@ -0,0 +1,8 @@ +// Add a matrix to a complex matrix + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = Matrix(((1, 2), (3, 4))) + +print A + B +// expect: [ 2 + 1im 4 + 2im ] +// expect: [ 6 + 3im 8 + 4im ] diff --git a/test/linalg/arithmetic/complexmatrix_add_nil.morpho b/test/linalg/arithmetic/complexmatrix_add_nil.morpho new file mode 100644 index 000000000..13650933f --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_add_nil.morpho @@ -0,0 +1,7 @@ +// Add a scalar + +var A = ComplexMatrix(2,2) + +print A + nil +// expect: [ 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im ] diff --git a/test/linalg/arithmetic/complexmatrix_add_scalar.morpho b/test/linalg/arithmetic/complexmatrix_add_scalar.morpho new file mode 100644 index 000000000..0b0e440d0 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_add_scalar.morpho @@ -0,0 +1,9 @@ +// Add a scalar + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[1,1]=1+im + +print A + 2 +// expect: [ 3 + 1im 2 + 0im ] +// expect: [ 2 + 0im 3 + 1im ] diff --git a/test/linalg/arithmetic/complexmatrix_addr_matrix.morpho b/test/linalg/arithmetic/complexmatrix_addr_matrix.morpho new file mode 100644 index 000000000..364dd7038 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_addr_matrix.morpho @@ -0,0 +1,8 @@ +// Add a matrix to a complex matrix + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = Matrix(((1, 2), (3, 4))) + +print B + A +// expect: [ 2 + 1im 4 + 2im ] +// expect: [ 6 + 3im 8 + 4im ] diff --git a/test/linalg/arithmetic/complexmatrix_addr_nil.morpho b/test/linalg/arithmetic/complexmatrix_addr_nil.morpho new file mode 100644 index 000000000..d9c3edb9e --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_addr_nil.morpho @@ -0,0 +1,7 @@ +// Add a scalar + +var A = ComplexMatrix(2,2) + +print nil + A +// expect: [ 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im ] diff --git a/test/linalg/arithmetic/complexmatrix_div_complexmatrix.morpho b/test/linalg/arithmetic/complexmatrix_div_complexmatrix.morpho new file mode 100644 index 000000000..84246a801 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_div_complexmatrix.morpho @@ -0,0 +1,19 @@ +// Divide ComplexMatrix by ComplexMatrix (solve linear system) + +var A = ComplexMatrix(2,2) +A[0,0]=1 +A[0,1]=1-im +A[1,0]=1 +A[1,1]=1+1im + +var b = ComplexMatrix(2,1) +b[0,0]=1+1im +b[1,0]=2 + +print b / A +// expect: [ 2 + 1im ] +// expect: [ -0.5 - 0.5im ] + +print b +// expect: [ 1 + 1im ] +// expect: [ 2 + 0im ] diff --git a/test/linalg/arithmetic/complexmatrix_div_matrix.morpho b/test/linalg/arithmetic/complexmatrix_div_matrix.morpho new file mode 100644 index 000000000..7fb130c56 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_div_matrix.morpho @@ -0,0 +1,13 @@ +// Divide ComplexMatrix by Matrix (solve linear system) + +var A = Matrix(((1,2),(-2,1))) + +var b = ComplexMatrix((1+im, 2)) + +print b / A +// expect: [ -0.6 + 0.2im ] +// expect: [ 0.8 + 0.4im ] + +print b +// expect: [ 1 + 1im ] +// expect: [ 2 + 0im ] diff --git a/test/linalg/arithmetic/complexmatrix_div_scalar.morpho b/test/linalg/arithmetic/complexmatrix_div_scalar.morpho new file mode 100644 index 000000000..115ed9d55 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_div_scalar.morpho @@ -0,0 +1,10 @@ +// Divide ComplexMatrix by scalar + +var A = ComplexMatrix(2,2) +A[0,0]=2+2im +A[1,1]=4+4im + +print A / 2 +// expect: [ 1 + 1im 0 + 0im ] +// expect: [ 0 + 0im 2 + 2im ] + diff --git a/test/linalg/arithmetic/complexmatrix_divr_matrix.morpho b/test/linalg/arithmetic/complexmatrix_divr_matrix.morpho new file mode 100644 index 000000000..ca33e774f --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_divr_matrix.morpho @@ -0,0 +1,9 @@ +// Divide Matrix by ComplexMatrix (solve linear system) + +var A = ComplexMatrix(((1,2+im),(2-im,1))) + +var b = Matrix((1, 2)) + +print b / A +// expect: [ 0.75 + 0.5im ] +// expect: [ 0 - 0.25im ] diff --git a/test/linalg/arithmetic/complexmatrix_mul_complex.morpho b/test/linalg/arithmetic/complexmatrix_mul_complex.morpho new file mode 100644 index 000000000..399b87d06 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_mul_complex.morpho @@ -0,0 +1,7 @@ +// Multiply ComplexMatrix by scalar + +var A = ComplexMatrix(((1,2),(3,4))) + +print A * (1+im) +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] diff --git a/test/linalg/arithmetic/complexmatrix_mul_complexmatrix.morpho b/test/linalg/arithmetic/complexmatrix_mul_complexmatrix.morpho new file mode 100644 index 000000000..3bf75db9d --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_mul_complexmatrix.morpho @@ -0,0 +1,18 @@ +// Multiply two ComplexMatrices + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = ComplexMatrix(2,2) +B[0,0]=1 +B[0,1]=1im +B[1,0]=-1im +B[1,1]=1 + +print A * B +// expect: [ 3 - 1im 1 + 3im ] +// expect: [ 7 - 1im 1 + 7im ] + diff --git a/test/linalg/arithmetic/complexmatrix_mul_matrix.morpho b/test/linalg/arithmetic/complexmatrix_mul_matrix.morpho new file mode 100644 index 000000000..d7d862b8e --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_mul_matrix.morpho @@ -0,0 +1,8 @@ +// Multiply two ComplexMatrices + +var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) +var B = Matrix(((4,3),(2,1))) + +print A * B +// expect: [ 8 + 8im 5 + 5im ] +// expect: [ 20 + 20im 13 + 13im ] diff --git a/test/linalg/arithmetic/complexmatrix_mul_scalar.morpho b/test/linalg/arithmetic/complexmatrix_mul_scalar.morpho new file mode 100644 index 000000000..d3d404ed0 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_mul_scalar.morpho @@ -0,0 +1,10 @@ +// Multiply ComplexMatrix by scalar + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[1,1]=2+2im + +print A * 2 +// expect: [ 2 + 2im 0 + 0im ] +// expect: [ 0 + 0im 4 + 4im ] + diff --git a/test/linalg/arithmetic/complexmatrix_mulr_matrix.morpho b/test/linalg/arithmetic/complexmatrix_mulr_matrix.morpho new file mode 100644 index 000000000..35c26580a --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_mulr_matrix.morpho @@ -0,0 +1,14 @@ +// Multiply two ComplexMatrices + +var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) +var B = Matrix(((4,3),(2,1))) + +print B * A +// expect: [ 13 + 13im 20 + 20im ] +// expect: [ 5 + 5im 8 + 8im ] + +var C = ComplexMatrix([[1+1im],[3+3im]]) + +print B * C +// expect: [ 13 + 13im ] +// expect: [ 5 + 5im ] diff --git a/test/linalg/arithmetic/complexmatrix_sub_complexmatrix.morpho b/test/linalg/arithmetic/complexmatrix_sub_complexmatrix.morpho new file mode 100644 index 000000000..9ad9e528e --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_sub_complexmatrix.morpho @@ -0,0 +1,8 @@ +// Subtract a complexmatrix from a complexmatrix + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = ComplexMatrix(((4+4im, 3+3im), (2+2im, 1+1im))) + +print A - B +// expect: [ -3 - 3im -1 - 1im ] +// expect: [ 1 + 1im 3 + 3im ] diff --git a/test/linalg/arithmetic/complexmatrix_sub_matrix.morpho b/test/linalg/arithmetic/complexmatrix_sub_matrix.morpho new file mode 100644 index 000000000..f80d0e42b --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_sub_matrix.morpho @@ -0,0 +1,8 @@ +// Subtract a matrix from a complexmatrix + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = Matrix(((4, 3), (2, 1))) + +print A - B +// expect: [ -3 + 1im -1 + 2im ] +// expect: [ 1 + 3im 3 + 4im ] diff --git a/test/linalg/arithmetic/complexmatrix_sub_scalar.morpho b/test/linalg/arithmetic/complexmatrix_sub_scalar.morpho new file mode 100644 index 000000000..bfc60320c --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_sub_scalar.morpho @@ -0,0 +1,9 @@ +// Subtract a scalar + +var A = ComplexMatrix(2,2) +A[0,0]=2+2im +A[1,1]=2+2im + +print A - 2 +// expect: [ 0 + 2im -2 + 0im ] +// expect: [ -2 + 0im 0 + 2im ] diff --git a/test/linalg/arithmetic/complexmatrix_subr_matrix.morpho b/test/linalg/arithmetic/complexmatrix_subr_matrix.morpho new file mode 100644 index 000000000..17219a276 --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_subr_matrix.morpho @@ -0,0 +1,8 @@ +// Subtract a matrix from a complexmatrix + +var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) +var B = Matrix(((4, 3), (2, 1))) + +print B - A +// expect: [ 3 - 1im 1 - 2im ] +// expect: [ -1 - 3im -3 - 4im ] diff --git a/test/linalg/arithmetic/complexmatrix_subr_scalar.morpho b/test/linalg/arithmetic/complexmatrix_subr_scalar.morpho new file mode 100644 index 000000000..4ea9a1ddb --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_subr_scalar.morpho @@ -0,0 +1,9 @@ +// Subtract a scalar + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[1,1]=1+im + +print 2 - A +// expect: [ 1 - 1im 2 + 0im ] +// expect: [ 2 + 0im 1 - 1im ] diff --git a/test/linalg/arithmetic/matrix_acc.morpho b/test/linalg/arithmetic/matrix_acc.morpho new file mode 100644 index 000000000..d00b5a96a --- /dev/null +++ b/test/linalg/arithmetic/matrix_acc.morpho @@ -0,0 +1,13 @@ +// In-place accumulate + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=1 +A[1,0]=1 +A[1,1]=1 + +A.acc(2,A) + +print A +// expect: [ 3 3 ] +// expect: [ 3 3 ] diff --git a/test/linalg/arithmetic/matrix_add_matrix.morpho b/test/linalg/arithmetic/matrix_add_matrix.morpho new file mode 100644 index 000000000..b52bd49b5 --- /dev/null +++ b/test/linalg/arithmetic/matrix_add_matrix.morpho @@ -0,0 +1,10 @@ +// Matrix arithmetic + +var a = Matrix([[1, 2], [3, 4]]) +var b = Matrix([[0, 1], [1, 0]]) + +print "A+B:" +print a+b +// expect: A+B: +// expect: [ 1 3 ] +// expect: [ 4 4 ] diff --git a/test/linalg/arithmetic/matrix_add_nil.morpho b/test/linalg/arithmetic/matrix_add_nil.morpho new file mode 100644 index 000000000..d44a45f6b --- /dev/null +++ b/test/linalg/arithmetic/matrix_add_nil.morpho @@ -0,0 +1,7 @@ +// Add a scalar + +var A = Matrix(2,2) + +print A + nil +// expect: [ 0 0 ] +// expect: [ 0 0 ] diff --git a/test/linalg/arithmetic/matrix_add_scalar.morpho b/test/linalg/arithmetic/matrix_add_scalar.morpho new file mode 100644 index 000000000..01fed20dc --- /dev/null +++ b/test/linalg/arithmetic/matrix_add_scalar.morpho @@ -0,0 +1,7 @@ +// Add a scalar + +var A = Matrix(2,2) + +print A + 2 +// expect: [ 2 2 ] +// expect: [ 2 2 ] diff --git a/test/linalg/arithmetic/matrix_addr_nil.morpho b/test/linalg/arithmetic/matrix_addr_nil.morpho new file mode 100644 index 000000000..b7c63e21c --- /dev/null +++ b/test/linalg/arithmetic/matrix_addr_nil.morpho @@ -0,0 +1,8 @@ +// Add nil from the right + +var A = Matrix(2,2) +A += 1 + +print nil + A +// expect: [ 1 1 ] +// expect: [ 1 1 ] diff --git a/test/linalg/arithmetic/matrix_addr_scalar.morpho b/test/linalg/arithmetic/matrix_addr_scalar.morpho new file mode 100644 index 000000000..7a543255e --- /dev/null +++ b/test/linalg/arithmetic/matrix_addr_scalar.morpho @@ -0,0 +1,7 @@ +// Add a scalar from the right + +var A = Matrix(2,2) + +print 2 + A +// expect: [ 2 2 ] +// expect: [ 2 2 ] diff --git a/test/linalg/arithmetic/matrix_div_matrix.morpho b/test/linalg/arithmetic/matrix_div_matrix.morpho new file mode 100644 index 000000000..731d9633f --- /dev/null +++ b/test/linalg/arithmetic/matrix_div_matrix.morpho @@ -0,0 +1,16 @@ +// Divide Matrix by Matrix (solve linear system) + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +var b = Matrix(2,1) +b[0]=1 +b[1]=2 + +print b / A +// expect: [ 0 ] +// expect: [ 0.5 ] + diff --git a/test/linalg/arithmetic/matrix_div_scalar.morpho b/test/linalg/arithmetic/matrix_div_scalar.morpho new file mode 100644 index 000000000..56b9cb613 --- /dev/null +++ b/test/linalg/arithmetic/matrix_div_scalar.morpho @@ -0,0 +1,10 @@ +// Divide Matrix by scalar + +var A = Matrix(2,2) +A[0,0]=2 +A[1,1]=4 + +print A / 2 +// expect: [ 1 0 ] +// expect: [ 0 2 ] + diff --git a/test/linalg/arithmetic/matrix_mul_matrix.morpho b/test/linalg/arithmetic/matrix_mul_matrix.morpho new file mode 100644 index 000000000..24ff63ede --- /dev/null +++ b/test/linalg/arithmetic/matrix_mul_matrix.morpho @@ -0,0 +1,35 @@ +// Multiply two Matrices + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +var B = Matrix(2,2) +B[0,0]=1 +B[0,1]=0 +B[1,0]=0 +B[1,1]=1 + +print A * B +// expect: [ 1 2 ] +// expect: [ 3 4 ] + +var a = Matrix([[1, 2], [3, 4]]) +var b = Matrix([[0, 1], [1, 0]]) + +print "A*B:" +print a*b +// expect: A*B: +// expect: [ 2 1 ] +// expect: [ 4 3 ] + +var c = Matrix([[1,2,3], [4,5,6]]) +var d = Matrix([[1,2], [3,4], [5,6]]) + +print "C*D:" +print c*d +// expect: C*D: +// expect: [ 22 28 ] +// expect: [ 49 64 ] diff --git a/test/linalg/arithmetic/matrix_mul_scalar.morpho b/test/linalg/arithmetic/matrix_mul_scalar.morpho new file mode 100644 index 000000000..3d7f6c9e5 --- /dev/null +++ b/test/linalg/arithmetic/matrix_mul_scalar.morpho @@ -0,0 +1,10 @@ +// Multiply Matrix by scalar + +var A = Matrix(2,2) +A[0,0]=1 +A[1,1]=2 + +print A * 2 +// expect: [ 2 0 ] +// expect: [ 0 4 ] + diff --git a/test/linalg/arithmetic/matrix_negate.morpho b/test/linalg/arithmetic/matrix_negate.morpho new file mode 100644 index 000000000..82fec4051 --- /dev/null +++ b/test/linalg/arithmetic/matrix_negate.morpho @@ -0,0 +1,7 @@ +// Negate + +var a = Matrix([[1,2], [3,4]]) + +print -a +// expect: [ -1 -2 ] +// expect: [ -3 -4 ] diff --git a/test/linalg/arithmetic/matrix_sub_matrix.morpho b/test/linalg/arithmetic/matrix_sub_matrix.morpho new file mode 100644 index 000000000..571b9876b --- /dev/null +++ b/test/linalg/arithmetic/matrix_sub_matrix.morpho @@ -0,0 +1,12 @@ +// Matrix arithmetic + +var a = Matrix([[1, 2], [3, 4]]) +var b = Matrix([[0, 1], [1, 0]]) + + +print "A-B:" +print a-b +// expect: A-B: +// expect: [ 1 1 ] +// expect: [ 2 4 ] + diff --git a/test/linalg/arithmetic/matrix_sub_scalar.morpho b/test/linalg/arithmetic/matrix_sub_scalar.morpho new file mode 100644 index 000000000..c01149bb2 --- /dev/null +++ b/test/linalg/arithmetic/matrix_sub_scalar.morpho @@ -0,0 +1,7 @@ +// Subtract a scalar + +var A = Matrix(2,2) + +print A - 2 +// expect: [ -2 -2 ] +// expect: [ -2 -2 ] diff --git a/test/linalg/arithmetic/matrix_subr_scalar.morpho b/test/linalg/arithmetic/matrix_subr_scalar.morpho new file mode 100644 index 000000000..b12d6437f --- /dev/null +++ b/test/linalg/arithmetic/matrix_subr_scalar.morpho @@ -0,0 +1,9 @@ +// Subtract a scalar + +var A = Matrix(2,2) +A[0,0]=1 +A[1,1]=1 + +print 2 - A +// expect: [ 1 2 ] +// expect: [ 2 1 ] diff --git a/test/linalg/assign/complexmatrix_assign.morpho b/test/linalg/assign/complexmatrix_assign.morpho new file mode 100644 index 000000000..087bd5cde --- /dev/null +++ b/test/linalg/assign/complexmatrix_assign.morpho @@ -0,0 +1,15 @@ +// Assign one ComplexMatrix to another + +var A = ComplexMatrix(2,2) +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +var B = ComplexMatrix(2,2) + +B.assign(A) + +print B +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] diff --git a/test/linalg/assign/complexmatrix_clone.morpho b/test/linalg/assign/complexmatrix_clone.morpho new file mode 100644 index 000000000..2bc18f9fc --- /dev/null +++ b/test/linalg/assign/complexmatrix_clone.morpho @@ -0,0 +1,18 @@ +// Clone a ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = A.clone() + +// Modify original +A[0,0]=9+9im + +// Clone should be unchanged +print B +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] + diff --git a/test/linalg/assign/matrix_assign.morpho b/test/linalg/assign/matrix_assign.morpho new file mode 100644 index 000000000..ee4d5ecd1 --- /dev/null +++ b/test/linalg/assign/matrix_assign.morpho @@ -0,0 +1,18 @@ +// Assign one matrix to another + +var A = Matrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +var B = Matrix(2,2) +B.assign(A) + +print B +// expect: [ 1 2 ] +// expect: [ 3 4 ] + +var C = Matrix(1,2) +B.assign(C) +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/linalg/constructors/complexmatrix_array_constructor.morpho b/test/linalg/constructors/complexmatrix_array_constructor.morpho new file mode 100644 index 000000000..949aadaa6 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_array_constructor.morpho @@ -0,0 +1,13 @@ +// Create a Matrix from an Array + +var a[2,2] +a[0,0]=1+im +a[1,0]=2-2im +a[0,1]=3+3im +a[1,1]=4+4im + +var A = ComplexMatrix(a) + +print A +// expect: [ 1 + 1im 3 + 3im ] +// expect: [ 2 - 2im 4 + 4im ] diff --git a/test/linalg/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho b/test/linalg/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho new file mode 100644 index 000000000..6a6ba5fb4 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho @@ -0,0 +1,11 @@ +// ComplexMatrix constructor from Array with invalid dimensions + +// Try to construct from a 1D array (should fail - requires 2D) +var a[4] +a[0] = 1 +a[1] = 2 +a[2] = 3 +a[3] = 4 + +print ComplexMatrix(a) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/constructors/complexmatrix_constructor.morpho b/test/linalg/constructors/complexmatrix_constructor.morpho new file mode 100644 index 000000000..8723c996e --- /dev/null +++ b/test/linalg/constructors/complexmatrix_constructor.morpho @@ -0,0 +1,8 @@ +// Create a ComplexMatrix + +var A = ComplexMatrix(2,2) + +print A +// expect: [ 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im ] + diff --git a/test/linalg/constructors/complexmatrix_constructor_edge_cases.morpho b/test/linalg/constructors/complexmatrix_constructor_edge_cases.morpho new file mode 100644 index 000000000..84a1a761d --- /dev/null +++ b/test/linalg/constructors/complexmatrix_constructor_edge_cases.morpho @@ -0,0 +1,47 @@ +// ComplexMatrix constructor edge cases + +// Zero dimension matrix (0x0) +var A = ComplexMatrix(0, 0) +print A.dimensions() +// expect: (0, 0) +print A.count() +// expect: 0 + +// Zero rows, non-zero columns +var B = ComplexMatrix(0, 3) +print B.dimensions() +// expect: (0, 3) +print B.count() +// expect: 0 + +// Non-zero rows, zero columns +var C = ComplexMatrix(3, 0) +print C.dimensions() +// expect: (3, 0) +print C.count() +// expect: 0 + +// Single element matrix (1x1) +var D = ComplexMatrix(1, 1) +D[0,0] = 42+10im +print D +// expect: [ 42 + 10im ] + +// Single row matrix (1xN) +var E = ComplexMatrix(1, 3) +E[0,0] = 1+im +E[0,1] = 2+2im +E[0,2] = 3+3im +print E +// expect: [ 1 + 1im 2 + 2im 3 + 3im ] + +// Single column matrix (Nx1) +var F = ComplexMatrix(3, 1) +F[0,0] = 1+im +F[1,0] = 2+2im +F[2,0] = 3+3im +print F +// expect: [ 1 + 1im ] +// expect: [ 2 + 2im ] +// expect: [ 3 + 3im ] + diff --git a/test/linalg/constructors/complexmatrix_constructor_invalid_args.morpho b/test/linalg/constructors/complexmatrix_constructor_invalid_args.morpho new file mode 100644 index 000000000..9e7e894a3 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_constructor_invalid_args.morpho @@ -0,0 +1,5 @@ +// ComplexMatrix constructor with invalid arguments + +// Try to construct with invalid argument types +print ComplexMatrix("invalid") +// expect error 'MltplDsptchFld' diff --git a/test/linalg/constructors/complexmatrix_list_constructor.morpho b/test/linalg/constructors/complexmatrix_list_constructor.morpho new file mode 100644 index 000000000..7857d52d8 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_list_constructor.morpho @@ -0,0 +1,7 @@ +// Create a ComplexMatrix from a List of Lists + +var A = ComplexMatrix([[1+im,2-2im],[3+3im,4-4im]]) + +print A +// expect: [ 1 + 1im 2 - 2im ] +// expect: [ 3 + 3im 4 - 4im ] diff --git a/test/linalg/constructors/complexmatrix_list_vector_constructor.morpho b/test/linalg/constructors/complexmatrix_list_vector_constructor.morpho new file mode 100644 index 000000000..1e1cd1a7a --- /dev/null +++ b/test/linalg/constructors/complexmatrix_list_vector_constructor.morpho @@ -0,0 +1,16 @@ +// Create a ComplexMatrix from a List of Values + +var A = ComplexMatrix([1+im, 2-2im, 3+3im, 4-4im]) + +print A +// expect: [ 1 + 1im ] +// expect: [ 2 - 2im ] +// expect: [ 3 + 3im ] +// expect: [ 4 - 4im ] + +var B = ComplexMatrix(((1+im), (2), (3), (4-4im))) +print B +// expect: [ 1 + 1im ] +// expect: [ 2 + 0im ] +// expect: [ 3 + 0im ] +// expect: [ 4 - 4im ] diff --git a/test/linalg/constructors/complexmatrix_matrix_constructor.morpho b/test/linalg/constructors/complexmatrix_matrix_constructor.morpho new file mode 100644 index 000000000..fbb03772f --- /dev/null +++ b/test/linalg/constructors/complexmatrix_matrix_constructor.morpho @@ -0,0 +1,9 @@ +// Create a Matrix from an Array + +var A = Matrix(((1,2), (3,4))) + +var B = ComplexMatrix(A) + +print B +// expect: [ 1 + 0im 2 + 0im ] +// expect: [ 3 + 0im 4 + 0im ] diff --git a/test/linalg/constructors/complexmatrix_tuple_column_constructor.morpho b/test/linalg/constructors/complexmatrix_tuple_column_constructor.morpho new file mode 100644 index 000000000..9a8eca727 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_tuple_column_constructor.morpho @@ -0,0 +1,7 @@ +// Create a column vector from a list of tuples + +var C = ComplexMatrix(((1+1im),(3+3im))) + +print C +// expect: [ 1 + 1im ] +// expect: [ 3 + 3im ] diff --git a/test/linalg/constructors/complexmatrix_tuple_constructor.morpho b/test/linalg/constructors/complexmatrix_tuple_constructor.morpho new file mode 100644 index 000000000..10bbd9faa --- /dev/null +++ b/test/linalg/constructors/complexmatrix_tuple_constructor.morpho @@ -0,0 +1,7 @@ +// Create a ComplexMatrix from a List of Lists + +var A = ComplexMatrix(((1+im,2-2im),(3+3im,4-4im))) + +print A +// expect: [ 1 + 1im 2 - 2im ] +// expect: [ 3 + 3im 4 - 4im ] diff --git a/test/linalg/constructors/complexmatrix_vector_constructor.morpho b/test/linalg/constructors/complexmatrix_vector_constructor.morpho new file mode 100644 index 000000000..4d83b2af9 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_vector_constructor.morpho @@ -0,0 +1,8 @@ +// Create a ComplexMatrix column vector + +var A = ComplexMatrix(2) + +print A +// expect: [ 0 + 0im ] +// expect: [ 0 + 0im ] + diff --git a/test/linalg/constructors/matrix_array_constructor.morpho b/test/linalg/constructors/matrix_array_constructor.morpho new file mode 100644 index 000000000..08e97a0fb --- /dev/null +++ b/test/linalg/constructors/matrix_array_constructor.morpho @@ -0,0 +1,14 @@ +// Create a Matrix from an Array + +var a[2,2] +a[0,0]=1 +a[1,0]=3 +a[0,1]=2 +a[1,1]=4 + +var A = Matrix(a) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] + diff --git a/test/linalg/constructors/matrix_array_constructor_invalid_dimensions.morpho b/test/linalg/constructors/matrix_array_constructor_invalid_dimensions.morpho new file mode 100644 index 000000000..4a9abbfc9 --- /dev/null +++ b/test/linalg/constructors/matrix_array_constructor_invalid_dimensions.morpho @@ -0,0 +1,11 @@ +// Matrix constructor from Array with invalid dimensions + +// Try to construct from a 1D array (should fail - requires 2D) +var a[4] +a[0] = 1 +a[1] = 2 +a[2] = 3 +a[3] = 4 + +print Matrix(a) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/constructors/matrix_constructor.morpho b/test/linalg/constructors/matrix_constructor.morpho new file mode 100644 index 000000000..5d35ef539 --- /dev/null +++ b/test/linalg/constructors/matrix_constructor.morpho @@ -0,0 +1,8 @@ +// Create a Matrix + +var A = Matrix(2,2) + +print A +// expect: [ 0 0 ] +// expect: [ 0 0 ] + diff --git a/test/linalg/constructors/matrix_constructor_edge_cases.morpho b/test/linalg/constructors/matrix_constructor_edge_cases.morpho new file mode 100644 index 000000000..d0810cdbe --- /dev/null +++ b/test/linalg/constructors/matrix_constructor_edge_cases.morpho @@ -0,0 +1,47 @@ +// Matrix constructor edge cases + +// Zero dimension matrix (0x0) +var A = Matrix(0, 0) +print A.dimensions() +// expect: (0, 0) +print A.count() +// expect: 0 + +// Zero rows, non-zero columns +var B = Matrix(0, 3) +print B.dimensions() +// expect: (0, 3) +print B.count() +// expect: 0 + +// Non-zero rows, zero columns +var C = Matrix(3, 0) +print C.dimensions() +// expect: (3, 0) +print C.count() +// expect: 0 + +// Single element matrix (1x1) +var D = Matrix(1, 1) +D[0,0] = 42 +print D +// expect: [ 42 ] + +// Single row matrix (1xN) +var E = Matrix(1, 3) +E[0,0] = 1 +E[0,1] = 2 +E[0,2] = 3 +print E +// expect: [ 1 2 3 ] + +// Single column matrix (Nx1) +var F = Matrix(3, 1) +F[0,0] = 1 +F[1,0] = 2 +F[2,0] = 3 +print F +// expect: [ 1 ] +// expect: [ 2 ] +// expect: [ 3 ] + diff --git a/test/linalg/constructors/matrix_identity_constructor.morpho b/test/linalg/constructors/matrix_identity_constructor.morpho new file mode 100644 index 000000000..155ff8bc6 --- /dev/null +++ b/test/linalg/constructors/matrix_identity_constructor.morpho @@ -0,0 +1,12 @@ +// IdentityMatrix constructor + +var I = IdentityMatrix(3) + +print I +// expect: [ 1 0 0 ] +// expect: [ 0 1 0 ] +// expect: [ 0 0 1 ] + +var I2 = IdentityMatrix(1) +print I2 +// expect: [ 1 ] diff --git a/test/linalg/constructors/matrix_list_constructor.morpho b/test/linalg/constructors/matrix_list_constructor.morpho new file mode 100644 index 000000000..edb28f032 --- /dev/null +++ b/test/linalg/constructors/matrix_list_constructor.morpho @@ -0,0 +1,7 @@ +// Create a Matrix from a List of Lists + +var A = Matrix([[1,2],[3,4]]) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] diff --git a/test/linalg/constructors/matrix_list_vector_constructor.morpho b/test/linalg/constructors/matrix_list_vector_constructor.morpho new file mode 100644 index 000000000..802efd434 --- /dev/null +++ b/test/linalg/constructors/matrix_list_vector_constructor.morpho @@ -0,0 +1,7 @@ +// Create a column vector from a list of tuples + +var C = Matrix(((1),(2))) + +print C +// expect: [ 1 ] +// expect: [ 2 ] diff --git a/test/linalg/constructors/matrix_tuple_constructor.morpho b/test/linalg/constructors/matrix_tuple_constructor.morpho new file mode 100644 index 000000000..5b18ceb86 --- /dev/null +++ b/test/linalg/constructors/matrix_tuple_constructor.morpho @@ -0,0 +1,14 @@ +// Create a Matrix from a Tuple of Tuples + +var A = Matrix(((1,2),(3,4))) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] + +// Mix Tuples and Lists +var B = Matrix(([1,2],[3,4])) + +print B +// expect: [ 1 2 ] +// expect: [ 3 4 ] diff --git a/test/linalg/constructors/matrix_vector_constructor.morpho b/test/linalg/constructors/matrix_vector_constructor.morpho new file mode 100644 index 000000000..a82c4f36b --- /dev/null +++ b/test/linalg/constructors/matrix_vector_constructor.morpho @@ -0,0 +1,7 @@ +// Create a Matrix + +var A = Matrix(2) + +print A +// expect: [ 0 ] +// expect: [ 0 ] diff --git a/test/linalg/constructors/vector_constructor.morpho b/test/linalg/constructors/vector_constructor.morpho new file mode 100644 index 000000000..2d5c07bce --- /dev/null +++ b/test/linalg/constructors/vector_constructor.morpho @@ -0,0 +1,8 @@ +// Create a column vector + +var A = Matrix(2) + +print A +// expect: [ 0 ] +// expect: [ 0 ] + diff --git a/test/linalg/errors/complexmatrix_incompatible_dimensions.morpho b/test/linalg/errors/complexmatrix_incompatible_dimensions.morpho new file mode 100644 index 000000000..ab1e19d2b --- /dev/null +++ b/test/linalg/errors/complexmatrix_incompatible_dimensions.morpho @@ -0,0 +1,12 @@ +// Incompatible dimensions error + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im + +var B = ComplexMatrix(3,3) +B[0,0]=1+1im + +// Try to add incompatible matrices +print A + B +// expect error 'LnAlgMtrxIncmptbl' + diff --git a/test/linalg/errors/complexmatrix_index_out_of_bounds.morpho b/test/linalg/errors/complexmatrix_index_out_of_bounds.morpho new file mode 100644 index 000000000..56f306443 --- /dev/null +++ b/test/linalg/errors/complexmatrix_index_out_of_bounds.morpho @@ -0,0 +1,9 @@ +// Index out of bounds error + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im + +// Try to access out of bounds +print A[5,5] +// expect error 'LnAlgMtrxIndxBnds' + diff --git a/test/linalg/errors/complexmatrix_non_square_error.morpho b/test/linalg/errors/complexmatrix_non_square_error.morpho new file mode 100644 index 000000000..dd526a455 --- /dev/null +++ b/test/linalg/errors/complexmatrix_non_square_error.morpho @@ -0,0 +1,9 @@ +// Non-square matrix err. (for operations requiring square matrices) + +var A = ComplexMatrix(2,3) +A[0,0]=1+1im + +// Try trace on non-square matrix +print A.trace() +// expect error 'LnAlgMtrxNtSq' + diff --git a/test/linalg/index/complexmatrix_getcolumn.morpho b/test/linalg/index/complexmatrix_getcolumn.morpho new file mode 100644 index 000000000..b8b74afa6 --- /dev/null +++ b/test/linalg/index/complexmatrix_getcolumn.morpho @@ -0,0 +1,17 @@ +// Get columns of a ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +print A.column(0) +// expect: [ 1 + 1im ] +// expect: [ 3 + 3im ] + +print A.column(1) +// expect: [ 2 + 2im ] +// expect: [ 4 + 4im ] + +print A.column(2) // expect error 'LnAlgMtrxIndxBnds' diff --git a/test/linalg/index/complexmatrix_getindex.morpho b/test/linalg/index/complexmatrix_getindex.morpho new file mode 100644 index 000000000..230695389 --- /dev/null +++ b/test/linalg/index/complexmatrix_getindex.morpho @@ -0,0 +1,19 @@ +// Get elements of a ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0] = 1+1im +A[1,0] = 2+2im +A[0,1] = 3+3im +A[1,1] = 4+4im + +// Array-like access +print A[0,0] // expect: 1 + 1im +print A[1,0] // expect: 2 + 2im +print A[0,1] // expect: 3 + 3im +print A[1,1] // expect: 4 + 4im + +// Vector-like access +print A[0] // expect: 1 + 1im +print A[1] // expect: 2 + 2im +print A[2] // expect: 3 + 3im +print A[3] // expect: 4 + 4im diff --git a/test/linalg/index/complexmatrix_setcolumn.morpho b/test/linalg/index/complexmatrix_setcolumn.morpho new file mode 100644 index 000000000..71cd496a7 --- /dev/null +++ b/test/linalg/index/complexmatrix_setcolumn.morpho @@ -0,0 +1,20 @@ +// Set columns of a Matrix + +var A = ComplexMatrix(2,2) + +var b = ComplexMatrix(2,1) +b[0] = 1+1im +b[1] = 3+3im + +var c = ComplexMatrix(2,1) +c[0] = 2+2im +c[1] = 4+4im + +A.setColumn(0,b) +A.setColumn(1,c) + +print A +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] + +print A.setColumn(2,b) // expect error 'LnAlgMtrxIndxBnds' diff --git a/test/linalg/index/complexmatrix_setindex.morpho b/test/linalg/index/complexmatrix_setindex.morpho new file mode 100644 index 000000000..50fac8e29 --- /dev/null +++ b/test/linalg/index/complexmatrix_setindex.morpho @@ -0,0 +1,19 @@ +// Set elements of a ComplexMatrix + +var A = ComplexMatrix(2,2) + +// Set using two indices +A[0,0] = 1+1im +A[0,1] = 2+2im +A[1,0] = 3+3im +A[1,1] = 4+4im + +print A +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im ] + +// Set using single index (vector-like) +A[0] = 5+5im +print A[0,0] +// expect: 5 + 5im + diff --git a/test/linalg/index/complexmatrix_setindex_real.morpho b/test/linalg/index/complexmatrix_setindex_real.morpho new file mode 100644 index 000000000..775b9e554 --- /dev/null +++ b/test/linalg/index/complexmatrix_setindex_real.morpho @@ -0,0 +1,14 @@ +// Set elements of a ComplexMatrix with mixture of Complex and Real args + +var A = ComplexMatrix(2,2) + +// Set using two indices +A[0,0] = 1+im // Make sure imag part is zero'd out +A[0,0] = 1 +A[0,1] = 2+2im +A[1,0] = 3.0 +A[1,1] = 4+4im + +print A +// expect: [ 1 + 0im 2 + 2im ] +// expect: [ 3 + 0im 4 + 4im ] diff --git a/test/linalg/index/complexmatrix_setslice.morpho b/test/linalg/index/complexmatrix_setslice.morpho new file mode 100644 index 000000000..fc67163e8 --- /dev/null +++ b/test/linalg/index/complexmatrix_setslice.morpho @@ -0,0 +1,49 @@ +// Copy elements of a ComplexMatrix using slices + +var A = ComplexMatrix(((1+1im,2+2im),(3+3im,4+4im))) + +var B = ComplexMatrix(4,4) + +B[0..1, 0..1] = A +print B +// expect: [ 1 + 1im 2 + 2im 0 + 0im 0 + 0im ] +// expect: [ 3 + 3im 4 + 4im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +var C = ComplexMatrix(4,4) +C[0..2:2, 0..2:2] = A +print C +// expect: [ 1 + 1im 0 + 0im 2 + 2im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 3 + 3im 0 + 0im 4 + 4im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +var D = ComplexMatrix(4,4) +D[1..2, 1..2] = A +print D +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 1 + 1im 2 + 2im 0 + 0im ] +// expect: [ 0 + 0im 3 + 3im 4 + 4im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +var E = ComplexMatrix(4,4) +E[1..3:2, 1..3:2] = A +print E +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 1 + 1im 0 + 0im 2 + 2im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 3 + 3im 0 + 0im 4 + 4im ] + +var F = ComplexMatrix(4,4) +F[0..1, 0] = A[0..1, 1] +print F +// expect: [ 2 + 2im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 4 + 4im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] +// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] + +B[0..5, 0..5] = A +print B +// expect error 'LnAlgMtrxIndxBnds' + diff --git a/test/linalg/index/complexmatrix_slice.morpho b/test/linalg/index/complexmatrix_slice.morpho new file mode 100644 index 000000000..813ca13b6 --- /dev/null +++ b/test/linalg/index/complexmatrix_slice.morpho @@ -0,0 +1,24 @@ +// Slice a ComplexMatrix + +var A = ComplexMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16)))*(1+1im) + +print A[0..1, 0..1] +// expect: [ 1 + 1im 2 + 2im ] +// expect: [ 5 + 5im 6 + 6im ] + +print A[0..2, 0] +// expect: [ 1 + 1im ] +// expect: [ 5 + 5im ] +// expect: [ 9 + 9im ] + +print A[2..0:-1, 0] +// expect: [ 9 + 9im ] +// expect: [ 5 + 5im ] +// expect: [ 1 + 1im ] + +print A[0..3:2, 0..3:2] +// expect: [ 1 + 1im 3 + 3im ] +// expect: [ 9 + 9im 11 + 11im ] + +print A[0..1:2, "Foo"] +// expect error 'LnAlgMtrxNnNmrclArg' diff --git a/test/linalg/index/matrix_getcolumn.morpho b/test/linalg/index/matrix_getcolumn.morpho new file mode 100644 index 000000000..a064f70b4 --- /dev/null +++ b/test/linalg/index/matrix_getcolumn.morpho @@ -0,0 +1,17 @@ +// Get columns of a Matrix + +var A = Matrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +print A.column(0) +// expect: [ 1 ] +// expect: [ 3 ] + +print A.column(1) +// expect: [ 2 ] +// expect: [ 4 ] + +print A.column(2) // expect error 'LnAlgMtrxIndxBnds' diff --git a/test/linalg/index/matrix_getindex.morpho b/test/linalg/index/matrix_getindex.morpho new file mode 100644 index 000000000..d32c767d2 --- /dev/null +++ b/test/linalg/index/matrix_getindex.morpho @@ -0,0 +1,19 @@ +// Get elements of a Matrix + +var A = Matrix(2,2) +A[0,0] = 1 +A[1,0] = 2 +A[0,1] = 3 +A[1,1] = 4 + +// Array-like access +print A[0,0] // expect: 1 +print A[1,0] // expect: 2 +print A[0,1] // expect: 3 +print A[1,1] // expect: 4 + +// Vector-like access +print A[0] // expect: 1 +print A[1] // expect: 2 +print A[2] // expect: 3 +print A[3] // expect: 4 diff --git a/test/linalg/index/matrix_setcolumn.morpho b/test/linalg/index/matrix_setcolumn.morpho new file mode 100644 index 000000000..7a82bf3e7 --- /dev/null +++ b/test/linalg/index/matrix_setcolumn.morpho @@ -0,0 +1,20 @@ +// Set columns of a Matrix + +var A = Matrix(2,2) + +var b = Matrix(2,1) +b[0] = 1 +b[1] = 3 + +var c = Matrix(2,1) +c[0] = 2 +c[1] = 4 + +A.setColumn(0,b) +A.setColumn(1,c) + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] + +print A.setColumn(2,b) // expect error 'LnAlgMtrxIndxBnds' diff --git a/test/linalg/index/matrix_setindex.morpho b/test/linalg/index/matrix_setindex.morpho new file mode 100644 index 000000000..f657f3481 --- /dev/null +++ b/test/linalg/index/matrix_setindex.morpho @@ -0,0 +1,11 @@ +// Set elements of a Matrix + +var A = Matrix(2,2) +A[0,0] = 1 +A[0,1] = 2 +A[1,0] = 3 +A[1,1] = 4 + +print A +// expect: [ 1 2 ] +// expect: [ 3 4 ] diff --git a/test/linalg/index/matrix_setslice.morpho b/test/linalg/index/matrix_setslice.morpho new file mode 100644 index 000000000..0eb544977 --- /dev/null +++ b/test/linalg/index/matrix_setslice.morpho @@ -0,0 +1,48 @@ +// Copy elements of a Matrix using slices + +var A = Matrix(((1,2),(3,4))) + +var B = Matrix(4,4) + +B[0..1, 0..1] = A +print B +// expect: [ 1 2 0 0 ] +// expect: [ 3 4 0 0 ] +// expect: [ 0 0 0 0 ] +// expect: [ 0 0 0 0 ] + +var C = Matrix(4,4) +C[0..2:2, 0..2:2] = A +print C +// expect: [ 1 0 2 0 ] +// expect: [ 0 0 0 0 ] +// expect: [ 3 0 4 0 ] +// expect: [ 0 0 0 0 ] + +var D = Matrix(4,4) +D[1..2, 1..2] = A +print D +// expect: [ 0 0 0 0 ] +// expect: [ 0 1 2 0 ] +// expect: [ 0 3 4 0 ] +// expect: [ 0 0 0 0 ] + +var E = Matrix(4,4) +E[1..3:2, 1..3:2] = A +print E +// expect: [ 0 0 0 0 ] +// expect: [ 0 1 0 2 ] +// expect: [ 0 0 0 0 ] +// expect: [ 0 3 0 4 ] + +var F = Matrix(4,4) +F[0..1, 0] = A[0..1, 1] +print F +// expect: [ 2 0 0 0 ] +// expect: [ 4 0 0 0 ] +// expect: [ 0 0 0 0 ] +// expect: [ 0 0 0 0 ] + +B[0..5, 0..5] = A +print B +// expect error 'LnAlgMtrxIndxBnds' diff --git a/test/linalg/index/matrix_slice.morpho b/test/linalg/index/matrix_slice.morpho new file mode 100644 index 000000000..27d1aec77 --- /dev/null +++ b/test/linalg/index/matrix_slice.morpho @@ -0,0 +1,24 @@ +// Slice a Matrix + +var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) + +print A[0..1, 0..1] +// expect: [ 1 2 ] +// expect: [ 5 6 ] + +print A[0..2, 0] +// expect: [ 1 ] +// expect: [ 5 ] +// expect: [ 9 ] + +print A[2..0:-1, 0] +// expect: [ 9 ] +// expect: [ 5 ] +// expect: [ 1 ] + +print A[0..3:2, 0..3:2] +// expect: [ 1 3 ] +// expect: [ 9 11 ] + +print A[0..1:2, "Foo"] +// expect error 'LnAlgMtrxNnNmrclArg' diff --git a/test/linalg/index/matrix_slice_bounds.morpho b/test/linalg/index/matrix_slice_bounds.morpho new file mode 100644 index 000000000..f0bce0a7e --- /dev/null +++ b/test/linalg/index/matrix_slice_bounds.morpho @@ -0,0 +1,6 @@ +// Slice a Matrix out of bounds + +var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) + +print A[0..5, 0..2] +// expect error 'LnAlgMtrxIndxBnds' diff --git a/test/linalg/index/matrix_slice_infinite_range.morpho b/test/linalg/index/matrix_slice_infinite_range.morpho new file mode 100644 index 000000000..63c2bf84d --- /dev/null +++ b/test/linalg/index/matrix_slice_infinite_range.morpho @@ -0,0 +1,6 @@ +// Slice a Matrix with a range that doesn't halt + +var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) + +print A[0..3:-1, 0] +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/methods/complexmatrix_conj.morpho b/test/linalg/methods/complexmatrix_conj.morpho new file mode 100644 index 000000000..c02d0f8c1 --- /dev/null +++ b/test/linalg/methods/complexmatrix_conj.morpho @@ -0,0 +1,11 @@ +// Conjugate of a ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.conj() +// expect: [ 1 - 4im 2 - 3im ] +// expect: [ 3 - 2im 4 - 1im ] diff --git a/test/linalg/methods/complexmatrix_conjTranspose.morpho b/test/linalg/methods/complexmatrix_conjTranspose.morpho new file mode 100644 index 000000000..d1e1b836e --- /dev/null +++ b/test/linalg/methods/complexmatrix_conjTranspose.morpho @@ -0,0 +1,21 @@ +// Conjugate of a ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +var B=A.conjTranspose() +print B +// expect: [ 1 - 4im 3 - 2im ] +// expect: [ 2 - 3im 4 - 1im ] + +for (ev in A.eigenvalues()) print isnumber(ev) +// expect: false +// expect: false + +var C=A+B // create a hermitian matrix +for (ev in C.eigenvalues()) print isnumber(ev) +// expect: true +// expect: true diff --git a/test/linalg/methods/complexmatrix_count.morpho b/test/linalg/methods/complexmatrix_count.morpho new file mode 100644 index 000000000..ce77d224d --- /dev/null +++ b/test/linalg/methods/complexmatrix_count.morpho @@ -0,0 +1,13 @@ +// Count elements in ComplexMatrix + +var A = ComplexMatrix(2,3) +A[0,0]=1+1im +A[0,1]=2+2im +A[0,2]=3+3im +A[1,0]=4+4im +A[1,1]=5+5im +A[1,2]=6+6im + +print A.count() +// expect: 6 + diff --git a/test/linalg/methods/complexmatrix_dimensions.morpho b/test/linalg/methods/complexmatrix_dimensions.morpho new file mode 100644 index 000000000..123adf139 --- /dev/null +++ b/test/linalg/methods/complexmatrix_dimensions.morpho @@ -0,0 +1,8 @@ +// Get dimensions of ComplexMatrix + +var A = ComplexMatrix(2,3) +A[0,0]=1+1im + +print A.dimensions() +// expect: (2, 3) + diff --git a/test/linalg/methods/complexmatrix_eigensystem.morpho b/test/linalg/methods/complexmatrix_eigensystem.morpho new file mode 100644 index 000000000..ffd0b63de --- /dev/null +++ b/test/linalg/methods/complexmatrix_eigensystem.morpho @@ -0,0 +1,24 @@ +// Eigenvalues and eigenvectors + +var A = ComplexMatrix(2,2) +A[0,0]=0im +A[0,1]=im +A[1,0]=im +A[1,1]=0im + +var es=A.eigensystem() +print es +// expect: ((0 + 1im, 0 - 1im), ) + +print es[0] +// expect: (0 + 1im, 0 - 1im) + +// Compare to analytical eigenvectors +var v = ComplexMatrix(2,2) +v[0,0]=sqrt(2)/2 +v[1,0]=sqrt(2)/2 +v[0,1]=sqrt(2)/2 +v[1,1]=-sqrt(2)/2 + +print abs((es[1]-v).sum()) < 1e-15 +// expect: true diff --git a/test/linalg/methods/complexmatrix_eigenvalues.morpho b/test/linalg/methods/complexmatrix_eigenvalues.morpho new file mode 100644 index 000000000..74f858dc5 --- /dev/null +++ b/test/linalg/methods/complexmatrix_eigenvalues.morpho @@ -0,0 +1,10 @@ +// Eigenvalues + +var A = ComplexMatrix(2,2) +A[0,0]=0+0im +A[0,1]=im +A[1,0]=im +A[1,1]=0+0im + +print A.eigenvalues() +// expect: (0 + 1im, 0 - 1im) diff --git a/test/linalg/methods/complexmatrix_enumerate.morpho b/test/linalg/methods/complexmatrix_enumerate.morpho new file mode 100644 index 000000000..dcce14474 --- /dev/null +++ b/test/linalg/methods/complexmatrix_enumerate.morpho @@ -0,0 +1,13 @@ +// Enumerate elements of a matrix + +var A = ComplexMatrix(2,2) +A[0,0] = 1+im +A[0,1] = 0+0im +A[1,0] = 0+0im +A[1,1] = 1-im + +for (x in A) print x +// expect: 1 + 1im +// expect: 0 + 0im +// expect: 0 + 0im +// expect: 1 - 1im diff --git a/test/linalg/methods/complexmatrix_format.morpho b/test/linalg/methods/complexmatrix_format.morpho new file mode 100644 index 000000000..32d32dd9c --- /dev/null +++ b/test/linalg/methods/complexmatrix_format.morpho @@ -0,0 +1,12 @@ +// Format +import constants + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=exp(im*Pi/4) +A[1,0]=exp(-im*Pi/4) +A[1,1]=-1.5*(1+1im) + +print A.format("%5.2f") +// expect: [ 1.00 + 1.00im 0.71 + 0.71im ] +// expect: [ 0.71 - 0.71im -1.50 - 1.50im ] diff --git a/test/linalg/methods/complexmatrix_imag.morpho b/test/linalg/methods/complexmatrix_imag.morpho new file mode 100644 index 000000000..26afc044c --- /dev/null +++ b/test/linalg/methods/complexmatrix_imag.morpho @@ -0,0 +1,11 @@ +// Inner product of ComplexMatrices (Frobenius inner product with conjugation) + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.imag() +// expect: [ 4 3 ] +// expect: [ 2 1 ] diff --git a/test/linalg/methods/complexmatrix_inner.morpho b/test/linalg/methods/complexmatrix_inner.morpho new file mode 100644 index 000000000..68150dd58 --- /dev/null +++ b/test/linalg/methods/complexmatrix_inner.morpho @@ -0,0 +1,16 @@ +// Inner product of ComplexMatrices (Frobenius inner product with conjugation) + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im + +var B = ComplexMatrix(2,2) +B[0,0]=1 +B[0,1]=1im +B[1,0]=-1im +B[1,1]=1 + +print A.inner(B) +// expect: 4 - 6im diff --git a/test/linalg/methods/complexmatrix_inverse.morpho b/test/linalg/methods/complexmatrix_inverse.morpho new file mode 100644 index 000000000..d6de0b084 --- /dev/null +++ b/test/linalg/methods/complexmatrix_inverse.morpho @@ -0,0 +1,11 @@ +// Inverse + +var A = ComplexMatrix(2,2) +A[0,0]=0+0im +A[0,1]=1+im +A[1,0]=1-im +A[1,1]=0+0im + +print A.inverse() +// expect: [ 0 + 0im 0.5 + 0.5im ] +// expect: [ 0.5 - 0.5im 0 + 0im ] diff --git a/test/linalg/methods/complexmatrix_inverse_singular.morpho b/test/linalg/methods/complexmatrix_inverse_singular.morpho new file mode 100644 index 000000000..49b34a86d --- /dev/null +++ b/test/linalg/methods/complexmatrix_inverse_singular.morpho @@ -0,0 +1,11 @@ +// Inverse of singular ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0]=1+0im +A[0,1]=2+0im +A[1,0]=2+0im +A[1,1]=4+0im + +print A.inverse() +// expect error 'LnAlgMtrxSnglr' + diff --git a/test/linalg/methods/complexmatrix_norm.morpho b/test/linalg/methods/complexmatrix_norm.morpho new file mode 100644 index 000000000..097297291 --- /dev/null +++ b/test/linalg/methods/complexmatrix_norm.morpho @@ -0,0 +1,20 @@ +// Norm of a ComplexMatrix +import constants + +var A = ComplexMatrix(2,2) +A[0,0]=1+im +A[0,1]=2+im +A[1,0]=3-3im +A[1,1]=4-4im + +print abs(A.norm(1) - (4*sqrt(2) + sqrt(5))) < 1e-15 +// expect: true + +print abs(A.norm(Inf) - 7*sqrt(2)) < 1e-15 +// expect: true + +print abs(A.norm() - sqrt(57)) < 1e-15 +// expect: true + +print A.norm(5) +// expect error 'LnAlgMtrxNrmArgs' diff --git a/test/linalg/methods/complexmatrix_outer.morpho b/test/linalg/methods/complexmatrix_outer.morpho new file mode 100644 index 000000000..4a2e6ffb9 --- /dev/null +++ b/test/linalg/methods/complexmatrix_outer.morpho @@ -0,0 +1,9 @@ +// Outer product of two vectors + +var A = ComplexMatrix((1+1im,2-2im,3+3im)) +var B = ComplexMatrix((4+4im,5-5im)) + +print A.outer(B) +// expect: [ 0 + 8im 10 + 0im ] +// expect: [ 16 + 0im 0 - 20im ] +// expect: [ 0 + 24im 30 + 0im ] diff --git a/test/linalg/methods/complexmatrix_qr.morpho b/test/linalg/methods/complexmatrix_qr.morpho new file mode 100644 index 000000000..7d509bb66 --- /dev/null +++ b/test/linalg/methods/complexmatrix_qr.morpho @@ -0,0 +1,144 @@ +// QR Decomposition for ComplexMatrix + +// Test with a square complex matrix +var A = ComplexMatrix(((1.0+1.0im, 2.0+0.0im, 3.0-1.0im), + (4.0+2.0im, 5.0+1.0im, 6.0+0.0im), + (7.0+0.0im, 8.0-1.0im, 9.0+2.0im))) + +var qr = A.qr() + +print qr +// expect: (, ) + +var Q = qr[0] +var R = qr[1] + +print Q.dimensions() +// expect: (3, 3) + +print R.dimensions() +// expect: (3, 3) + +// Verify Q is unitary: Q^H * Q should be approximately I (conjugate transpose) +var QHQ = Q.conjTranspose() * Q +var I = ComplexMatrix(3,3) +for (var i = 0; i < 3; i = i + 1) { + I[i,i] = 1.0 + 0.0im +} + +print (QHQ - I).norm() < 1e-10 +// expect: true + +// Verify R is upper triangular (check lower triangle is zero) +var R_lower_norm = 0.0 +for (var i = 0; i < 3; i = i + 1) { + for (var j = 0; j < i; j = j + 1) { + var val = R[i,j] + R_lower_norm += val.abs() + } +} +print R_lower_norm < 1e-10 +// expect: true + +// Verify Q * R has the right structure +var QR = Q * R +print QR.dimensions() +// expect: (3, 3) + +// Test with a non-square matrix (tall matrix) +var B = ComplexMatrix(4,2) +B[0,0] = 1.0 + 1.0im +B[0,1] = 2.0 + 0.0im +B[1,0] = 3.0 - 1.0im +B[1,1] = 4.0 + 2.0im +B[2,0] = 5.0 + 0.0im +B[2,1] = 6.0 - 1.0im +B[3,0] = 7.0 + 1.0im +B[3,1] = 8.0 + 0.0im + +var qr2 = B.qr() +var Q2 = qr2[0] +var R2 = qr2[1] + +print Q2.dimensions() +// expect: (4, 4) + +print R2.dimensions() +// expect: (4, 2) + +// Verify Q2 first 2 columns are orthonormal (unitary) +// For tall matrices, only the first min(m,n) columns from ZUNGQR are orthonormal +// The remaining columns are zero +var Q2_col0 = Q2.column(0) +var Q2_col1 = Q2.column(1) +// Check norms +var norm0 = Q2_col0.norm() +var norm1 = Q2_col1.norm() + +print abs(norm0-1) < 1e-7 // expect: true +print abs(norm1-1) < 1e-7 // expect: true + +// Check orthogonality: inner product should be close to zero +var inner01 = Q2_col0.inner(Q2_col1) +var inner01_mag = inner01.abs() +print inner01_mag < 1e-10 +// expect: true + +// Verify R2 is upper triangular +var R2_lower_norm = 0.0 +for (var i = 0; i < 4; i = i + 1) { + for (var j = 0; j < 2; j = j + 1) { + if (i > j) { + var val = R2[i,j] + R2_lower_norm = val.abs() + } + } +} +print R2_lower_norm < 1e-10 +// expect: true + +// Test with a wide matrix +var C = ComplexMatrix(2,4) +C[0,0] = 1.0 + 1.0im +C[0,1] = 2.0 + 0.0im +C[0,2] = 3.0 - 1.0im +C[0,3] = 4.0 + 2.0im +C[1,0] = 5.0 + 0.0im +C[1,1] = 6.0 - 1.0im +C[1,2] = 7.0 + 1.0im +C[1,3] = 8.0 + 0.0im + +var qr3 = C.qr() +var Q3 = qr3[0] +var R3 = qr3[1] + +print Q3.dimensions() +// expect: (2, 2) + +print R3.dimensions() +// expect: (2, 4) + +// Verify Q3 is unitary +var Q3HQ3 = Q3.conjTranspose() * Q3 +var I2 = ComplexMatrix(2,2) +for (var i = 0; i < 2; i = i + 1) { + I2[i,i] = 1.0 + 0.0im +} +print (Q3HQ3 - I2).norm() < 1e-10 +// expect: true + +// Test with real-valued complex matrix (should work like real matrix) +var D = ComplexMatrix(((1.0+0.0im, 0.0+0.0im), + (0.0+0.0im, 2.0+0.0im))) +var qr4 = D.qr() +var Q4 = qr4[0] +var R4 = qr4[1] + +// Verify Q4 is unitary +var Q4HQ4 = Q4.conjTranspose() * Q4 +var I2b = ComplexMatrix(2,2) +for (var i = 0; i < 2; i = i + 1) { + I2b[i,i] = 1.0 + 0.0im +} +print (Q4HQ4 - I2b).norm() < 1e-10 +// expect: true diff --git a/test/linalg/methods/complexmatrix_real.morpho b/test/linalg/methods/complexmatrix_real.morpho new file mode 100644 index 000000000..620f25033 --- /dev/null +++ b/test/linalg/methods/complexmatrix_real.morpho @@ -0,0 +1,11 @@ +// Real part of a ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.real() +// expect: [ 1 2 ] +// expect: [ 3 4 ] diff --git a/test/linalg/methods/complexmatrix_reshape.morpho b/test/linalg/methods/complexmatrix_reshape.morpho new file mode 100644 index 000000000..cf4ea7822 --- /dev/null +++ b/test/linalg/methods/complexmatrix_reshape.morpho @@ -0,0 +1,18 @@ +// Reshape ComplexMatrix + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[1,0]=2+2im +A[0,1]=3+3im +A[1,1]=4+4im +print A +// expect: [ 1 + 1im 3 + 3im ] +// expect: [ 2 + 2im 4 + 4im ] + +A.reshape(4,1) +print A +// expect: [ 1 + 1im ] +// expect: [ 2 + 2im ] +// expect: [ 3 + 3im ] +// expect: [ 4 + 4im ] + diff --git a/test/linalg/methods/complexmatrix_roll.morpho b/test/linalg/methods/complexmatrix_roll.morpho new file mode 100644 index 000000000..c8ecb6904 --- /dev/null +++ b/test/linalg/methods/complexmatrix_roll.morpho @@ -0,0 +1,50 @@ +// Roll contents of a matrix + +var A = ComplexMatrix(3,3) +var k=0 +for (i in 0...3) for (j in 0...3) { A[i,j] = Complex(k,k); k+=1 } + +print A +// expect: [ 0 + 0im 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im 5 + 5im ] +// expect: [ 6 + 6im 7 + 7im 8 + 8im ] + +print A.roll(1,1) +// expect: [ 2 + 2im 0 + 0im 1 + 1im ] +// expect: [ 5 + 5im 3 + 3im 4 + 4im ] +// expect: [ 8 + 8im 6 + 6im 7 + 7im ] + +print A.roll(2,1) +// expect: [ 1 + 1im 2 + 2im 0 + 0im ] +// expect: [ 4 + 4im 5 + 5im 3 + 3im ] +// expect: [ 7 + 7im 8 + 8im 6 + 6im ] + +print A.roll(3,1) +// expect: [ 0 + 0im 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im 5 + 5im ] +// expect: [ 6 + 6im 7 + 7im 8 + 8im ] + +print A.roll(4,1) +// expect: [ 2 + 2im 0 + 0im 1 + 1im ] +// expect: [ 5 + 5im 3 + 3im 4 + 4im ] +// expect: [ 8 + 8im 6 + 6im 7 + 7im ] + +print A.roll(-1,0) +// expect: [ 3 + 3im 4 + 4im 5 + 5im ] +// expect: [ 6 + 6im 7 + 7im 8 + 8im ] +// expect: [ 0 + 0im 1 + 1im 2 + 2im ] + +print A.roll(-2,0) +// expect: [ 6 + 6im 7 + 7im 8 + 8im ] +// expect: [ 0 + 0im 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im 5 + 5im ] + +print A.roll(-3,0) +// expect: [ 0 + 0im 1 + 1im 2 + 2im ] +// expect: [ 3 + 3im 4 + 4im 5 + 5im ] +// expect: [ 6 + 6im 7 + 7im 8 + 8im ] + +print A.roll(-4,0) +// expect: [ 3 + 3im 4 + 4im 5 + 5im ] +// expect: [ 6 + 6im 7 + 7im 8 + 8im ] +// expect: [ 0 + 0im 1 + 1im 2 + 2im ] diff --git a/test/linalg/methods/complexmatrix_roll_negative.morpho b/test/linalg/methods/complexmatrix_roll_negative.morpho new file mode 100644 index 000000000..ef2e2a81b --- /dev/null +++ b/test/linalg/methods/complexmatrix_roll_negative.morpho @@ -0,0 +1,12 @@ +// Negative roll values for ComplexMatrix + +var A = ComplexMatrix(3,1) +A[0,0]=1+1im +A[1,0]=2+2im +A[2,0]=3+3im + +print A.roll(-1) +// expect: [ 2 + 2im ] +// expect: [ 3 + 3im ] +// expect: [ 1 + 1im ] + diff --git a/test/linalg/methods/complexmatrix_sum.morpho b/test/linalg/methods/complexmatrix_sum.morpho new file mode 100644 index 000000000..64369ace2 --- /dev/null +++ b/test/linalg/methods/complexmatrix_sum.morpho @@ -0,0 +1,12 @@ +// Sum + +var A = ComplexMatrix(3,2) +A[0,0]=1+im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im +A[2,0]=5+5im +A[2,1]=6+6im + +print A.sum() +// expect: 21 + 21im diff --git a/test/linalg/methods/complexmatrix_svd.morpho b/test/linalg/methods/complexmatrix_svd.morpho new file mode 100644 index 000000000..388681fa1 --- /dev/null +++ b/test/linalg/methods/complexmatrix_svd.morpho @@ -0,0 +1,21 @@ +// Singular Value Decomposition + +var A = ComplexMatrix(((1+1im,0+0im),(0+0im,2+2im))) + +var svd = A.svd() + +// Test reconstruction: U * S * V^T should approximately equal A +var U = svd[0] +var S = svd[1] +var V = svd[2] + +// Create diagonal matrix from singular values +var Sdiag = ComplexMatrix(2,2) +Sdiag[0,0] = S[0] +Sdiag[1,1] = S[1] + +var VT = V.transpose() +var reconstructed = U * Sdiag * VT + +print (reconstructed - A).norm() < 1e-10 +// expect: true diff --git a/test/linalg/methods/complexmatrix_trace.morpho b/test/linalg/methods/complexmatrix_trace.morpho new file mode 100644 index 000000000..4a01913f6 --- /dev/null +++ b/test/linalg/methods/complexmatrix_trace.morpho @@ -0,0 +1,10 @@ +// Inverse + +var A = ComplexMatrix(2,2) +A[0,0]=1+4im +A[0,1]=2+3im +A[1,0]=3+2im +A[1,1]=4+1im + +print A.trace() +// expect: 5 + 5im diff --git a/test/linalg/methods/complexmatrix_transpose.morpho b/test/linalg/methods/complexmatrix_transpose.morpho new file mode 100644 index 000000000..920495853 --- /dev/null +++ b/test/linalg/methods/complexmatrix_transpose.morpho @@ -0,0 +1,13 @@ +// Inverse + +var A = ComplexMatrix(3,2) +A[0,0]=1+1im +A[0,1]=2+2im +A[1,0]=3+3im +A[1,1]=4+4im +A[2,0]=5+5im +A[2,1]=6+6im + +print A.transpose() +// expect: [ 1 + 1im 3 + 3im 5 + 5im ] +// expect: [ 2 + 2im 4 + 4im 6 + 6im ] diff --git a/test/linalg/methods/matrix_count.morpho b/test/linalg/methods/matrix_count.morpho new file mode 100644 index 000000000..46d5a971a --- /dev/null +++ b/test/linalg/methods/matrix_count.morpho @@ -0,0 +1,13 @@ +// Count elements in Matrix + +var A = Matrix(2,3) +A[0,0]=1 +A[0,1]=2 +A[0,2]=3 +A[1,0]=4 +A[1,1]=5 +A[1,2]=6 + +print A.count() +// expect: 6 + diff --git a/test/linalg/methods/matrix_dimensions.morpho b/test/linalg/methods/matrix_dimensions.morpho new file mode 100644 index 000000000..9fa7f8b53 --- /dev/null +++ b/test/linalg/methods/matrix_dimensions.morpho @@ -0,0 +1,9 @@ +// Get dimensions of Matrix + +var A = Matrix(2,3) +print A.dimensions() +// expect: (2, 3) + +var a = Matrix([[0.8, -0.4], [0.4, 0.8]]) +print a.dimensions() +// expect: (2, 2) diff --git a/test/linalg/methods/matrix_eigensystem.morpho b/test/linalg/methods/matrix_eigensystem.morpho new file mode 100644 index 000000000..957f676db --- /dev/null +++ b/test/linalg/methods/matrix_eigensystem.morpho @@ -0,0 +1,19 @@ +// Eigenvalues and eigenvectors + +var A = Matrix(2,2) +A[0,0]=0 +A[0,1]=1 +A[1,0]=1 +A[1,1]=0 + +var es=A.eigensystem() + +print es +// expect: ((1, -1), ) + +print es[0] +// expect: (1, -1) + +print es[1].format("%.2g") +// expect: [ 0.71 -0.71 ] +// expect: [ 0.71 0.71 ] diff --git a/test/linalg/methods/matrix_eigenvalues.morpho b/test/linalg/methods/matrix_eigenvalues.morpho new file mode 100644 index 000000000..e45399ebd --- /dev/null +++ b/test/linalg/methods/matrix_eigenvalues.morpho @@ -0,0 +1,10 @@ +// Eigenvalues + +var A = Matrix(2,2) +A[0,0]=0 +A[0,1]=1 +A[1,0]=1 +A[1,1]=0 + +print A.eigenvalues() +// expect: (1, -1) diff --git a/test/linalg/methods/matrix_enumerate.morpho b/test/linalg/methods/matrix_enumerate.morpho new file mode 100644 index 000000000..37d1cafa1 --- /dev/null +++ b/test/linalg/methods/matrix_enumerate.morpho @@ -0,0 +1,13 @@ +// Enumerate elements of a matrix + +var A = Matrix(2,2) +A[0,0] = 1 +A[1,0] = 2 +A[0,1] = 3 +A[1,1] = 4 + +for (x in A) print x +// expect: 1 +// expect: 2 +// expect: 3 +// expect: 4 diff --git a/test/linalg/methods/matrix_format.morpho b/test/linalg/methods/matrix_format.morpho new file mode 100644 index 000000000..999c831ed --- /dev/null +++ b/test/linalg/methods/matrix_format.morpho @@ -0,0 +1,12 @@ +// Format +import constants + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=Pi/2 +A[1,0]=Pi/2 +A[1,1]=-1.5 + +print A.format("%5.2f") +// expect: [ 1.00 1.57 ] +// expect: [ 1.57 -1.50 ] diff --git a/test/linalg/methods/matrix_inner.morpho b/test/linalg/methods/matrix_inner.morpho new file mode 100644 index 000000000..4c789d22f --- /dev/null +++ b/test/linalg/methods/matrix_inner.morpho @@ -0,0 +1,17 @@ +// Inner product of Matrices + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +var B = Matrix(2,2) +B[0,0]=1 +B[0,1]=0 +B[1,0]=0 +B[1,1]=1 + +print A.inner(B) +// expect: 5 + diff --git a/test/linalg/methods/matrix_inverse.morpho b/test/linalg/methods/matrix_inverse.morpho new file mode 100644 index 000000000..85b4e02a4 --- /dev/null +++ b/test/linalg/methods/matrix_inverse.morpho @@ -0,0 +1,11 @@ +// Inverse + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +print A.inverse() +// expect: [ -2 1 ] +// expect: [ 1.5 -0.5 ] diff --git a/test/linalg/methods/matrix_inverse_singular.morpho b/test/linalg/methods/matrix_inverse_singular.morpho new file mode 100644 index 000000000..d3dea86ac --- /dev/null +++ b/test/linalg/methods/matrix_inverse_singular.morpho @@ -0,0 +1,10 @@ +// Inverse + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=2 +A[1,1]=4 + +print A.inverse() +// expect error 'LnAlgMtrxSnglr' diff --git a/test/linalg/methods/matrix_norm.morpho b/test/linalg/methods/matrix_norm.morpho new file mode 100644 index 000000000..b1a4cd67e --- /dev/null +++ b/test/linalg/methods/matrix_norm.morpho @@ -0,0 +1,20 @@ +// Norm of an Matrix +import constants + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=-2 +A[1,0]=3 +A[1,1]=-4 + +print A.norm(1) +// expect: 6 + +print A.norm(Inf) +// expect: 7 + +print abs(A.norm() - sqrt(30)) < 1e-15 +// expect: true + +print A.norm(5) +// expect error 'LnAlgMtrxNrmArgs' diff --git a/test/linalg/methods/matrix_outer.morpho b/test/linalg/methods/matrix_outer.morpho new file mode 100644 index 000000000..bb08c58c4 --- /dev/null +++ b/test/linalg/methods/matrix_outer.morpho @@ -0,0 +1,9 @@ +// Outer product of two vectors + +var A = Matrix((1,2,3)) +var B = Matrix((4,5)) + +print A.outer(B) +// expect: [ 4 5 ] +// expect: [ 8 10 ] +// expect: [ 12 15 ] diff --git a/test/linalg/methods/matrix_qr.morpho b/test/linalg/methods/matrix_qr.morpho new file mode 100644 index 000000000..9dfc2b262 --- /dev/null +++ b/test/linalg/methods/matrix_qr.morpho @@ -0,0 +1,134 @@ +// QR Decomposition + +// Test with a square matrix (this one is singular, so R will have a zero on the diagonal) +var A = Matrix(((1.0,2.0,3.0),(4.0,5.0,6.0),(7.0,8.0,9.0))) + +var qr = A.qr() + +print qr +// expect: (, ) + +var Q = qr[0] +var R = qr[1] + +print Q.dimensions() +// expect: (3, 3) + +print R.dimensions() +// expect: (3, 3) + +// Verify Q is orthogonal: Q^T * Q should be approximately I +var QTQ = Q.transpose() * Q +var I = IdentityMatrix(3) + +print (QTQ - I).norm() < 1e-10 +// expect: true + +// Verify R is upper triangular (check lower triangle is zero) +var R_lower_norm = 0.0 +for (var i = 0; i < 3; i = i + 1) { + for (var j = 0; j < i; j = j + 1) { + R_lower_norm = R_lower_norm + R[i,j]*R[i,j] + } +} +print R_lower_norm < 1e-10 +// expect: true + +// Check R's diagonal - since A is singular, one diagonal element should be (close to) zero +// This indicates the matrix has rank 2 (not full rank) +print abs(R[2,2]) < 1e-8 +// expect: true + +// Verify Q * R reconstruction +var QR = Q * R +print (QR - A).norm() < 1e-10 +// expect: true + +// Test with a non-square matrix (tall matrix) +var B = Matrix(4,2) +B[0,0] = 1.0 +B[0,1] = 2.0 +B[1,0] = 3.0 +B[1,1] = 4.0 +B[2,0] = 5.0 +B[2,1] = 6.0 +B[3,0] = 7.0 +B[3,1] = 8.0 + +var qr2 = B.qr() +var Q2 = qr2[0] +var R2 = qr2[1] + +print Q2.dimensions() +// expect: (4, 4) + +print R2.dimensions() +// expect: (4, 2) + +// Verify Q2 first 2 columns are orthonormal +// For tall matrices, only the first min(m,n) columns from DORGQR are orthonormal +// The remaining columns are zero +var Q2_col0 = Q2.column(0) +var Q2_col1 = Q2.column(1) +// Check norms +print Q2_col0.norm() < 1.0 + 1e-10 and Q2_col0.norm() > 1.0 - 1e-10 +// expect: true +print Q2_col1.norm() < 1.0 + 1e-10 and Q2_col1.norm() > 1.0 - 1e-10 +// expect: true +// Check orthogonality: dot product should be close to zero +var dot01 = Q2_col0.inner(Q2_col1) +print dot01 < 1e-10 and dot01 > -1e-10 +// expect: true + +// Verify R2 is upper triangular +var R2_lower_norm = 0.0 +for (var i = 0; i < 4; i = i + 1) { + for (var j = 0; j < 2; j = j + 1) { + if (i > j) { + R2_lower_norm = R2_lower_norm + R2[i,j]*R2[i,j] + } + } +} +print R2_lower_norm < 1e-10 +// expect: true + +// Test with a wide matrix +var C = Matrix(2,4) +C[0,0] = 1.0 +C[0,1] = 2.0 +C[0,2] = 3.0 +C[0,3] = 4.0 +C[1,0] = 5.0 +C[1,1] = 6.0 +C[1,2] = 7.0 +C[1,3] = 8.0 + +var qr3 = C.qr() +var Q3 = qr3[0] +var R3 = qr3[1] + +print Q3.dimensions() +// expect: (2, 2) + +print R3.dimensions() +// expect: (2, 4) + +// Verify Q3 is orthogonal +var Q3TQ3 = Q3.transpose() * Q3 +var I2 = IdentityMatrix(2) +print (Q3TQ3 - I2).norm() < 1e-10 +// expect: true + +// Test with identity matrix +var I3 = IdentityMatrix(3) +var qr4 = I3.qr() +var Q4 = qr4[0] +var R4 = qr4[1] + +// Q should be close to identity +print (Q4 - I3).norm() < 1e-10 +// expect: true + +// R should be close to identity +print (R4 - I3).norm() < 1e-10 +// expect: true diff --git a/test/linalg/methods/matrix_reshape.morpho b/test/linalg/methods/matrix_reshape.morpho new file mode 100644 index 000000000..d49bbe5bf --- /dev/null +++ b/test/linalg/methods/matrix_reshape.morpho @@ -0,0 +1,18 @@ +// Reshape Matrix + +var A = Matrix(2,2) +A[0,0]=1 +A[1,0]=2 +A[0,1]=3 +A[1,1]=4 +print A +// expect: [ 1 3 ] +// expect: [ 2 4 ] + +A.reshape(4,1) +print A +// expect: [ 1 ] +// expect: [ 2 ] +// expect: [ 3 ] +// expect: [ 4 ] + diff --git a/test/linalg/methods/matrix_roll.morpho b/test/linalg/methods/matrix_roll.morpho new file mode 100644 index 000000000..b0a74648f --- /dev/null +++ b/test/linalg/methods/matrix_roll.morpho @@ -0,0 +1,50 @@ +// Roll contents of a matrix + +var A = Matrix(3,3) +var k=0 +for (i in 0...3) for (j in 0...3) { A[i,j] = k; k+=1 } + +print A +// expect: [ 0 1 2 ] +// expect: [ 3 4 5 ] +// expect: [ 6 7 8 ] + +print A.roll(1,1) +// expect: [ 2 0 1 ] +// expect: [ 5 3 4 ] +// expect: [ 8 6 7 ] + +print A.roll(2,1) +// expect: [ 1 2 0 ] +// expect: [ 4 5 3 ] +// expect: [ 7 8 6 ] + +print A.roll(3,1) +// expect: [ 0 1 2 ] +// expect: [ 3 4 5 ] +// expect: [ 6 7 8 ] + +print A.roll(4,1) +// expect: [ 2 0 1 ] +// expect: [ 5 3 4 ] +// expect: [ 8 6 7 ] + +print A.roll(-1,0) +// expect: [ 3 4 5 ] +// expect: [ 6 7 8 ] +// expect: [ 0 1 2 ] + +print A.roll(-2,0) +// expect: [ 6 7 8 ] +// expect: [ 0 1 2 ] +// expect: [ 3 4 5 ] + +print A.roll(-3,0) +// expect: [ 0 1 2 ] +// expect: [ 3 4 5 ] +// expect: [ 6 7 8 ] + +print A.roll(-4,0) +// expect: [ 3 4 5 ] +// expect: [ 6 7 8 ] +// expect: [ 0 1 2 ] diff --git a/test/linalg/methods/matrix_sum.morpho b/test/linalg/methods/matrix_sum.morpho new file mode 100644 index 000000000..0ccdee3b3 --- /dev/null +++ b/test/linalg/methods/matrix_sum.morpho @@ -0,0 +1,12 @@ +// Sum + +var A = Matrix(3,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 +A[2,0]=5 +A[2,1]=6 + +print A.sum() +// expect: 21 diff --git a/test/linalg/methods/matrix_svd.morpho b/test/linalg/methods/matrix_svd.morpho new file mode 100644 index 000000000..23cdac478 --- /dev/null +++ b/test/linalg/methods/matrix_svd.morpho @@ -0,0 +1,53 @@ +// Singular Value Decomposition + +var A = Matrix(((1,0),(0,2))) + +var svd = A.svd() + +print svd +// expect: (, (2, 1), ) + +print (svd[0] - Matrix(((0,1),(1,0)))).norm() < 1e-10 +// expect: true + +print svd[1] +// expect: (2, 1) + +print (svd[2] - Matrix(((0,1),(1,0)))).norm() < 1e-10 +// expect: true + +// Test reconstruction: U * S * V^T should approximately equal A +var U = svd[0] +var S = svd[1] +var V = svd[2] + +// Create diagonal matrix from singular values +var Sdiag = Matrix(2,2) +Sdiag[0,0] = S[0] +Sdiag[1,1] = S[1] + +var VT = V.transpose() +var reconstructed = U * Sdiag * VT + +print (reconstructed - A).norm() < 1e-10 +// expect: true + +// Test with a non-square matrix +var B = Matrix(3,2) +B[0,0]=1 +B[0,1]=0 +B[1,0]=0 +B[1,1]=2 +B[2,0]=0 +B[2,1]=0 + +var svd2 = B.svd() + +print svd2[0].dimensions() +// expect: (3, 3) + +print svd2[1] +// expect: (2, 1) + +print svd2[2].dimensions() +// expect: (2, 2) diff --git a/test/linalg/methods/matrix_trace.morpho b/test/linalg/methods/matrix_trace.morpho new file mode 100644 index 000000000..2fe81a5f7 --- /dev/null +++ b/test/linalg/methods/matrix_trace.morpho @@ -0,0 +1,10 @@ +// Inverse + +var A = Matrix(2,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 + +print A.trace() +// expect: 5 diff --git a/test/linalg/methods/matrix_transpose.morpho b/test/linalg/methods/matrix_transpose.morpho new file mode 100644 index 000000000..4043881e8 --- /dev/null +++ b/test/linalg/methods/matrix_transpose.morpho @@ -0,0 +1,13 @@ +// Inverse + +var A = Matrix(3,2) +A[0,0]=1 +A[0,1]=2 +A[1,0]=3 +A[1,1]=4 +A[2,0]=5 +A[2,1]=6 + +print A.transpose() +// expect: [ 1 3 5 ] +// expect: [ 2 4 6 ] From 905f10bccf0989f2527e545c2e5ee3641dfa8eb0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 21 Jan 2026 06:13:56 -0500 Subject: [PATCH 253/473] Remove newlinalg folder and contents, completing integration --- newlinalg/.gitattributes | 2 - newlinalg/.gitignore | 5 - newlinalg/CMakeLists.txt | 101 -- newlinalg/src/CMakeLists.txt | 6 - newlinalg/src/complexmatrix.c | 649 ------- newlinalg/src/complexmatrix.h | 20 - newlinalg/src/matrix.c | 1488 ----------------- newlinalg/src/matrix.h | 236 --- newlinalg/src/newlinalg.c | 52 - newlinalg/src/newlinalg.h | 93 -- .../test/arithmetic/complexmatrix_acc.morpho | 14 - .../complexmatrix_add_complexmatrix.morpho | 8 - .../complexmatrix_add_matrix.morpho | 9 - .../arithmetic/complexmatrix_add_nil.morpho | 8 - .../complexmatrix_add_scalar.morpho | 10 - .../complexmatrix_addr_matrix.morpho | 9 - .../arithmetic/complexmatrix_addr_nil.morpho | 8 - .../complexmatrix_div_complexmatrix.morpho | 20 - .../complexmatrix_div_matrix.morpho | 14 - .../complexmatrix_div_scalar.morpho | 11 - .../complexmatrix_divr_matrix.morpho | 10 - .../complexmatrix_mul_complex.morpho | 8 - .../complexmatrix_mul_complexmatrix.morpho | 19 - .../complexmatrix_mul_matrix.morpho | 9 - .../complexmatrix_mul_scalar.morpho | 11 - .../complexmatrix_mulr_complex.xmorpho | 8 - .../complexmatrix_mulr_matrix.morpho | 15 - .../complexmatrix_sub_complexmatrix.morpho | 9 - .../complexmatrix_sub_matrix.morpho | 9 - .../complexmatrix_sub_scalar.morpho | 10 - .../complexmatrix_subr_matrix.morpho | 9 - .../complexmatrix_subr_scalar.morpho | 10 - newlinalg/test/arithmetic/matrix_acc.morpho | 14 - .../test/arithmetic/matrix_add_matrix.morpho | 12 - .../test/arithmetic/matrix_add_nil.morpho | 8 - .../test/arithmetic/matrix_add_scalar.morpho | 8 - .../test/arithmetic/matrix_addr_nil.morpho | 9 - .../test/arithmetic/matrix_addr_scalar.morpho | 8 - .../test/arithmetic/matrix_div_matrix.morpho | 17 - .../test/arithmetic/matrix_div_scalar.morpho | 11 - .../test/arithmetic/matrix_mul_matrix.morpho | 36 - .../test/arithmetic/matrix_mul_scalar.morpho | 11 - .../test/arithmetic/matrix_negate.morpho | 9 - .../test/arithmetic/matrix_sub_matrix.morpho | 14 - .../test/arithmetic/matrix_sub_scalar.morpho | 8 - .../test/arithmetic/matrix_subr_scalar.morpho | 10 - .../test/assign/complexmatrix_assign.morpho | 17 - .../test/assign/complexmatrix_clone.morpho | 19 - newlinalg/test/assign/matrix_assign.morpho | 20 - .../complexmatrix_array_constructor.morpho | 15 - ...rray_constructor_invalid_dimensions.morpho | 12 - .../complexmatrix_constructor.morpho | 10 - ...omplexmatrix_constructor_edge_cases.morpho | 48 - ...plexmatrix_constructor_invalid_args.morpho | 6 - .../complexmatrix_list_constructor.morpho | 9 - ...mplexmatrix_list_vector_constructor.morpho | 18 - .../complexmatrix_matrix_constructor.morpho | 11 - ...plexmatrix_tuple_column_constructor.morpho | 9 - .../complexmatrix_tuple_constructor.morpho | 9 - .../complexmatrix_vector_constructor.morpho | 9 - .../matrix_array_constructor.morpho | 16 - ...rray_constructor_invalid_dimensions.morpho | 12 - .../constructors/matrix_constructor.morpho | 10 - .../matrix_constructor_edge_cases.morpho | 48 - .../matrix_identity_constructor.morpho | 13 - .../matrix_list_constructor.morpho | 9 - .../matrix_list_vector_constructor.morpho | 9 - .../matrix_tuple_constructor.morpho | 16 - .../matrix_vector_constructor.morpho | 9 - .../constructors/vector_constructor.morpho | 10 - ...mplexmatrix_incompatible_dimensions.morpho | 13 - .../complexmatrix_index_out_of_bounds.morpho | 10 - .../complexmatrix_non_square_error.morpho | 10 - .../test/index/complexmatrix_getcolumn.morpho | 19 - .../test/index/complexmatrix_getindex.morpho | 21 - .../test/index/complexmatrix_setcolumn.morpho | 22 - .../test/index/complexmatrix_setindex.morpho | 21 - .../index/complexmatrix_setindex_real.morpho | 16 - .../test/index/complexmatrix_setslice.morpho | 50 - .../test/index/complexmatrix_slice.morpho | 25 - newlinalg/test/index/matrix_getcolumn.morpho | 19 - newlinalg/test/index/matrix_getindex.morpho | 21 - newlinalg/test/index/matrix_setcolumn.morpho | 22 - newlinalg/test/index/matrix_setindex.morpho | 13 - newlinalg/test/index/matrix_setslice.morpho | 49 - newlinalg/test/index/matrix_slice.morpho | 25 - .../test/index/matrix_slice_bounds.morpho | 7 - .../index/matrix_slice_infinite_range.morpho | 7 - .../test/methods/complexmatrix_conj.morpho | 12 - .../complexmatrix_conjTranspose.morpho | 22 - .../test/methods/complexmatrix_count.morpho | 14 - .../methods/complexmatrix_dimensions.morpho | 9 - .../methods/complexmatrix_eigensystem.morpho | 25 - .../methods/complexmatrix_eigenvalues.morpho | 11 - .../methods/complexmatrix_enumerate.morpho | 15 - .../test/methods/complexmatrix_format.morpho | 13 - .../test/methods/complexmatrix_imag.morpho | 12 - .../test/methods/complexmatrix_inner.morpho | 17 - .../test/methods/complexmatrix_inverse.morpho | 12 - .../complexmatrix_inverse_singular.morpho | 12 - .../test/methods/complexmatrix_norm.morpho | 21 - .../test/methods/complexmatrix_outer.morpho | 10 - .../test/methods/complexmatrix_qr.morpho | 145 -- .../test/methods/complexmatrix_real.morpho | 12 - .../test/methods/complexmatrix_reshape.morpho | 19 - .../test/methods/complexmatrix_roll.morpho | 51 - .../complexmatrix_roll_negative.morpho | 14 - .../test/methods/complexmatrix_sum.morpho | 13 - .../test/methods/complexmatrix_svd.morpho | 22 - .../test/methods/complexmatrix_trace.morpho | 11 - .../methods/complexmatrix_transpose.morpho | 14 - newlinalg/test/methods/matrix_count.morpho | 14 - .../test/methods/matrix_dimensions.morpho | 10 - .../test/methods/matrix_eigensystem.morpho | 20 - .../test/methods/matrix_eigenvalues.morpho | 11 - .../test/methods/matrix_enumerate.morpho | 15 - newlinalg/test/methods/matrix_format.morpho | 13 - newlinalg/test/methods/matrix_inner.morpho | 18 - newlinalg/test/methods/matrix_inverse.morpho | 12 - .../methods/matrix_inverse_singular.morpho | 11 - newlinalg/test/methods/matrix_norm.morpho | 21 - newlinalg/test/methods/matrix_outer.morpho | 10 - newlinalg/test/methods/matrix_qr.morpho | 135 -- newlinalg/test/methods/matrix_reshape.morpho | 19 - newlinalg/test/methods/matrix_roll.morpho | 51 - newlinalg/test/methods/matrix_sum.morpho | 13 - newlinalg/test/methods/matrix_svd.morpho | 54 - newlinalg/test/methods/matrix_trace.morpho | 11 - .../test/methods/matrix_transpose.morpho | 14 - newlinalg/test/test.py | 212 --- 130 files changed, 4969 deletions(-) delete mode 100644 newlinalg/.gitattributes delete mode 100644 newlinalg/.gitignore delete mode 100644 newlinalg/CMakeLists.txt delete mode 100644 newlinalg/src/CMakeLists.txt delete mode 100644 newlinalg/src/complexmatrix.c delete mode 100644 newlinalg/src/complexmatrix.h delete mode 100644 newlinalg/src/matrix.c delete mode 100644 newlinalg/src/matrix.h delete mode 100644 newlinalg/src/newlinalg.c delete mode 100644 newlinalg/src/newlinalg.h delete mode 100644 newlinalg/test/arithmetic/complexmatrix_acc.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_add_complexmatrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_add_nil.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_add_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_addr_nil.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_div_complexmatrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_div_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_mul_complex.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_mul_complexmatrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_mul_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_mulr_complex.xmorpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_sub_complexmatrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_sub_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/complexmatrix_subr_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_acc.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_add_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_add_nil.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_add_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_addr_nil.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_addr_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_div_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_div_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_mul_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_mul_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_negate.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_sub_matrix.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_sub_scalar.morpho delete mode 100644 newlinalg/test/arithmetic/matrix_subr_scalar.morpho delete mode 100644 newlinalg/test/assign/complexmatrix_assign.morpho delete mode 100644 newlinalg/test/assign/complexmatrix_clone.morpho delete mode 100644 newlinalg/test/assign/matrix_assign.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_array_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_constructor_edge_cases.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_constructor_invalid_args.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_list_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_list_vector_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_tuple_column_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_tuple_constructor.morpho delete mode 100644 newlinalg/test/constructors/complexmatrix_vector_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_array_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho delete mode 100644 newlinalg/test/constructors/matrix_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_constructor_edge_cases.morpho delete mode 100644 newlinalg/test/constructors/matrix_identity_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_list_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_list_vector_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_tuple_constructor.morpho delete mode 100644 newlinalg/test/constructors/matrix_vector_constructor.morpho delete mode 100644 newlinalg/test/constructors/vector_constructor.morpho delete mode 100644 newlinalg/test/errors/complexmatrix_incompatible_dimensions.morpho delete mode 100644 newlinalg/test/errors/complexmatrix_index_out_of_bounds.morpho delete mode 100644 newlinalg/test/errors/complexmatrix_non_square_error.morpho delete mode 100644 newlinalg/test/index/complexmatrix_getcolumn.morpho delete mode 100644 newlinalg/test/index/complexmatrix_getindex.morpho delete mode 100644 newlinalg/test/index/complexmatrix_setcolumn.morpho delete mode 100644 newlinalg/test/index/complexmatrix_setindex.morpho delete mode 100644 newlinalg/test/index/complexmatrix_setindex_real.morpho delete mode 100644 newlinalg/test/index/complexmatrix_setslice.morpho delete mode 100644 newlinalg/test/index/complexmatrix_slice.morpho delete mode 100644 newlinalg/test/index/matrix_getcolumn.morpho delete mode 100644 newlinalg/test/index/matrix_getindex.morpho delete mode 100644 newlinalg/test/index/matrix_setcolumn.morpho delete mode 100644 newlinalg/test/index/matrix_setindex.morpho delete mode 100644 newlinalg/test/index/matrix_setslice.morpho delete mode 100644 newlinalg/test/index/matrix_slice.morpho delete mode 100644 newlinalg/test/index/matrix_slice_bounds.morpho delete mode 100644 newlinalg/test/index/matrix_slice_infinite_range.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_conj.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_conjTranspose.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_count.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_dimensions.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_eigensystem.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_eigenvalues.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_enumerate.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_format.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_imag.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_inner.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_inverse.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_inverse_singular.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_norm.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_outer.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_qr.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_real.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_reshape.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_roll.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_roll_negative.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_sum.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_svd.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_trace.morpho delete mode 100644 newlinalg/test/methods/complexmatrix_transpose.morpho delete mode 100644 newlinalg/test/methods/matrix_count.morpho delete mode 100644 newlinalg/test/methods/matrix_dimensions.morpho delete mode 100644 newlinalg/test/methods/matrix_eigensystem.morpho delete mode 100644 newlinalg/test/methods/matrix_eigenvalues.morpho delete mode 100644 newlinalg/test/methods/matrix_enumerate.morpho delete mode 100644 newlinalg/test/methods/matrix_format.morpho delete mode 100644 newlinalg/test/methods/matrix_inner.morpho delete mode 100644 newlinalg/test/methods/matrix_inverse.morpho delete mode 100644 newlinalg/test/methods/matrix_inverse_singular.morpho delete mode 100644 newlinalg/test/methods/matrix_norm.morpho delete mode 100644 newlinalg/test/methods/matrix_outer.morpho delete mode 100644 newlinalg/test/methods/matrix_qr.morpho delete mode 100644 newlinalg/test/methods/matrix_reshape.morpho delete mode 100644 newlinalg/test/methods/matrix_roll.morpho delete mode 100644 newlinalg/test/methods/matrix_sum.morpho delete mode 100644 newlinalg/test/methods/matrix_svd.morpho delete mode 100644 newlinalg/test/methods/matrix_trace.morpho delete mode 100644 newlinalg/test/methods/matrix_transpose.morpho delete mode 100755 newlinalg/test/test.py diff --git a/newlinalg/.gitattributes b/newlinalg/.gitattributes deleted file mode 100644 index dfe077042..000000000 --- a/newlinalg/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/newlinalg/.gitignore b/newlinalg/.gitignore deleted file mode 100644 index a11109e10..000000000 --- a/newlinalg/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -*.so -*.DS_Store -build/* -build-xcode/* -test/FailedTests.txt diff --git a/newlinalg/CMakeLists.txt b/newlinalg/CMakeLists.txt deleted file mode 100644 index 65d6d5c57..000000000 --- a/newlinalg/CMakeLists.txt +++ /dev/null @@ -1,101 +0,0 @@ -cmake_minimum_required(VERSION 3.13) - -project(morpho-newlinalg) - -# Build the library as a plugin -add_library(newlinalg MODULE "") - -# Suppress 'lib' prefix -set_target_properties(newlinalg PROPERTIES PREFIX "") - -# Add sources -add_subdirectory(src) - -#------------------------------------------------------------------------------- -# Morpho library -#------------------------------------------------------------------------------- - -# Locate the morpho.h header file and store in MORPHO_HEADER -find_file(MORPHO_HEADER - morpho.h - HINTS - /usr/local/opt/morpho - /opt/homebrew/opt/morpho - /usr/local/include/morpho - "C:\\Program Files\\Morpho\\include\\" - ) - -# Identify folder that morpho.h is located in from MORPHO_HEADER and store in MORPHO_INCLUDE -get_filename_component(MORPHO_INCLUDE ${MORPHO_HEADER} DIRECTORY) - -# Add morpho headers to MORPHO_INCLUDE -target_include_directories(newlinalg PUBLIC ${MORPHO_INCLUDE}) - -# Add general header search paths -target_include_directories(newlinalg PUBLIC /usr/local/include /opt/homebrew/include) - -# Add morpho headers in subfolders to MORPHO_INCLUDE -file(GLOB morpho_subdirectories LIST_DIRECTORIES true ${MORPHO_INCLUDE}/*) -foreach(dir ${morpho_subdirectories}) - IF(IS_DIRECTORY ${dir}) - target_include_directories(zeromq PUBLIC ${dir}) - ELSE() - CONTINUE() - ENDIF() -endforeach() - -# Locate libmorpho -find_library(MORPHO_LIBRARY - NAMES morpho libmorpho -) - -target_link_libraries(newlinalg ${MORPHO_LIBRARY}) - -#------------------------------------------------------------------------------- -# BLAS and LAPACK -#------------------------------------------------------------------------------- - -message(STATUS "Searching for BLAS and LAPACK") -# Locate a lapack version -# Currently we prefer LAPACKE -# TODO: Fix morpho source to select between lapack and lapacke -find_library(LAPACK_LIBRARY - NAMES lapacke liblapacke lapack liblapack libopenblas - HINTS - "C:\\Program Files\\Morpho\\lib\\" -) -if (LAPACK_LIBRARY) -message(STATUS "Found LAPACK at ${LAPACK_LIBRARY}") -endif() - -# Locate cblas -find_library(CBLAS_LIBRARY - NAMES cblas libcblas blas libblas openblas libopenblas - HINTS - "C:\\Program Files\\Morpho\\lib\\" -) -if (CBLAS_LIBRARY) -message(STATUS "Found blas at ${CBLAS_LIBRARY}") -endif() - -# Find cblas.h header file -find_path(CBLAS_INCLUDE cblas.h - HINTS - "C:\\Program Files\\Morpho\\include\\lapack") - -# Add cblas headers to include folders -target_include_directories(newlinalg PUBLIC ${CBLAS_INCLUDE}) - -message(STATUS "Found cblas headers at ${CBLAS_INCLUDE}") - -target_link_libraries(newlinalg ${CBLAS_LIBRARY}) -target_link_libraries(newlinalg ${LAPACK_LIBRARY}) - -#------------------------------------------------------------------------------- -# Install -#------------------------------------------------------------------------------- - -set(CMAKE_INSTALL_PREFIX ..) - -# Install the resulting binary -install(TARGETS newlinalg LIBRARY DESTINATION lib/) diff --git a/newlinalg/src/CMakeLists.txt b/newlinalg/src/CMakeLists.txt deleted file mode 100644 index e69c0c5c1..000000000 --- a/newlinalg/src/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -target_sources(newlinalg - PRIVATE - newlinalg.c newlinalg.h - matrix.c matrix.h - complexmatrix.c complexmatrix.h -) \ No newline at end of file diff --git a/newlinalg/src/complexmatrix.c b/newlinalg/src/complexmatrix.c deleted file mode 100644 index 89f2d8b48..000000000 --- a/newlinalg/src/complexmatrix.c +++ /dev/null @@ -1,649 +0,0 @@ -/** @file complexmatrix.c - * @author T J Atherton - * - * @brief New linear algebra library -*/ - -#define ACCELERATE_NEW_LAPACK -#define MORPHO_INCLUDE_LINALG - -#include - -#include "newlinalg.h" -#include "matrix.h" -#include "complexmatrix.h" -#include "format.h" -#include "cmplx.h" - -objecttype objectcomplexmatrixtype; -#define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype - -typedef objectmatrix objectcomplexmatrix; - -/* ********************************************************************** - * ComplexMatrix utility functions - * ********************************************************************** */ - -/* ---------------------- - * Callbacks - * ---------------------- */ - -static void _printelfn(vm *v, double *el) { - objectcomplex cmplx = MORPHO_STATICCOMPLEX(el[0], el[1]); - complex_print(v, &cmplx); -} - -static bool _printeltobufffn(varray_char *out, char *format, double *el) { - if (!format_printtobuffer(MORPHO_FLOAT(el[0]), format, out)) return false; - varray_charadd(out, " ", 1); - varray_charadd(out, (el[1]<0 ? "-" : "+"), 1); - if (!format_printtobuffer(MORPHO_FLOAT(fabs(el[1])), format, out)) return false; - varray_charadd(out, "im", 2); - return true; -} - -static value _getelfn(vm *v, double *el) { - objectcomplex *new = object_newcomplex(el[0], el[1]); - return morpho_wrapandbind(v, (object *) new); -} - -static linalgError_t _setelfn(vm *v, value in, double *el) { - if (MORPHO_ISCOMPLEX(in)) { - *((MorphoComplex *) el) = MORPHO_GETCOMPLEX(in)->Z; - } else if (morpho_valuetofloat(in, el)) { - el[1] = 0.0; // Set imaginary part to zero - } else return LINALGERR_NON_NUMERICAL; - return LINALGERR_OK; -} - -/** Evaluate norms */ -static double _normfn(objectmatrix *a, matrix_norm_t nrm) { - char cnrm = matrix_normtolapack(nrm); - int nrows=a->nrows, ncols=a->ncols; - -#ifdef MORPHO_LINALG_USE_LAPACKE - return LAPACKE_zlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); -#else - double work[a->nrows]; - return zlange_(&cnrm, &nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, work); -#endif -} - -/** Low level linear solve */ -static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { - int n=a->nrows, nrhs = b->ncols, info; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); -#else - zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, - &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); -#endif - - return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Low level eigensolver */ -static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { - int info, n=a->nrows; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, (__LAPACK_double_complex *) w, NULL, n, (vec ? vec->elements : NULL), n); -#else - int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; - zgeev_("N", (vec ? "V" : "N"), &n, (__LAPACK_double_complex *) a->elements, &n, (__LAPACK_double_complex *) w, NULL, &n, (__LAPACK_double_complex *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); -#endif - - return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Low level SVD */ -static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { - int info, m=a->nrows, n=a->ncols; - int minmn = (m < n) ? m : n; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zgesvd(LAPACK_COL_MAJOR, - (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U - (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT - m, n, - (__LAPACK_double_complex *) a->elements, m, // input matrix A (overwritten) - s, // singular values (min(m,n)) - (__LAPACK_double_complex *) (u ? u->elements : NULL), m, // U matrix (m×m) - (__LAPACK_double_complex *) (vt ? vt->elements : NULL), n // VT matrix (n×n) - ); -#else - int lwork = -1; - __LAPACK_double_complex work_query; - double rwork[5 * minmn]; // rwork needs at least 5*min(m,n) for zgesvd - - // Query optimal work size - zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, - (__LAPACK_double_complex *) a->elements, &m, s, - (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, - (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, - &work_query, &lwork, rwork, &info); - - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - - lwork = (int)creal(work_query); - __LAPACK_double_complex work[lwork]; - zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, - (__LAPACK_double_complex *) a->elements, &m, s, - (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, - (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, - work, &lwork, rwork, &info); -#endif - - return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Low level QR decomposition */ -static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { - int info, m=a->nrows, n=a->ncols; - int minmn = (m < n) ? m : n; - __LAPACK_double_complex tau[minmn]; - - // Compute QR factorization without pivoting: A = Q*R -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zgeqrf(LAPACK_COL_MAJOR, m, n, (__LAPACK_double_complex *) a->elements, m, tau); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#else - int lwork = -1; - __LAPACK_double_complex work_query; - - // Query optimal work size for ZGEQRF, which is reused for ZUNGQR - zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, &work_query, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - - int lwork_geqrf = (int) creal(work_query); - __LAPACK_double_complex work[lwork_geqrf]; - lwork = lwork_geqrf; - - // Compute QR factorization without pivoting - zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, work, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#endif - - // Extract R (upper triangle of a) into r - // Copy entire matrix first then zero out below the diagonal - matrix_copy(a, r); - __LAPACK_double_complex *relems = (__LAPACK_double_complex *) r->elements; - for (int j = 0; j < n && j < m - 1; j++) { - memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(__LAPACK_double_complex)); - } - - // Generate Q from reflectors - if (q) { - // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) - // ZGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns - __LAPACK_double_complex *aelems = (__LAPACK_double_complex *) a->elements; - __LAPACK_double_complex *qelems = (__LAPACK_double_complex *) q->elements; - for (int j = 0; j < n; j++) { - cblas_zcopy(m, &aelems[j * m], 1, &qelems[j * m], 1); - } - -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, minmn, minmn, (__LAPACK_double_complex *) q->elements, m, tau); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#else - lwork = lwork_geqrf; - zungqr_(&m, &minmn, &minmn, (__LAPACK_double_complex *) q->elements, &m, tau, work, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#endif - - // If Q should be m×m, zero out remaining columns if m > minmn - if (m > minmn) memset(&q->elements[minmn * m * q->nvals], 0, (m - minmn) * m * sizeof(__LAPACK_double_complex)); - } - - return LINALGERR_OK; -} - -/* ---------------------- - * Interface definition - * ---------------------- */ - -matrixinterfacedefn complexmatrixdefn = { - .printelfn = _printelfn, - .printeltobufffn = _printeltobufffn, - .getelfn = _getelfn, - .setelfn = _setelfn, - .normfn = _normfn, - .solvefn = _solve, - .eigenfn = _eigen, - .svdfn = _svd, - .qrfn = _qr -}; - -/* ---------------------- - * Constructor - * ---------------------- */ - -/** Create a new complex matrix */ -objectcomplexmatrix *complexmatrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { - return (objectcomplexmatrix *) matrix_newwithtype(OBJECT_COMPLEXMATRIX, nrows, ncols, 2, zero); -} - -/* ---------------------- - * Element access - * ---------------------- */ - -/** Sets a matrix element. */ -linalgError_t complexmatrix_setelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); - matrix->elements[ix]=creal(value); - matrix->elements[ix+1]=cimag(value); - return LINALGERR_OK; -} - -/** Gets a matrix element */ -linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, MorphoComplex *value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - MatrixCount_t ix = matrix->nvals*(col*matrix->nrows+row); - if (value) *value=MCBuild(matrix->elements[ix],matrix->elements[ix+1]); - return LINALGERR_OK; -} - -/** Copies a real matrix x into a complex matrix y */ -static linalgError_t _stridedcopy(objectmatrix *x, objectmatrix *y, int offset) { - if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dcopy((__LAPACK_int) x->ncols*x->nrows, x->elements+offset, x->nvals, y->elements, y->nvals); - return LINALGERR_OK; -} - -linalgError_t complexmatrix_promote(objectmatrix *x, objectcomplexmatrix *y) { - return _stridedcopy(x, y, 0); -} - -/** Copies the real part of a complex matrix y into */ -linalgError_t complexmatrix_demote(objectcomplexmatrix *x, objectmatrix *y, bool imag) { - return _stridedcopy(x, y, (imag?1:0)); -} - -/* ---------------------- - * Complex arithmetic - * ---------------------- */ - -/** Performs c <- alpha*(a*b) + beta*c with complex matrices */ -linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectmatrix *a, objectmatrix *b, MorphoComplex beta, objectmatrix *c) { - if (!(a->ncols==b->nrows && a->nrows==c->nrows && b->ncols==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, - a->nrows, b->ncols, a->ncols, - &alpha, (__LAPACK_double_complex *) a->elements, - a->nrows, (__LAPACK_double_complex *) b->elements, b->nrows, - &beta, (__LAPACK_double_complex *) c->elements, c->nrows); - return LINALGERR_OK; -} - -/** Scales a matrix x <- scale * x >*/ -void complematrix_scale(objectmatrix *a, MorphoComplex scale) { - cblas_zscal(a->nrows * a->ncols, (__LAPACK_double_complex *) &scale, (__LAPACK_double_complex *) a->elements, 1); -} - -/** Finds the Frobenius inner product of two complex matrices (a, b) = \sum_{i,j} conj(a)_ij * b_ij */ -linalgError_t complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { - if (!(a->ncols==b->ncols && a->nrows==b->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_zdotc_sub(a->nrows * a->ncols, (__LAPACK_double_complex *) a->elements, 1, - (__LAPACK_double_complex *) b->elements, 1, - (__LAPACK_double_complex *) out); - return LINALGERR_OK; -} - -/** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ -linalgError_t complexmatrix_r1update(MorphoComplex alpha, objectcomplexmatrix *a, objectcomplexmatrix *b, objectcomplexmatrix *c) { - MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; - if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_zgeru(CblasColMajor, m, n, (__LAPACK_double_complex *) &alpha, (__LAPACK_double_complex *) a->elements, 1, - (__LAPACK_double_complex *) b->elements, 1, - (__LAPACK_double_complex *) c->elements, c->nrows); - return LINALGERR_OK; -} - -/** Calculate the trace of a matrix */ -linalgError_t complexmatrix_trace(objectcomplexmatrix *a, MorphoComplex *out) { - if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; - MorphoComplex one = MCBuild(1.0, 0.0); - cblas_zdotu_sub(a->nrows, (__LAPACK_double_complex *) a->elements, a->ncols+1, (__LAPACK_double_complex *) &one, 0, (__LAPACK_double_complex *) out); - return LINALGERR_OK; -} - -/** Inverts the matrix a - * @param[in] a matrix to be inverted - * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { - int nrows=a->nrows, ncols=a->ncols, info; - int pivot[nrows]; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); -#else - zgetrf_(&nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, pivot, &info); -#endif - if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); -#else - int lwork=nrows*ncols; __LAPACK_double_complex work[nrows*ncols]; - zgetri_(&nrows, (__LAPACK_double_complex *) a->elements, &nrows, pivot, work, &lwork, &info); -#endif - - return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/* ********************************************************************** - * ComplexMatrix constructors - * ********************************************************************** */ - -value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { - MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - MatrixIdx_t ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - - objectcomplexmatrix *new=complexmatrix_new(nrows, ncols, true); - return morpho_wrapandbind(v, (object *) new); -} - -value complexmatrix_constructor__int(vm *v, int nargs, value *args) { - MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - objectcomplexmatrix *new=complexmatrix_new(nrows, 1, true); - return morpho_wrapandbind(v, (object *) new); -} - -value complematrix_constructor__matrix(vm *v, int nargs, value *args) { - objectmatrix *a = MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); - if (new) complexmatrix_promote(a, new); - return morpho_wrapandbind(v, (object *) new); -} - -/** Constructs a complexmatrix from a list of lists or tuples */ -value complexmatrix_constructor__list(vm *v, int nargs, value *args) { - objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_COMPLEXMATRIX, 2); - return morpho_wrapandbind(v, (object *) new); -} - -/** Constructs a matrix from an array */ -value complexmatrix_constructor__array(vm *v, int nargs, value *args) { - objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); - if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - - objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); - return morpho_wrapandbind(v, (object *) new); -} - -/* ********************************************************************** - * ComplexMatrix veneer class - * ********************************************************************** */ - -/* ---------------------- - * Arithmetic - * ---------------------- */ - -/** Add a vector */ -static value _axpy(vm *v, int nargs, value *args, double alpha) { - objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; - - if (a->ncols==b->ncols && a->nrows==b->nrows) { - objectcomplexmatrix *new=complexmatrix_new(a->nrows, a->ncols, true); - if (new) { - complexmatrix_promote(b, new); - matrix_axpy(alpha, a, new); - } - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - return out; -} - -value ComplexMatrix_add__matrix(vm *v, int nargs, value *args) { - return _axpy(v, nargs, args, 1.0); -} - -value ComplexMatrix_sub__matrix(vm *v, int nargs, value *args) { - value out = _axpy(v, nargs, args, -1.0); - if (matrix_isamatrix(out)) matrix_scale(MORPHO_GETMATRIX(out), -1.0); // -(-A + B) - return out; -} - -value ComplexMatrix_subr__matrix(vm *v, int nargs, value *args) { - return _axpy(v, nargs, args, -1.0); -} - -value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - objectmatrix *new = matrix_clone(a); - if (new) complematrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); - return morpho_wrapandbind(v, (object *) new); -} - -/** Multiplication by a complexmatrix or a regular matrix */ -static bool _promote(vm *v, objectmatrix *b, objectmatrix **bp) { // Promotes b to a complexmatrix - *bp=complexmatrix_new(b->nrows, b->ncols, true); - if (!*bp) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; } - return complexmatrix_promote(b, *bp)==LINALGERR_OK; -} - -static value _axb(vm *v, objectmatrix *a, objectmatrix *b) { // Performs a*b returning a wrapped value - if (a->ncols!=b->nrows) { morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); return MORPHO_NIL; } - objectcomplexmatrix *new=complexmatrix_new(a->nrows, b->ncols, false); - if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - complexmatrix_mmul(MCBuild(1.0, 0.0), a, b, MCBuild(0.0, 0.0), new); - return morpho_wrapandbind(v, (object *) new); -} - -static value _mul(vm *v, value a, value b, bool promoteb, bool swap) { // Driver routine for a*b - objectmatrix *A=MORPHO_GETMATRIX(a), *B=MORPHO_GETMATRIX(b), *bp=NULL; - if (promoteb) { if (_promote(v, B, &bp)) { B=bp; } else { return MORPHO_NIL; } } // Promote b if requested - value out = (swap ? _axb(v, B, A) : _axb(v, A, B)); // Multiply, swapping arguments if requested - if (bp) object_free((object *) bp); - return out; -} - -value ComplexMatrix_mul__complexmatrix(vm *v, int nargs, value *args) { - return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), false, false); -} - -value ComplexMatrix_mul__matrix(vm *v, int nargs, value *args) { - return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, false); -} - -value ComplexMatrix_mulr__matrix(vm *v, int nargs, value *args) { - return _mul(v, MORPHO_SELF(args), MORPHO_GETARG(args, 0), true, true); -} - -value ComplexMatrix_div__matrix(vm *v, int nargs, value *args) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; - objectmatrix *new=matrix_clone(b); - if (new && _promote(v, A, &ap)) matrix_solve(ap, new); - return morpho_wrapandbind(v, (object *) new); -} - -value ComplexMatrix_divr__matrix(vm *v, int nargs, value *args) { - objectmatrix *A=MORPHO_GETMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; - if (_promote(v, b, &bp)) matrix_solve(A, bp); // Promote the matrix that will contain the solution anyway - return morpho_wrapandbind(v, (object *) bp); -} - -/** Computes the trace */ -value ComplexMatrix_trace(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - MorphoComplex tr=MCBuild(0,0); - LINALG_ERRCHECKVM(complexmatrix_trace(a, &tr)); - objectcomplex *new = object_newcomplex(creal(tr), cimag(tr)); - return morpho_wrapandbind(v, (object *) new); -} - -/** Inverts a matrix */ -value ComplexMatrix_inverse(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - objectcomplexmatrix *new = matrix_clone(a); - out = morpho_wrapandbind(v, (object *) new); - if (new) LINALG_ERRCHECKVM(complexmatrix_inverse(new)); - - return out; -} - -static value _realimag(vm *v, int nargs, value *args, bool imag) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new=matrix_new(a->nrows, a->ncols, false); - if (new) complexmatrix_demote(a, new, imag); - return morpho_wrapandbind(v, (object *) new); -} - -/** Extract real part */ -value ComplexMatrix_real(vm *v, int nargs, value *args) { - return _realimag(v, nargs, args, false); -} - -/** Extract imaginary part */ -value ComplexMatrix_imag(vm *v, int nargs, value *args) { - return _realimag(v, nargs, args, true); -} - -static value _conj(vm *v, int nargs, value *args, bool trans) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new=matrix_clone(a); - if (new) { - if (trans) matrix_transpose(a, new); - cblas_dscal(a->nrows*a->ncols, -1.0, new->elements+1, new->nvals); - } - return morpho_wrapandbind(v, (object *) new); -} - -/** Extract imaginary part */ -value ComplexMatrix_conj(vm *v, int nargs, value *args) { - return _conj(v, nargs, args, false); -} - -/** Return conjugate transpose */ -value ComplexMatrix_conjTranspose(vm *v, int nargs, value *args) { - return _conj(v, nargs, args, true); -} - -/* --------- - * Products - * --------- */ - -/** Frobenius inner product */ -value ComplexMatrix_inner(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - MorphoComplex prod=MCBuild(0.0, 0.0); - value out = MORPHO_NIL; - - if (complexmatrix_inner(a, b, &prod)==LINALGERR_OK) { - objectcomplex *new = object_newcomplex(creal(prod), cimag(prod)); - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - - return out; -} - -/** Outer product */ -value ComplexMatrix_outer(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - objectcomplexmatrix *new=complexmatrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); - if (new) LINALG_ERRCHECKVM(complexmatrix_r1update(MCBuild(1.0,0.0), a, b, new)); - - return morpho_wrapandbind(v, (object *) new); -} - -MORPHO_BEGINCLASS(ComplexMatrix) -MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index_int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index_x_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Matrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Matrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (Matrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) -MORPHO_ENDCLASS - -/* ********************************************************************** - * Initialization - * ********************************************************************** */ - -void complexmatrix_initialize(void) { - objectcomplexmatrixtype=object_addtype(&objectmatrixdefn); - matrix_addinterface(&complexmatrixdefn); - - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); - - value complexmatrixclass=builtin_addclass(COMPLEXMATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(ComplexMatrix), objclass); - object_setveneerclass(OBJECT_COMPLEXMATRIX, complexmatrixclass); - - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int, Int)", complexmatrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Int)", complexmatrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (ComplexMatrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Matrix)", complematrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (List)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Tuple)", complexmatrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(COMPLEXMATRIX_CLASSNAME, "ComplexMatrix (Array)", complexmatrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); -} diff --git a/newlinalg/src/complexmatrix.h b/newlinalg/src/complexmatrix.h deleted file mode 100644 index cdb7bdd89..000000000 --- a/newlinalg/src/complexmatrix.h +++ /dev/null @@ -1,20 +0,0 @@ -/** @file complexmatrix.h - * @author T J Atherton - * - * @brief New linear algebra library -*/ - -#ifndef complexmatrix_h -#define complexmatrix_h - -/* ------------------------------------------------------- - * ComplexMatrix veneer class - * ------------------------------------------------------- */ - -#define COMPLEXMATRIX_CLASSNAME "ComplexMatrix" - -#define COMPLEXMATRIX_CONJTRANSPOSE_METHOD "conjTranspose" - -void complexmatrix_initialize(void); - -#endif diff --git a/newlinalg/src/matrix.c b/newlinalg/src/matrix.c deleted file mode 100644 index 8c725680d..000000000 --- a/newlinalg/src/matrix.c +++ /dev/null @@ -1,1488 +0,0 @@ -/** @file matrix.c - * @author T J Atherton - * - * @brief New matrices -*/ - -#define ACCELERATE_NEW_LAPACK -#define MORPHO_INCLUDE_LINALG - -#include "newlinalg.h" -#include "format.h" - -/* ********************************************************************** - * Matrix interface definitions - * ********************************************************************** */ - -/** Hold the matrix interface definitions as they're created */ -static matrixinterfacedefn _matrixdefn[LINALG_MAXMATRIXDEFNS]; -objecttype matrixinterfacedefnnext=0; /** Type of the next object definition */ - -void matrix_addinterface(matrixinterfacedefn *defn) { - if (matrixinterfacedefnnextobj.type-OBJECT_MATRIX; - if (iindxtype-OBJECT_MATRIX; - return iindx>=0 && iindxnels; -} - -void objectmatrix_printfn(object *obj, void *v) { - objectclass *klass=object_getveneerclass(obj->type); - morpho_printf(v, "<"); - morpho_printvalue(v, klass->name); - morpho_printf(v, ">"); -} - -objecttypedefn objectmatrixdefn = { - .printfn=objectmatrix_printfn, - .markfn=NULL, - .freefn=NULL, - .sizefn=objectmatrix_sizefn, - .hashfn=NULL, - .cmpfn=NULL -}; - -/* ********************************************************************** - * Matrix utility functions - * ********************************************************************** */ - -/* ---------------------- - * Matrix interface - * ---------------------- */ - -static void _printelfn(vm *v, double *el) { - double val=*el; - morpho_printf(v, "%g", (fabs(val)nrows, ncols=a->ncols; - -#ifdef MORPHO_LINALG_USE_LAPACKE - return LAPACKE_dlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); -#else - double work[a->nrows]; - return dlange_(&cnrm, &nrows, &ncols, a->elements, &nrows, work); -#endif -} - -/** Low level linear solve */ -static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { - int n=a->nrows, nrhs = b->ncols, info; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); -#else - dgesv_(&n, &nrhs, a->elements, &n, pivot, b->elements, &n, &info); -#endif - - return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Low level eigensolver */ -static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { - int info, n=a->nrows; - double wr[n], wi[n]; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, wr, wi, NULL, n, (vec ? vec->elements : NULL), n); -#else - int lwork=4*n; double work[4*n]; - dgeev_("N", (vec ? "V" : "N"), &n, a->elements, &n, wr, wi, NULL, &n, (vec ? vec->elements : NULL), &n, work, &lwork, &info); -#endif - for (int i=0; i0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Low level SVD */ -static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmatrix *vt) { - int info, m=a->nrows, n=a->ncols; - int minmn = (m < n) ? m : n; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, - (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U - (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT - m, n, - a->elements, m, // input matrix A (overwritten) - s, // singular values (min(m,n)) - (u ? u->elements : NULL), m, // U matrix (m×m) - (vt ? vt->elements : NULL), n // VT matrix (n×n) - ); -#else - int lwork = -1; - double work_query; - // Query optimal work size - dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, - (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, - &work_query, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - - lwork = (int)work_query; - double work[lwork]; - dgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, a->elements, &m, s, - (u ? u->elements : NULL), &m, (vt ? vt->elements : NULL), &n, - work, &lwork, &info); -#endif - - return (info == 0 ? LINALGERR_OK : (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Low level QR decomposition without pivoting */ -static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { - int info, m=a->nrows, n=a->ncols; - int minmn = (m < n) ? m : n; - double tau[minmn]; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_dgeqrf(LAPACK_COL_MAJOR, m, n, a->elements, m, tau); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#else - int lwork = -1; - double work_query; - - // Query optimal work size for DGEQRF, which is reused for DORGQR - dgeqrf_(&m, &n, a->elements, &m, tau, &work_query, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - - int lwork_geqrf = (int) work_query; - double work[lwork_geqrf]; - lwork = lwork_geqrf; - - // Compute QR factorization without pivoting - dgeqrf_(&m, &n, a->elements, &m, tau, work, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#endif - - // Extract R (upper triangle of a) into r - // Copy entire matrix first, then zero out below the diagonal - matrix_copy(a, r); - // Only process columns where there are rows below the diagonal (j < m - 1) - for (int j = 0; j < n && j < m - 1; j++) { - memset(&r->elements[j * m + (j + 1)], 0, (m - j - 1) * sizeof(double)); - } - - // Generate Q from reflectors - if (q) { - // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) - // DGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns - for (int j = 0; j < n; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); - -#ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, minmn, minmn, q->elements, m, tau); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#else - lwork = lwork_geqrf; - dorgqr_(&m, &minmn, &minmn, q->elements, &m, tau, work, &lwork, &info); - if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); -#endif - - // If Q should be m×m, zero out remaining columns if m > minmn - // DORGQR only generates the first minmn columns, so we zero the rest - if (m > minmn) memset(&q->elements[minmn * m], 0, (m - minmn) * m * sizeof(double)); - } - - return LINALGERR_OK; -} - -/* ---------------------- - * Interface definition - * ---------------------- */ - -matrixinterfacedefn matrixdefn = { - .printelfn = _printelfn, - .printeltobufffn = _printeltobufffn, - .getelfn = _getelfn, - .setelfn = _setelfn, - .normfn = _normfn, - .solvefn = _solve, - .eigenfn = _eigen, - .svdfn = _svd, - .qrfn = _qr -}; - -/* ---------------------- - * Constructors - * ---------------------- */ - -/** Create a generic matrix with given type and layout */ -objectmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { - MatrixCount_t nels = nrows*ncols*nvals; - objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix) + nels*sizeof(double), type); - - if (new) { - new->nrows=nrows; - new->ncols=ncols; - new->nvals=nvals; - new->nels=nels; - new->elements=new->matrixdata; - if (zero) memset(new->elements, 0, nels*sizeof(double)); - } - - return new; -} - -/** Create a new real matrix */ -objectmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { - return matrix_newwithtype(OBJECT_MATRIX, nrows, ncols, 1, zero); -} - -/** Clone a matrix */ -objectmatrix *matrix_clone(objectmatrix *in) { - objectmatrix *new = matrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); - - if (new) cblas_dcopy((__LAPACK_int) in->nels, in->elements, 1, new->elements, 1); - return new; -} - -static bool _getelement(value v, int i, value *out) { - if (MORPHO_ISLIST(v)) { - return list_getelement(MORPHO_GETLIST(v), i, out); - } else if (MORPHO_ISTUPLE(v)) { - return tuple_getelement(MORPHO_GETTUPLE(v), i, out); - } else if (MORPHO_ISNUMBER(v) || MORPHO_ISCOMPLEX(v)) { - if (i==0) { *out = v; return true; } - } - return false; -} - -static bool _length(value v, int *len) { - if (MORPHO_ISLIST(v)) { - *len = list_length(MORPHO_GETLIST(v)); return true; - } else if (MORPHO_ISTUPLE(v)) { - *len = tuple_length(MORPHO_GETTUPLE(v)); return true; - } else if (MORPHO_ISNUMBER(v) || MORPHO_ISCOMPLEX(v)) { - *len = 1; return true; - } - return false; -} - -/** Create a matrix from a list of lists (or tuples) */ -objectmatrix *matrix_listconstructor(vm *v, value lst, objecttype type, MatrixIdx_t nvals) { - value iel, jel; - - int nrows=0, ncols=0, rlen; - _length(lst, &nrows); - for (int i=0; incols) { - ncols=rlen; - } - } - - objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); - if (!new) return NULL; - - for (int i=0; isetelfn(v, jel, new->elements+(j*nrows + i)*new->nvals); - } - } - } - - return new; -} - -/** Construct a matrix from an array */ -objectmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, MatrixIdx_t nvals) { - int nrows = MORPHO_GETINTEGERVALUE(a->dimensions[0]); - int ncols = MORPHO_GETINTEGERVALUE(a->dimensions[1]); - - objectmatrix *new=matrix_newwithtype(type, nrows, ncols, nvals, true); - if (!new) return NULL; - - for (int i=0; isetelfn(v, el, new->elements+(j*nrows + i)*new->nvals); - } - } - } - return new; -} - -/* ---------------------- - * Accessing elements - * ---------------------- */ - -/** @brief Sets a matrix element. - @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - matrix->elements[matrix->nvals*(col*matrix->nrows+row)]=value; - return LINALGERR_OK; -} - -/** @brief Gets a matrix element - * @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - if (value) *value=matrix->elements[matrix->nvals*(col*matrix->nrows+row)]; - return LINALGERR_OK; -} - -/** @brief Gets a pointer to a matrix element - * @returns true if the element is in the range of the matrix, false otherwise */ -linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value) { - if (!(colncols && rownrows)) return LINALGERR_INDX_OUT_OF_BNDS; - - if (value) *value=matrix->elements+matrix->nvals*(col*matrix->nrows+row); - return LINALGERR_OK; -} - -/** Copies the column col of matrix a into the column vector b */ -linalgError_t matrix_getcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { - if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; - if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col*a->nrows, 1, b->elements, 1); - return LINALGERR_OK; -} - -/** Copies the column vector b into column col of matrix a */ -linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b) { - if (col<0 || col>=a->ncols) return LINALGERR_INDX_OUT_OF_BNDS; - if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col*a->nrows, 1); - return LINALGERR_OK; -} - -/* ---------------------- - * Arithmetic operations - * ---------------------- */ - -/** Vector addition: Performs y <- alpha*x + y */ -linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y) { - if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); - return LINALGERR_OK; -} - -/** Copies a matrix y <- x */ -linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y) { - if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); - return LINALGERR_OK; -} - -/** Scales a matrix x <- scale * x >*/ -void matrix_scale(objectmatrix *x, double scale) { - cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); -} - -/** Loads the identity matrix a <- I(n) */ -linalgError_t matrix_identity(objectmatrix *x) { - if (x->ncols!=x->nrows) return LINALGERR_NOT_SQUARE; - memset(x->elements, 0, sizeof(double)*x->nrows*x->ncols); - for (int i=0; inrows; i++) x->elements[x->nvals*(i+x->nrows*i)]=1.0; - return LINALGERR_OK; -} - -/** Performs z <- alpha*(x*y) + beta*z */ -linalgError_t matrix_mmul(double alpha, objectmatrix *x, objectmatrix *y, double beta, objectmatrix *z) { - if (!(x->ncols==y->nrows && x->nrows==z->nrows && y->ncols==z->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, x->nrows, y->ncols, x->ncols, alpha, x->elements, x->nrows, y->elements, y->nrows, beta, z->elements, z->nrows); - return LINALGERR_OK; -} - -/** Performs x <- alpha*x + beta */ -linalgError_t matrix_addscalar(objectmatrix *x, double alpha, double beta) { - for (MatrixCount_t i=0; incols*x->nrows; i++) { - for (int k=0; knvals; k++) { - x->elements[i*x->nvals+k]*=alpha; - if (k==0) x->elements[i*x->nvals+k]+=beta; - } - } - return LINALGERR_OK; -} - -/** Performs y <- x^T>*/ -linalgError_t matrix_transpose(objectmatrix *x, objectmatrix *y) { - if (!(x->ncols==y->nrows && x->nrows==y->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - - for (MatrixCount_t i=0; incols; i++) { - for (MatrixCount_t j=0; jnrows; j++) { - for (int k=0; knvals; k++) { - y->elements[j*y->nrows*y->nvals+i*y->nvals+k] = x->elements[i*x->nrows*x->nvals+j*x->nvals+k]; - } - } - } - return LINALGERR_OK; -} - -/* ---------------------- - * Unary operations - * ---------------------- */ - -/** Computes various matrix norms */ -double matrix_norm(objectmatrix *a, matrix_norm_t norm) { - return matrix_getinterface(a)->normfn(a, norm); -} - -/** Computes the sum of all elements in a matrix */ -void matrix_sum(objectmatrix *a, double *sum) { - double c[a->nvals], y, t; - for (int i=0; invals; i++) { sum[i]=0; c[i]=0; } - - for (MatrixCount_t i=0; inels; i+=a->nvals) { - for (int k=0; knvals; k++) { - y=a->elements[i+k]-c[k]; - t=sum[k]+y; - c[k]=(t-sum[k])-y; - sum[k]=t; - } - } -} - -/** Calculate the trace of a matrix */ -linalgError_t matrix_trace(objectmatrix *a, double *out) { - if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; - *out = 0.0; - for (int i = 0; i < a->nrows; i++) { - *out += a->elements[a->nvals * (i * a->nrows + i)]; - } - - return LINALGERR_OK; -} - -/* ---------------------- - * Binary operations - * ---------------------- */ - -/** Finds the Frobenius inner product of two matrices */ -linalgError_t matrix_inner(objectmatrix *x, objectmatrix *y, double *out) { - if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - - *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); - return LINALGERR_OK; -} - -/** Rank 1 update: Performs c <- alpha*a \outer b + c; a and b are treated as column vectors */ -linalgError_t matrix_r1update(double alpha, objectmatrix *a, objectmatrix *b, objectmatrix *c) { - MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; - if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - - cblas_dger(CblasColMajor, m, n, alpha, a->elements, 1, b->elements, 1, c->elements, c->nrows); - return LINALGERR_OK; -} - -/** Solve the linear system a.x = b using stack allocated memory for temporary */ -linalgError_t matrix_solvesmall(objectmatrix *a, objectmatrix *b) { - int pivot[a->nrows]; - double els[a->nels]; - objectmatrix A = MORPHO_STATICMATRIX(els, a->nrows, a->ncols); - matrix_copy(a, &A); - return (matrix_getinterface(a)->solvefn) (&A, b, pivot); -} - -/** Solve the linear system a.x = b using heap allocated memory for temporary */ -linalgError_t matrix_solvelarge(objectmatrix *a, objectmatrix *b) { - int *pivot = MORPHO_MALLOC(sizeof(int)*a->nrows); - objectmatrix *A = matrix_clone(a); - linalgError_t out = LINALGERR_ALLOC; - if (pivot && A) { - out = (matrix_getinterface(a)->solvefn) (A, b, pivot); - } - if (A) object_free((object *) A); - if (pivot) MORPHO_FREE(pivot); - return out; -} - -/** Solve the linear system a.x = b; automatrically allocates storage depending on size of the matrix - * @param[in] a lhs - * @param[in|out] b rhs — overwritten by the solution - * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t matrix_solve(objectmatrix *a, objectmatrix *b) { - if (MATRIX_ISSMALL(a)) return matrix_solvesmall(a, b); - else return matrix_solvelarge(a, b); -} - -/** Inverts the matrix a - * @param[in] a matrix to be inverted - * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ -linalgError_t matrix_inverse(objectmatrix *a) { - int nrows=a->nrows, ncols=a->ncols, info; - int pivot[nrows]; - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); -#else - dgetrf_(&nrows, &ncols, a->elements, &nrows, pivot, &info); -#endif - if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); - -#ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_dgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); -#else - int lwork=nrows*ncols; double work[nrows*ncols]; - dgetri_(&nrows, a->elements, &nrows, pivot, work, &lwork, &info); -#endif - - return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); -} - -/** Interface to eigensystem */ -linalgError_t matrix_eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) { - if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; - if (vec && ((a->nrows!=vec->nrows) || (a->nrows!=vec->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - - matrix_eigenfn_t efn = matrix_getinterface(a)->eigenfn; - if (!efn) return LINALGERR_NOT_SUPPORTED; - - objectmatrix *temp = matrix_clone(a); - if (!temp) return LINALGERR_ALLOC; - - return efn(temp, w, vec); -} - -/* ---------------------- - * Display - * ---------------------- */ - -/** Prints a matrix */ -void matrix_print(vm *v, objectmatrix *m) { - matrixinterfacedefn *interface=matrix_getinterface(m); - double *elptr; - for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m - morpho_printf(v, "[ "); - for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - matrix_getelementptr(m, i, j, &elptr); - (*interface->printelfn) (v, elptr); - morpho_printf(v, " "); - } - morpho_printf(v, "]%s", (inrows-1 ? "\n" : "")); - } -} - -/** Prints a matrix to a buffer */ -bool matrix_printtobuffer(objectmatrix *m, char *format, varray_char *out) { - matrixinterfacedefn *interface=matrix_getinterface(m); - double *elptr; - for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m - varray_charadd(out, "[ ", 2); - - for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k - matrix_getelementptr(m, i, j, &elptr); - if (!(*interface->printeltobufffn) (out, format, elptr)) return false; - varray_charadd(out, " ", 1); - } - varray_charadd(out, "]", 1); - if (inrows-1) varray_charadd(out, "\n", 1); - } - return true; -} - -/* ---------------------- - * Roll - * ---------------------- */ - -/** Rolls the matrix list */ -static void _rollflat(objectmatrix *a, objectmatrix *b, int nplaces) { - MatrixCount_t N=a->nrows*a->ncols*a->nvals; - MatrixCount_t n = abs(nplaces)*a->nvals; - if (n>N) n = n % N; - MatrixCount_t Np = N - n; // Number of elements to roll - - if (nplaces<0) { - memcpy(b->matrixdata, a->matrixdata+n, sizeof(double)*Np); - memcpy(b->matrixdata+Np, a->matrixdata, sizeof(double)*n); - } else { - memcpy(b->matrixdata+n, a->matrixdata, sizeof(double)*Np); - if (n>0) memcpy(b->matrixdata, a->matrixdata+Np, sizeof(double)*n); - } -} - -/** Copies a arow from matrix a into brow for matrix b */ -static void _copyrow(objectmatrix *a, MatrixIdx_t arow, objectmatrix *b, MatrixIdx_t brow) { - for (MatrixIdx_t i=0; incols; i++) - memcpy(b->elements+b->nvals*(i*b->nrows+brow), a->elements+a->nvals*(i*a->nrows+arow), sizeof(double)*a->nvals); -} - -/** Rolls a list by a number of elements along a given axis; stores the result in b */ -linalgError_t matrix_roll(objectmatrix *a, int nplaces, int axis, objectmatrix *b) { - if (!(a->nrows==b->nrows && a->ncols==b->ncols && a->nvals==b->nvals)) return LINALGERR_INCOMPATIBLE_DIM; - - switch(axis) { - case 0: - for (int i=0; inrows; i++) { - int j = (i+nplaces); - while (j<0) j+=a->nrows; - _copyrow(a, i, b, j % a->nrows); - } - break; - case 1: _rollflat(a, b, nplaces*a->nrows); break; - default: return LINALGERR_NOT_SUPPORTED; - } - - return LINALGERR_OK; -} - -/* ********************************************************************** - * Matrix constructors - * ********************************************************************** */ - -value matrix_constructor__int_int(vm *v, int nargs, value *args) { - MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - - objectmatrix *new=matrix_new(nrows, ncols, true); - return morpho_wrapandbind(v, (object *) new); -} - -value matrix_constructor__int(vm *v, int nargs, value *args) { - MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - objectmatrix *new=matrix_new(nrows, 1, true); - return morpho_wrapandbind(v, (object *) new); -} - -/** Clones a matrix */ -value matrix_constructor__matrix(vm *v, int nargs, value *args) { - objectmatrix *a = MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - return morpho_wrapandbind(v, (object *) matrix_clone(a)); -} - -/** Constructs a matrix from a list of lists or tuples */ -value matrix_constructor__list(vm *v, int nargs, value *args) { - objectmatrix *new = matrix_listconstructor(v, MORPHO_GETARG(args, 0), OBJECT_MATRIX, 1); - return morpho_wrapandbind(v, (object *) new); -} - -/** Constructs a matrix from an array */ -value matrix_constructor__array(vm *v, int nargs, value *args) { - objectarray *a = MORPHO_GETARRAY(MORPHO_GETARG(args, 0)); - if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } - - objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_MATRIX, 1); - return morpho_wrapandbind(v, (object *) new); -} - -value matrix_constructor__err(vm *v, int nargs, value *args) { - morpho_runtimeerror(v, MATRIX_CONSTRUCTOR); - return MORPHO_NIL; -} - -/** Creates an identity matrix */ -value matrix_identityconstructor(vm *v, int nargs, value *args) { - MatrixIdx_t n = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - objectmatrix *new = matrix_new(n,n,false); - if (new) matrix_identity(new); - - return morpho_wrapandbind(v, (object *) new); -} - -/* ********************************************************************** - * Matrix veneer class - * ********************************************************************** */ - -/* ---------------------- - * Common utility methods - * ---------------------- */ - -/** Prints a matrix */ -value Matrix_print(vm *v, int nargs, value *args) { - objectmatrix *m=MORPHO_GETMATRIX(MORPHO_SELF(args)); - matrix_print(v, m); - return MORPHO_NIL; -} - -/** Formatted conversion to a string */ -value Matrix_format(vm *v, int nargs, value *args) { - value out=MORPHO_NIL; - varray_char str; - varray_charinit(&str); - - if (matrix_printtobuffer(MORPHO_GETMATRIX(MORPHO_SELF(args)), - MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), - &str)) { - out = object_stringfromvarraychar(&str); - if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - - varray_charclear(&str); - return out; -} - -/** Copies the contents of one matrix into another */ -value Matrix_assign(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - LINALG_ERRCHECKVM(matrix_copy(b, a)); - return MORPHO_NIL; -} - -/** Clones a matrix */ -value Matrix_clone(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new=matrix_clone(a); - return morpho_wrapandbind(v, (object *) new); -} - -/* --------- - * index() - * --------- */ - -value Matrix_index_int_int(vm *v, int nargs, value *args) { - objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - value out=MORPHO_NIL; - - double *elptr=NULL; - LINALG_ERRCHECKVM(matrix_getelementptr(m, i, j, &elptr)); - - if (elptr) out=matrix_getinterface(m)->getelfn(v, elptr); - return out; -} - -static linalgError_t _slice_count(value in, MatrixIdx_t *count) { - if (morpho_isnumber(in)) { *count=1; return LINALGERR_OK; } - else if (MORPHO_ISRANGE(in)) { *count = range_count(MORPHO_GETRANGE(in)); return LINALGERR_OK; } - return LINALGERR_NON_NUMERICAL; -} - -static linalgError_t _slice_iterate(value in, unsigned int i, MatrixIdx_t *ix) { - value val=in; - if (MORPHO_ISRANGE(in)) val=range_iterate(MORPHO_GETRANGE(in), i); - - if (MORPHO_ISINTEGER(val)) { *ix=MORPHO_GETINTEGERVALUE(val); return LINALGERR_OK; } - else if (MORPHO_ISFLOAT(val)) { *ix=(MatrixIdx_t) MORPHO_GETFLOATVALUE(val); return LINALGERR_OK; } - return LINALGERR_OP_FAILED; -} - -static linalgError_t _slice_validate(value iv, value jv, MatrixIdx_t *icnt, MatrixIdx_t *jcnt) { - LINALG_ERRCHECKRETURN(_slice_count(iv, icnt)); - LINALG_ERRCHECKRETURN(_slice_count(jv, jcnt)); - if (*icnt<1 || *jcnt<1) return LINALGERR_INVLD_ARG; - return LINALGERR_OK; -} - -static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx_t jcnt, objectmatrix *a, objectmatrix *b, bool swap) { - double *ael, *bel; - for (MatrixIdx_t j=0; jnvals); - else memcpy(bel, ael, sizeof(double)*b->nvals); - } - } - return LINALGERR_OK; -} - -value Matrix_index_x_x(vm *v, int nargs, value *args) { - objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)), *new=NULL; - value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); - value out=MORPHO_NIL; - - MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix - LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); - - new=matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); - if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - - linalgError_t err=_slice_copy(iv, jv, icnt, jcnt, m, new, false); - if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); object_free((object *) new); } - else out = morpho_wrapandbind(v, (object *) new); - - return out; -} - -/* --------- - * setindex() - * --------- */ - -static void _setindex(vm *v, objectmatrix *m, MatrixIdx_t i, MatrixIdx_t j, value in) { - double *elptr=NULL; - LINALG_ERRCHECKVM(matrix_getelementptr(m, i, j, &elptr)); - if (elptr) LINALG_ERRCHECKVM(matrix_getinterface(m)->setelfn(v, in, elptr)); -} - -value Matrix_setindex_int_x(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, 0, MORPHO_GETARG(args, 1)); - return MORPHO_NIL; -} - -value Matrix_setindex_int_int_x(vm *v, int nargs, value *args) { - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - MatrixIdx_t j = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - _setindex(v, MORPHO_GETMATRIX(MORPHO_SELF(args)), i, j, MORPHO_GETARG(args, 2)); - return MORPHO_NIL; -} - -value Matrix_setindex_x_x__matrix(vm *v, int nargs, value *args) { - objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *msrc = MORPHO_GETMATRIX(MORPHO_GETARG(args, 2)); - value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); - - MatrixIdx_t icnt=0, jcnt=0; - LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); - - LINALG_ERRCHECKVM(_slice_copy(iv, jv, icnt, jcnt, m, msrc, true)); - - return MORPHO_NIL; -} - -/* --------- - * column - * --------- */ - -value Matrix_getcolumn_int(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - MatrixIdx_t i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; - - if (i>=0 && incols) { - objectmatrix *new=matrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); - if (new) matrix_getcolumn(a, i, new); - out=morpho_wrapandbind(v, (object *)new); - } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); - - return out; -} - -value Matrix_setcolumn_int__matrix(vm *v, int nargs, value *args) { - LINALG_ERRCHECKVM(matrix_setcolumn(MORPHO_GETMATRIX(MORPHO_SELF(args)), - MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)))); - return MORPHO_NIL; -} - -/* ---------- - * Arithmetic - * ---------- */ - -/** Add a vector */ -static value _axpy(vm *v, int nargs, value *args, double alpha) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); // Receiver is left hand operand - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); // Argument is right hand operand - objectmatrix *new = NULL; - value out=MORPHO_NIL; - - if (a->ncols==b->ncols && a->nrows==b->nrows) { - new=matrix_clone(a); - if (new) LINALG_ERRCHECKVM(matrix_axpy(alpha, b, new)); - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - - return out; -} - -/** Add a scalar */ -static value _xpa(vm *v, int nargs, value *args, double sgna, double sgnb) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new=NULL; - value out=MORPHO_NIL; - - double beta; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &beta)) { - new = matrix_clone(a); - if (new) LINALG_ERRCHECKVM(matrix_addscalar(new, sgna, beta*sgnb)); - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INVLDARGS); - - return out; -} - -value Matrix_add__matrix(vm *v, int nargs, value *args) { - return _axpy(v,nargs,args,1.0); -} - -value Matrix_add_nil(vm *v, int nargs, value *args) { - return MORPHO_SELF(args); -} - -value Matrix_add_x(vm *v, int nargs, value *args) { - if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to addr - return _xpa(v,nargs,args,1.0,1.0); -} - -value Matrix_sub__matrix(vm *v, int nargs, value *args) { - return _axpy(v,nargs,args,-1.0); -} - -value Matrix_sub_x(vm *v, int nargs, value *args) { - if (matrix_isamatrix(MORPHO_GETARG(args, 0))) return MORPHO_NIL; // Redirect to subr - return _xpa(v,nargs,args,1.0,-1.0); -} - -value Matrix_subr_x(vm *v, int nargs, value *args) { - return _xpa(v,nargs,args,-1.0,1.0); -} - -value Matrix_mul_float(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - double scale; - if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; - - objectmatrix *new = matrix_clone(a); - if (new) matrix_scale(new, scale); - return morpho_wrapandbind(v, (object *) new); -} - -value Matrix_mul__matrix(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; - - if (a->ncols==b->nrows) { - objectmatrix *new = matrix_new(a->nrows, b->ncols, false); - if (new) LINALG_ERRCHECKVM(matrix_mmul(1.0, a, b, 0.0, new)); - out = morpho_wrapandbind(v, (object *) new); - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - return out; -} - -value Matrix_div_float(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - double scale; - if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &scale)) return MORPHO_NIL; - scale = 1.0/scale; - if (isnan(scale)) morpho_runtimeerror(v, VM_DVZR); - - objectmatrix *new = matrix_clone(a); - if (new) matrix_scale(new, scale); - return morpho_wrapandbind(v, (object *) new); -} - -value Matrix_div__matrix(vm *v, int nargs, value *args) { - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)); // Note that the rhs is the receiver - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); // ... the lhs is the argument - - objectmatrix *sol = matrix_clone(b); - if (sol) LINALG_ERRCHECKVM(matrix_solve(a, sol)); - - return morpho_wrapandbind(v, (object *) sol); -} - -/** Accumulate in place */ -value Matrix_acc_x_x__matrix(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 1)); - - double alpha=1.0; - if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &alpha)) { morpho_runtimeerror(v, MATRIX_ARITHARGS); return MORPHO_NIL; } - - LINALG_ERRCHECKVM(matrix_axpy(alpha, b, a)); - return MORPHO_NIL; -} - -/* ---------------- - * Unary operations - * ---------------- */ - -/** Matrix norm */ -value Matrix_norm_x(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - double n; - - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &n)) { - if (fabs(n-1.0)nvals]; - - matrix_sum(a, sum); - return matrix_getinterface(a)->getelfn(v, sum); -} - -/** Computes the trace */ -value Matrix_trace(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - double out=0.0; - LINALG_ERRCHECKVM(matrix_trace(a, &out)); - return MORPHO_FLOAT(out); -} - -/** Inverts a matrix */ -value Matrix_transpose(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new = matrix_clone(a); - if (new) { - new->ncols=a->nrows; - new->nrows=a->ncols; - LINALG_ERRCHECKVM(matrix_transpose(a, new)); - } - return morpho_wrapandbind(v, (object *) new); -} - -/** Inverts a matrix */ -value Matrix_inverse(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *new = matrix_clone(a); - if (new) LINALG_ERRCHECKVM(matrix_inverse(new)); - - return morpho_wrapandbind(v, (object *) new); -} - -/* ---------------- - * Eigensystem - * ---------------- */ - -static bool _processeigenvalues(vm *v, MatrixIdx_t n, MorphoComplex *w, value *out) { - value ev[n]; - for (int i=0; incols; - MorphoComplex w[n]; - linalgError_t err=matrix_eigen(a, w, NULL); - if (err==LINALGERR_OK) { - if (_processeigenvalues(v, n, w, &out)) { - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - } else linalg_raiseerror(v, err); - - return out; -} - -#define _CHK(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _eigensystem_cleanup; } - -/** Finds the eigenvalues and eigenvectors of a matrix */ -value Matrix_eigensystem(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - value ev=MORPHO_NIL; // Will hold eigenvalues - objectmatrix *evec=NULL; // Holds eigenvectors - objecttuple *otuple=NULL; // Tuple to return everything - - MatrixIdx_t n=a->ncols; - MorphoComplex w[n]; - - evec=matrix_clone(a); - _CHK(evec); - - linalgError_t err=matrix_eigen(a, w, evec); - if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto _eigensystem_cleanup; } - - _CHK(_processeigenvalues(v, n, w, &ev)); - - value outtuple[2] = { ev, MORPHO_OBJECT(evec) }; - otuple = object_newtuple(2, outtuple); - _CHK(otuple); - - return morpho_wrapandbind(v, (object *) otuple); - -_eigensystem_cleanup: - if (evec) object_free((object *) evec); - if (otuple) object_free((object *) otuple); - if (MORPHO_ISOBJECT(ev)) { - value evx; - objecttuple *t = MORPHO_GETTUPLE(ev); - for (int i=0; inrows != u->nrows) || (a->nrows != u->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - if (vt && ((a->ncols != vt->nrows) || (a->ncols != vt->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - - objectmatrix *temp = matrix_clone(a); - if (!temp) return LINALGERR_ALLOC; - - linalgError_t err = matrix_getinterface(a)->svdfn (temp, s, u, vt); - object_free((object *) temp); - return err; -} - -/* ---------------- - * QR decomposition - * ---------------- */ - -/** Interface to QR decomposition */ -linalgError_t matrix_qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { - if (q && ((a->nrows != q->nrows) || (a->nrows != q->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - if (r && ((a->nrows != r->nrows) || (a->ncols != r->ncols))) return LINALGERR_INCOMPATIBLE_DIM; - - objectmatrix *temp = matrix_clone(a); - if (!temp) return LINALGERR_ALLOC; - - linalgError_t err = matrix_getinterface(a)->qrfn (temp, q, r); - object_free((object *) temp); - return err; -} - -/** Processes singular values into a tuple */ -static bool _processsingularvalues(vm *v, MatrixIdx_t n, double *s, value *out) { - value sv[n]; - for (int i = 0; i < n; i++) sv[i] = MORPHO_FLOAT(s[i]); - - objecttuple *new = object_newtuple(n, sv); - if (!new) return false; - - *out = MORPHO_OBJECT(new); - return true; -} - -#define _CHK_SVD(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _svd_cleanup; } -/** Singular Value Decomposition */ -value Matrix_svd(vm *v, int nargs, value *args) { - objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); - - value s = MORPHO_NIL; // Will hold singular values - objectmatrix *u = NULL; // Left singular vectors - objectmatrix *vt = NULL; // Right singular vectors (transposed) - objecttuple *otuple = NULL; // Tuple to return everything - - MatrixIdx_t m = a->nrows, n = a->ncols; - MatrixIdx_t minmn = (m < n) ? m : n; - double singular_values[minmn]; - - // Allocate U (m×m) and VT (n×n) matrices - u = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); - _CHK_SVD(u); - - vt = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), n, n, a->nvals, false); - _CHK_SVD(vt); - - linalgError_t err = matrix_svd(a, singular_values, u, vt); - if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _svd_cleanup; } - - _CHK_SVD(_processsingularvalues(v, minmn, singular_values, &s)); - - value outtuple[3] = { MORPHO_OBJECT(u), s, MORPHO_OBJECT(vt) }; - otuple = object_newtuple(3, outtuple); - _CHK_SVD(otuple); - - return morpho_wrapandbind(v, (object *) otuple); - -_svd_cleanup: - if (u) object_free((object *) u); - if (vt) object_free((object *) vt); - if (otuple) object_free((object *) otuple); - morpho_freeobject(s); - - return MORPHO_NIL; -} -#undef _CHK_SVD - -/* ---------------- - * QR decomposition - * ---------------- */ - -#define _CHK_QR(x) if (!x) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto _qr_cleanup; } -/** QR Decomposition */ -value Matrix_qr(vm *v, int nargs, value *args) { - objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); - - objectmatrix *q = NULL; // Orthogonal matrix Q - objectmatrix *r = NULL; // Upper triangular matrix R - objecttuple *otuple = NULL; // Tuple to return everything - - MatrixIdx_t m = a->nrows, n = a->ncols; - - // Allocate Q (m×m) and R (m×n) matrices - q = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, m, a->nvals, false); - _CHK_QR(q); - - r = matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), m, n, a->nvals, false); - _CHK_QR(r); - - linalgError_t err = matrix_qr(a, q, r); - if (err != LINALGERR_OK) { linalg_raiseerror(v, err); goto _qr_cleanup; } - - value outtuple[2] = { MORPHO_OBJECT(q), MORPHO_OBJECT(r) }; - otuple = object_newtuple(2, outtuple); - _CHK_QR(otuple); - - return morpho_wrapandbind(v, (object *) otuple); - -_qr_cleanup: - if (q) object_free((object *) q); - if (r) object_free((object *) r); - if (otuple) object_free((object *) otuple); - - return MORPHO_NIL; -} -#undef _CHK_QR - -/* --------- - * Products - * --------- */ - -/** Frobenius inner product */ -value Matrix_inner(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - double prod=0.0; - - LINALG_ERRCHECKVM(matrix_inner(a, b, &prod)); - - return MORPHO_FLOAT(prod); -} - -/** Outer product */ -value Matrix_outer(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); - - objectmatrix *new=matrix_new(a->nrows*a->ncols, b->nrows*b->ncols, true); - if (new) LINALG_ERRCHECKVM(matrix_r1update(1.0, a, b, new)); - - return morpho_wrapandbind(v, (object *) new); -} - -/* --------- - * Metadata - * --------- */ - -/** Reshape a matrix */ -value Matrix_reshape(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - int nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - - if (nrows*ncols==a->nrows*a->ncols) { - a->nrows=nrows; - a->ncols=ncols; - } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); - - return MORPHO_NIL; -} - -static value _roll(vm *v, objectmatrix *a, int roll, int axis) { - objectmatrix *new = matrix_clone(a); - if (new) matrix_roll(a, roll, axis, new); - return morpho_wrapandbind(v, (object *) new); -} - -/** Roll a matrix */ -value Matrix_roll_int_int(vm *v, int nargs, value *args) { - objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); - int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), - axis = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - return _roll(v, a, roll, axis); -} - -/** Roll a matrix by row */ -value Matrix_roll_int(vm *v, int nargs, value *args) { - objectmatrix *a = MORPHO_GETMATRIX(MORPHO_SELF(args)); - int roll = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - return _roll(v, a, roll, 0); -} - -/** Enumerate protocol */ -value Matrix_enumerate(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - value out=MORPHO_NIL; - - if (i<0) { - out=MORPHO_INTEGER(a->ncols*a->nrows); - } else if (incols*a->nrows) { - out=matrix_getinterface(a)->getelfn(v, a->elements+i*a->nvals); - } else { - linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); - } - - return out; -} - -/** Number of matrix elements */ -value Matrix_count(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - return MORPHO_INTEGER(a->ncols*a->nrows); -} - -/** Matrix dimensions */ -value Matrix_dimensions(vm *v, int nargs, value *args) { - objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - - value dim[2] = { MORPHO_INTEGER(a->nrows), MORPHO_INTEGER(a->ncols) }; - objecttuple *new=object_newtuple(2, dim); - - return morpho_wrapandbind(v, (object *) new); -} - -MORPHO_BEGINCLASS(Matrix) -MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(Matrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index_int_int, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index_x_x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex_int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn_int__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Matrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add_nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (Matrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (Matrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div_float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc_x_x__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "Matrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm_x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", Matrix_sum, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "Matrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (Matrix)", Matrix_inner, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "Matrix (Matrix)", Matrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll_int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) -MORPHO_ENDCLASS - -/* ********************************************************************** - * Initialization - * ********************************************************************** */ - -void matrix_initialize(void) { - objectmatrixtype=object_addtype(&objectmatrixdefn); - matrix_addinterface(&matrixdefn); - - objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); - value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); - - value matrixclass=builtin_addclass(MATRIX_CLASSNAME, MORPHO_GETCLASSDEFINITION(Matrix), objclass); - object_setveneerclass(OBJECT_MATRIX, matrixclass); - - morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Int, Int)", matrix_constructor__int_int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Int)", matrix_constructor__int, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Matrix)", matrix_constructor__matrix, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "Matrix (List)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); - - morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); - - complematrix_initialize(); -} diff --git a/newlinalg/src/matrix.h b/newlinalg/src/matrix.h deleted file mode 100644 index 7fa15bd3b..000000000 --- a/newlinalg/src/matrix.h +++ /dev/null @@ -1,236 +0,0 @@ -/** @file matrix.h - * @author T J Atherton - * - * @brief New linear algebra library -*/ - -#ifndef matrix_h -#define matrix_h - -#define LINALG_MAXMATRIXDEFNS 4 - -/* ------------------------------------------------------- - * Matrix object type - * ------------------------------------------------------- */ - -extern objecttype objectmatrixtype; -#define OBJECT_MATRIX objectmatrixtype - -extern objecttypedefn objectmatrixdefn; - -typedef int MatrixIdx_t; // Type used for matrix indices -typedef size_t MatrixCount_t; // Type used to count total number of elements - -/** Matrices are a purely numerical collection type oriented toward linear algebra. - Elements are stored in column-major format, i.e. - [ 1 2 ] - [ 3 4 ] - is stored ( 1, 3, 2, 4 ) in memory. This is for compatibility with standard linear algebra packages */ - -typedef struct { - object obj; - MatrixIdx_t nrows; // Number of rows - MatrixIdx_t ncols; // Number of columns - MatrixIdx_t nvals; // Number of doubles per entry - MatrixCount_t nels; // Total number of entries (nrows*ncols*nvals) - double *elements; - double matrixdata[]; -} objectmatrix; - -/** Tests whether an object is a matrix */ -#define MORPHO_ISMATRIX(val) object_istype(val, OBJECT_MATRIX) - -/** Gets the object as an matrix */ -#define MORPHO_GETMATRIX(val) ((objectmatrix *) MORPHO_GETOBJECT(val)) - -/** @brief Use to create static matrices on the C stack - @details Intended for small matrices; Caller needs to supply a double array of size nr*nc. */ -#define MORPHO_STATICMATRIX(darray, nr, nc) { .obj.type=OBJECT_MATRIX, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .elements=darray, .nrows=nr, .ncols=nc, .nels=nr*nc } - -/** Macro to decide if a matrix is 'small' or 'large' and hence static or dynamic allocation should be used. */ -#define MATRIX_ISSMALL(m) (m->nrows*m->ncols -#include - -/* ------------------------------------------------------- - * objectmatrixerror type - * ------------------------------------------------------- */ - -typedef enum { - LINALGERR_OK, // Operation performed correctly - LINALGERR_INCOMPATIBLE_DIM, // Matrices have incompatible dimensions, e.g. for multiplication - LINALGERR_INDX_OUT_OF_BNDS, // Index out of bounds, e.g. for access. - LINALGERR_MATRIX_SINGULAR, // Matrix is singular - LINALGERR_NOT_SQUARE, // Matrix is required to be square for this algorithm - LINALGERR_LAPACK_INVLD_ARGS, // Invalid arguments to LAPACK routine - LINALGERR_OP_FAILED, // Matrix operation failed - LINALGERR_NOT_SUPPORTED, // Operation not supported for this matrix type - LINALGERR_NON_NUMERICAL, // Non numerical args supplied - LINALGERR_INVLD_ARG, // Invalid argument supplied - LINALGERR_ALLOC // Memory allocation failed -} linalgError_t; - -/* ------------------------------------------------------- - * Errors - * ------------------------------------------------------- */ - -#define LINALG_INCOMPATIBLEMATRICES "LnAlgMtrxIncmptbl" -#define LINALG_INCOMPATIBLEMATRICES_MSG "Matrices have incompatible shape." - -#define LINALG_INDICESOUTSIDEBOUNDS "LnAlgMtrxIndxBnds" -#define LINALG_INDICESOUTSIDEBOUNDS_MSG "Matrix index out of bounds." - -#define LINALG_SINGULAR "LnAlgMtrxSnglr" -#define LINALG_SINGULAR_MSG "Matrix is singular." - -#define LINALG_NOTSQ "LnAlgMtrxNtSq" -#define LINALG_NOTSQ_MSG "Matrix is not square." - -#define LINALG_LAPACK_ARGS "LnAlgLapackArgs" -#define LINALG_LAPACK_ARGS_MSG "Lapack function called with invalid arguments." - -#define LINALG_OPFAILED "LnAlgMtrxOpFld" -#define LINALG_OPFAILED_MSG "Matrix operation failed." - -#define LINALG_NOTSUPPORTED "LnAlgMtrxNtSpprtd" -#define LINALG_NOTSUPPORTED_MSG "Operation not supported for this matrix type." - -#define LINALG_INVLDARGS "LnAlgMtrxInvldArg" -#define LINALG_INVLDARGS_MSG "Invalid arguments to matrix method." - -#define LINALG_NNNMRCL_ARG "LnAlgMtrxNnNmrclArg" -#define LINALG_NNNMRCL_ARG_MSG "Matrix method requires numerical arguments." - -#define LINALG_NORMARGS "LnAlgMtrxNrmArgs" -#define LINALG_NORMARGS_MSG "Method 'norm' requires a supported argument: 1 or inf." - -/* ------------------------------------------------------- - * Interface - * ------------------------------------------------------- */ - -void linalg_raiseerror(vm *v, linalgError_t err); - -/** Macros to simplify error checking: - - evaluates expression f that returns linalgError_t; - - if an error occurred, raises the corresponding error in a vm called v */ -#define LINALG_ERRCHECKVM(f) { linalgError_t err = f; if (err!=LINALGERR_OK) linalg_raiseerror(v, err); } - -/** As for LINALG_ERRCHECKVM but additionally jumps to a given label */ -#define LINALG_ERRCHECKVMGOTO(f, label) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); goto label; }} - -/** As for LINALG_ERRCHECKVM but additionally returnsl */ -#define LINALG_ERRCHECKVMRETURN(f, ret) { linalgError_t err = f; if (err!=LINALGERR_OK) { linalg_raiseerror(v, err); return ret; }} - -/** Similar to the above, except returns the error rather than raising it */ -#define LINALG_ERRCHECKRETURN(f) { linalgError_t err = f; if (err!=LINALGERR_OK) return err; } - -/* ------------------------------------------------------- - * Include the rest of the library - * ------------------------------------------------------- */ - -#include "matrix.h" -#include "complexmatrix.h" - -#endif diff --git a/newlinalg/test/arithmetic/complexmatrix_acc.morpho b/newlinalg/test/arithmetic/complexmatrix_acc.morpho deleted file mode 100644 index 8213224b9..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_acc.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// In-place accumulate -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+im -A[0,1]=1-im -A[1,0]=1-im -A[1,1]=1+im - -A.acc(2,A) - -print A -// expect: [ 3 + 3im 3 - 3im ] -// expect: [ 3 - 3im 3 + 3im ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/complexmatrix_add_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_add_complexmatrix.morpho deleted file mode 100644 index 6417bca8b..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_add_complexmatrix.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Add a complexmatrix to a complexmatrix -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) - -print A + A -// expect: [ 2 + 2im 4 + 4im ] -// expect: [ 6 + 6im 8 + 8im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho deleted file mode 100644 index b124d8b20..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_add_matrix.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Add a matrix to a complex matrix -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = Matrix(((1, 2), (3, 4))) - -print A + B -// expect: [ 2 + 1im 4 + 2im ] -// expect: [ 6 + 3im 8 + 4im ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/complexmatrix_add_nil.morpho b/newlinalg/test/arithmetic/complexmatrix_add_nil.morpho deleted file mode 100644 index b5fb8c5fb..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_add_nil.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Add a scalar -import newlinalg - -var A = ComplexMatrix(2,2) - -print A + nil -// expect: [ 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_add_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_add_scalar.morpho deleted file mode 100644 index 99921516f..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_add_scalar.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Add a scalar -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+im -A[1,1]=1+im - -print A + 2 -// expect: [ 3 + 1im 2 + 0im ] -// expect: [ 2 + 0im 3 + 1im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho deleted file mode 100644 index 15a97a628..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_addr_matrix.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Add a matrix to a complex matrix -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = Matrix(((1, 2), (3, 4))) - -print B + A -// expect: [ 2 + 1im 4 + 2im ] -// expect: [ 6 + 3im 8 + 4im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_addr_nil.morpho b/newlinalg/test/arithmetic/complexmatrix_addr_nil.morpho deleted file mode 100644 index 16c4faded..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_addr_nil.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Add a scalar -import newlinalg - -var A = ComplexMatrix(2,2) - -print nil + A -// expect: [ 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_div_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_div_complexmatrix.morpho deleted file mode 100644 index ac0fbcfa5..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_div_complexmatrix.morpho +++ /dev/null @@ -1,20 +0,0 @@ -// Divide ComplexMatrix by ComplexMatrix (solve linear system) -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1 -A[0,1]=1-im -A[1,0]=1 -A[1,1]=1+1im - -var b = ComplexMatrix(2,1) -b[0,0]=1+1im -b[1,0]=2 - -print b / A -// expect: [ 2 + 1im ] -// expect: [ -0.5 - 0.5im ] - -print b -// expect: [ 1 + 1im ] -// expect: [ 2 + 0im ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho deleted file mode 100644 index eed76af3d..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_div_matrix.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Divide ComplexMatrix by Matrix (solve linear system) -import newlinalg - -var A = Matrix(((1,2),(-2,1))) - -var b = ComplexMatrix((1+im, 2)) - -print b / A -// expect: [ -0.6 + 0.2im ] -// expect: [ 0.8 + 0.4im ] - -print b -// expect: [ 1 + 1im ] -// expect: [ 2 + 0im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_div_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_div_scalar.morpho deleted file mode 100644 index 8f5e2d3af..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_div_scalar.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Divide ComplexMatrix by scalar -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=2+2im -A[1,1]=4+4im - -print A / 2 -// expect: [ 1 + 1im 0 + 0im ] -// expect: [ 0 + 0im 2 + 2im ] - diff --git a/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho deleted file mode 100644 index 9e0e1e41d..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_divr_matrix.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Divide Matrix by ComplexMatrix (solve linear system) -import newlinalg - -var A = ComplexMatrix(((1,2+im),(2-im,1))) - -var b = Matrix((1, 2)) - -print b / A -// expect: [ 0.75 + 0.5im ] -// expect: [ 0 - 0.25im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_mul_complex.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_complex.morpho deleted file mode 100644 index 7c2d7b756..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_mul_complex.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Multiply ComplexMatrix by scalar -import newlinalg - -var A = ComplexMatrix(((1,2),(3,4))) - -print A * (1+im) -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_mul_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_complexmatrix.morpho deleted file mode 100644 index 00f78a9ff..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_mul_complexmatrix.morpho +++ /dev/null @@ -1,19 +0,0 @@ -// Multiply two ComplexMatrices -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[0,1]=2+2im -A[1,0]=3+3im -A[1,1]=4+4im - -var B = ComplexMatrix(2,2) -B[0,0]=1 -B[0,1]=1im -B[1,0]=-1im -B[1,1]=1 - -print A * B -// expect: [ 3 - 1im 1 + 3im ] -// expect: [ 7 - 1im 1 + 7im ] - diff --git a/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho deleted file mode 100644 index 438347695..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_mul_matrix.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Multiply two ComplexMatrices -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) -var B = Matrix(((4,3),(2,1))) - -print A * B -// expect: [ 8 + 8im 5 + 5im ] -// expect: [ 20 + 20im 13 + 13im ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/complexmatrix_mul_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_mul_scalar.morpho deleted file mode 100644 index 66f9379a2..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_mul_scalar.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Multiply ComplexMatrix by scalar -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[1,1]=2+2im - -print A * 2 -// expect: [ 2 + 2im 0 + 0im ] -// expect: [ 0 + 0im 4 + 4im ] - diff --git a/newlinalg/test/arithmetic/complexmatrix_mulr_complex.xmorpho b/newlinalg/test/arithmetic/complexmatrix_mulr_complex.xmorpho deleted file mode 100644 index ab5cf79db..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_mulr_complex.xmorpho +++ /dev/null @@ -1,8 +0,0 @@ -// Multiply ComplexMatrix by scalar -import newlinalg - -var A = ComplexMatrix(((1,2),(3,4))) - -print (1+im) * A -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho deleted file mode 100644 index f9551c2f8..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_mulr_matrix.morpho +++ /dev/null @@ -1,15 +0,0 @@ -// Multiply two ComplexMatrices -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im),(3+3im,4+4im))) -var B = Matrix(((4,3),(2,1))) - -print B * A -// expect: [ 13 + 13im 20 + 20im ] -// expect: [ 5 + 5im 8 + 8im ] - -var C = ComplexMatrix([[1+1im],[3+3im]]) - -print B * C -// expect: [ 13 + 13im ] -// expect: [ 5 + 5im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_sub_complexmatrix.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_complexmatrix.morpho deleted file mode 100644 index c6bb639da..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_sub_complexmatrix.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Subtract a complexmatrix from a complexmatrix -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = ComplexMatrix(((4+4im, 3+3im), (2+2im, 1+1im))) - -print A - B -// expect: [ -3 - 3im -1 - 1im ] -// expect: [ 1 + 1im 3 + 3im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho deleted file mode 100644 index 5e14f01c9..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_sub_matrix.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Subtract a matrix from a complexmatrix -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = Matrix(((4, 3), (2, 1))) - -print A - B -// expect: [ -3 + 1im -1 + 2im ] -// expect: [ 1 + 3im 3 + 4im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_sub_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_sub_scalar.morpho deleted file mode 100644 index fed8777b9..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_sub_scalar.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Subtract a scalar -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=2+2im -A[1,1]=2+2im - -print A - 2 -// expect: [ 0 + 2im -2 + 0im ] -// expect: [ -2 + 0im 0 + 2im ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho b/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho deleted file mode 100644 index ff6d357b4..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_subr_matrix.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Subtract a matrix from a complexmatrix -import newlinalg - -var A = ComplexMatrix(((1+1im, 2+2im), (3+3im, 4+4im))) -var B = Matrix(((4, 3), (2, 1))) - -print B - A -// expect: [ 3 - 1im 1 - 2im ] -// expect: [ -1 - 3im -3 - 4im ] diff --git a/newlinalg/test/arithmetic/complexmatrix_subr_scalar.morpho b/newlinalg/test/arithmetic/complexmatrix_subr_scalar.morpho deleted file mode 100644 index 547e355c2..000000000 --- a/newlinalg/test/arithmetic/complexmatrix_subr_scalar.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Subtract a scalar -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+im -A[1,1]=1+im - -print 2 - A -// expect: [ 1 - 1im 2 + 0im ] -// expect: [ 2 + 0im 1 - 1im ] diff --git a/newlinalg/test/arithmetic/matrix_acc.morpho b/newlinalg/test/arithmetic/matrix_acc.morpho deleted file mode 100644 index 2a6a22ba9..000000000 --- a/newlinalg/test/arithmetic/matrix_acc.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// In-place accumulate -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=1 -A[1,0]=1 -A[1,1]=1 - -A.acc(2,A) - -print A -// expect: [ 3 3 ] -// expect: [ 3 3 ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/matrix_add_matrix.morpho b/newlinalg/test/arithmetic/matrix_add_matrix.morpho deleted file mode 100644 index 7c71df78d..000000000 --- a/newlinalg/test/arithmetic/matrix_add_matrix.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Matrix arithmetic - -import newlinalg - -var a = Matrix([[1, 2], [3, 4]]) -var b = Matrix([[0, 1], [1, 0]]) - -print "A+B:" -print a+b -// expect: A+B: -// expect: [ 1 3 ] -// expect: [ 4 4 ] diff --git a/newlinalg/test/arithmetic/matrix_add_nil.morpho b/newlinalg/test/arithmetic/matrix_add_nil.morpho deleted file mode 100644 index 2f3b764ee..000000000 --- a/newlinalg/test/arithmetic/matrix_add_nil.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Add a scalar -import newlinalg - -var A = Matrix(2,2) - -print A + nil -// expect: [ 0 0 ] -// expect: [ 0 0 ] diff --git a/newlinalg/test/arithmetic/matrix_add_scalar.morpho b/newlinalg/test/arithmetic/matrix_add_scalar.morpho deleted file mode 100644 index a7c811108..000000000 --- a/newlinalg/test/arithmetic/matrix_add_scalar.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Add a scalar -import newlinalg - -var A = Matrix(2,2) - -print A + 2 -// expect: [ 2 2 ] -// expect: [ 2 2 ] diff --git a/newlinalg/test/arithmetic/matrix_addr_nil.morpho b/newlinalg/test/arithmetic/matrix_addr_nil.morpho deleted file mode 100644 index c3334e603..000000000 --- a/newlinalg/test/arithmetic/matrix_addr_nil.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Add nil from the right -import newlinalg - -var A = Matrix(2,2) -A += 1 - -print nil + A -// expect: [ 1 1 ] -// expect: [ 1 1 ] diff --git a/newlinalg/test/arithmetic/matrix_addr_scalar.morpho b/newlinalg/test/arithmetic/matrix_addr_scalar.morpho deleted file mode 100644 index 93e721524..000000000 --- a/newlinalg/test/arithmetic/matrix_addr_scalar.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Add a scalar from the right -import newlinalg - -var A = Matrix(2,2) - -print 2 + A -// expect: [ 2 2 ] -// expect: [ 2 2 ] diff --git a/newlinalg/test/arithmetic/matrix_div_matrix.morpho b/newlinalg/test/arithmetic/matrix_div_matrix.morpho deleted file mode 100644 index 866d95302..000000000 --- a/newlinalg/test/arithmetic/matrix_div_matrix.morpho +++ /dev/null @@ -1,17 +0,0 @@ -// Divide Matrix by Matrix (solve linear system) -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -var b = Matrix(2,1) -b[0]=1 -b[1]=2 - -print b / A -// expect: [ 0 ] -// expect: [ 0.5 ] - diff --git a/newlinalg/test/arithmetic/matrix_div_scalar.morpho b/newlinalg/test/arithmetic/matrix_div_scalar.morpho deleted file mode 100644 index 4fb79d923..000000000 --- a/newlinalg/test/arithmetic/matrix_div_scalar.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Divide Matrix by scalar -import newlinalg - -var A = Matrix(2,2) -A[0,0]=2 -A[1,1]=4 - -print A / 2 -// expect: [ 1 0 ] -// expect: [ 0 2 ] - diff --git a/newlinalg/test/arithmetic/matrix_mul_matrix.morpho b/newlinalg/test/arithmetic/matrix_mul_matrix.morpho deleted file mode 100644 index 798403034..000000000 --- a/newlinalg/test/arithmetic/matrix_mul_matrix.morpho +++ /dev/null @@ -1,36 +0,0 @@ -// Multiply two Matrices -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -var B = Matrix(2,2) -B[0,0]=1 -B[0,1]=0 -B[1,0]=0 -B[1,1]=1 - -print A * B -// expect: [ 1 2 ] -// expect: [ 3 4 ] - -var a = Matrix([[1, 2], [3, 4]]) -var b = Matrix([[0, 1], [1, 0]]) - -print "A*B:" -print a*b -// expect: A*B: -// expect: [ 2 1 ] -// expect: [ 4 3 ] - -var c = Matrix([[1,2,3], [4,5,6]]) -var d = Matrix([[1,2], [3,4], [5,6]]) - -print "C*D:" -print c*d -// expect: C*D: -// expect: [ 22 28 ] -// expect: [ 49 64 ] \ No newline at end of file diff --git a/newlinalg/test/arithmetic/matrix_mul_scalar.morpho b/newlinalg/test/arithmetic/matrix_mul_scalar.morpho deleted file mode 100644 index f88ff97b5..000000000 --- a/newlinalg/test/arithmetic/matrix_mul_scalar.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Multiply Matrix by scalar -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[1,1]=2 - -print A * 2 -// expect: [ 2 0 ] -// expect: [ 0 4 ] - diff --git a/newlinalg/test/arithmetic/matrix_negate.morpho b/newlinalg/test/arithmetic/matrix_negate.morpho deleted file mode 100644 index 0613e11d0..000000000 --- a/newlinalg/test/arithmetic/matrix_negate.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Negate - -import newlinalg - -var a = Matrix([[1,2], [3,4]]) - -print -a -// expect: [ -1 -2 ] -// expect: [ -3 -4 ] diff --git a/newlinalg/test/arithmetic/matrix_sub_matrix.morpho b/newlinalg/test/arithmetic/matrix_sub_matrix.morpho deleted file mode 100644 index dd36ad584..000000000 --- a/newlinalg/test/arithmetic/matrix_sub_matrix.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Matrix arithmetic - -import newlinalg - -var a = Matrix([[1, 2], [3, 4]]) -var b = Matrix([[0, 1], [1, 0]]) - - -print "A-B:" -print a-b -// expect: A-B: -// expect: [ 1 1 ] -// expect: [ 2 4 ] - diff --git a/newlinalg/test/arithmetic/matrix_sub_scalar.morpho b/newlinalg/test/arithmetic/matrix_sub_scalar.morpho deleted file mode 100644 index 9f0e26c54..000000000 --- a/newlinalg/test/arithmetic/matrix_sub_scalar.morpho +++ /dev/null @@ -1,8 +0,0 @@ -// Subtract a scalar -import newlinalg - -var A = Matrix(2,2) - -print A - 2 -// expect: [ -2 -2 ] -// expect: [ -2 -2 ] diff --git a/newlinalg/test/arithmetic/matrix_subr_scalar.morpho b/newlinalg/test/arithmetic/matrix_subr_scalar.morpho deleted file mode 100644 index aab246de0..000000000 --- a/newlinalg/test/arithmetic/matrix_subr_scalar.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Subtract a scalar -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[1,1]=1 - -print 2 - A -// expect: [ 1 2 ] -// expect: [ 2 1 ] diff --git a/newlinalg/test/assign/complexmatrix_assign.morpho b/newlinalg/test/assign/complexmatrix_assign.morpho deleted file mode 100644 index d55502db7..000000000 --- a/newlinalg/test/assign/complexmatrix_assign.morpho +++ /dev/null @@ -1,17 +0,0 @@ -// Assign one ComplexMatrix to another - -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0] = 1+1im -A[0,1] = 2+2im -A[1,0] = 3+3im -A[1,1] = 4+4im - -var B = ComplexMatrix(2,2) - -B.assign(A) - -print B -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] diff --git a/newlinalg/test/assign/complexmatrix_clone.morpho b/newlinalg/test/assign/complexmatrix_clone.morpho deleted file mode 100644 index 3e1a2b618..000000000 --- a/newlinalg/test/assign/complexmatrix_clone.morpho +++ /dev/null @@ -1,19 +0,0 @@ -// Clone a ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[0,1]=2+2im -A[1,0]=3+3im -A[1,1]=4+4im - -var B = A.clone() - -// Modify original -A[0,0]=9+9im - -// Clone should be unchanged -print B -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] - diff --git a/newlinalg/test/assign/matrix_assign.morpho b/newlinalg/test/assign/matrix_assign.morpho deleted file mode 100644 index 1d341bc62..000000000 --- a/newlinalg/test/assign/matrix_assign.morpho +++ /dev/null @@ -1,20 +0,0 @@ -// Assign one matrix to another - -import newlinalg - -var A = Matrix(2,2) -A[0,0] = 1 -A[0,1] = 2 -A[1,0] = 3 -A[1,1] = 4 - -var B = Matrix(2,2) -B.assign(A) - -print B -// expect: [ 1 2 ] -// expect: [ 3 4 ] - -var C = Matrix(1,2) -B.assign(C) -// expect error 'LnAlgMtrxIncmptbl' diff --git a/newlinalg/test/constructors/complexmatrix_array_constructor.morpho b/newlinalg/test/constructors/complexmatrix_array_constructor.morpho deleted file mode 100644 index 68f67b944..000000000 --- a/newlinalg/test/constructors/complexmatrix_array_constructor.morpho +++ /dev/null @@ -1,15 +0,0 @@ -// Create a Matrix from an Array - -import newlinalg - -var a[2,2] -a[0,0]=1+im -a[1,0]=2-2im -a[0,1]=3+3im -a[1,1]=4+4im - -var A = ComplexMatrix(a) - -print A -// expect: [ 1 + 1im 3 + 3im ] -// expect: [ 2 - 2im 4 + 4im ] diff --git a/newlinalg/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho b/newlinalg/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho deleted file mode 100644 index f45fe0326..000000000 --- a/newlinalg/test/constructors/complexmatrix_array_constructor_invalid_dimensions.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// ComplexMatrix constructor from Array with invalid dimensions -import newlinalg - -// Try to construct from a 1D array (should fail - requires 2D) -var a[4] -a[0] = 1 -a[1] = 2 -a[2] = 3 -a[3] = 4 - -print ComplexMatrix(a) -// expect error 'LnAlgMtrxInvldArg' diff --git a/newlinalg/test/constructors/complexmatrix_constructor.morpho b/newlinalg/test/constructors/complexmatrix_constructor.morpho deleted file mode 100644 index daf69f526..000000000 --- a/newlinalg/test/constructors/complexmatrix_constructor.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Create a ComplexMatrix - -import newlinalg - -var A = ComplexMatrix(2,2) - -print A -// expect: [ 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im ] - diff --git a/newlinalg/test/constructors/complexmatrix_constructor_edge_cases.morpho b/newlinalg/test/constructors/complexmatrix_constructor_edge_cases.morpho deleted file mode 100644 index eae633aa6..000000000 --- a/newlinalg/test/constructors/complexmatrix_constructor_edge_cases.morpho +++ /dev/null @@ -1,48 +0,0 @@ -// ComplexMatrix constructor edge cases -import newlinalg - -// Zero dimension matrix (0x0) -var A = ComplexMatrix(0, 0) -print A.dimensions() -// expect: (0, 0) -print A.count() -// expect: 0 - -// Zero rows, non-zero columns -var B = ComplexMatrix(0, 3) -print B.dimensions() -// expect: (0, 3) -print B.count() -// expect: 0 - -// Non-zero rows, zero columns -var C = ComplexMatrix(3, 0) -print C.dimensions() -// expect: (3, 0) -print C.count() -// expect: 0 - -// Single element matrix (1x1) -var D = ComplexMatrix(1, 1) -D[0,0] = 42+10im -print D -// expect: [ 42 + 10im ] - -// Single row matrix (1xN) -var E = ComplexMatrix(1, 3) -E[0,0] = 1+im -E[0,1] = 2+2im -E[0,2] = 3+3im -print E -// expect: [ 1 + 1im 2 + 2im 3 + 3im ] - -// Single column matrix (Nx1) -var F = ComplexMatrix(3, 1) -F[0,0] = 1+im -F[1,0] = 2+2im -F[2,0] = 3+3im -print F -// expect: [ 1 + 1im ] -// expect: [ 2 + 2im ] -// expect: [ 3 + 3im ] - diff --git a/newlinalg/test/constructors/complexmatrix_constructor_invalid_args.morpho b/newlinalg/test/constructors/complexmatrix_constructor_invalid_args.morpho deleted file mode 100644 index e95d5e169..000000000 --- a/newlinalg/test/constructors/complexmatrix_constructor_invalid_args.morpho +++ /dev/null @@ -1,6 +0,0 @@ -// ComplexMatrix constructor with invalid arguments -import newlinalg - -// Try to construct with invalid argument types -print ComplexMatrix("invalid") -// expect error 'MltplDsptchFld' diff --git a/newlinalg/test/constructors/complexmatrix_list_constructor.morpho b/newlinalg/test/constructors/complexmatrix_list_constructor.morpho deleted file mode 100644 index 8f39b5f04..000000000 --- a/newlinalg/test/constructors/complexmatrix_list_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a ComplexMatrix from a List of Lists - -import newlinalg - -var A = ComplexMatrix([[1+im,2-2im],[3+3im,4-4im]]) - -print A -// expect: [ 1 + 1im 2 - 2im ] -// expect: [ 3 + 3im 4 - 4im ] \ No newline at end of file diff --git a/newlinalg/test/constructors/complexmatrix_list_vector_constructor.morpho b/newlinalg/test/constructors/complexmatrix_list_vector_constructor.morpho deleted file mode 100644 index 3915d5be8..000000000 --- a/newlinalg/test/constructors/complexmatrix_list_vector_constructor.morpho +++ /dev/null @@ -1,18 +0,0 @@ -// Create a ComplexMatrix from a List of Values - -import newlinalg - -var A = ComplexMatrix([1+im, 2-2im, 3+3im, 4-4im]) - -print A -// expect: [ 1 + 1im ] -// expect: [ 2 - 2im ] -// expect: [ 3 + 3im ] -// expect: [ 4 - 4im ] - -var B = ComplexMatrix(((1+im), (2), (3), (4-4im))) -print B -// expect: [ 1 + 1im ] -// expect: [ 2 + 0im ] -// expect: [ 3 + 0im ] -// expect: [ 4 - 4im ] diff --git a/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho b/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho deleted file mode 100644 index 9c94d9a69..000000000 --- a/newlinalg/test/constructors/complexmatrix_matrix_constructor.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Create a Matrix from an Array - -import newlinalg - -var A = Matrix(((1,2), (3,4))) - -var B = ComplexMatrix(A) - -print B -// expect: [ 1 + 0im 2 + 0im ] -// expect: [ 3 + 0im 4 + 0im ] diff --git a/newlinalg/test/constructors/complexmatrix_tuple_column_constructor.morpho b/newlinalg/test/constructors/complexmatrix_tuple_column_constructor.morpho deleted file mode 100644 index ac7140443..000000000 --- a/newlinalg/test/constructors/complexmatrix_tuple_column_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a column vector from a list of tuples - -import newlinalg - -var C = ComplexMatrix(((1+1im),(3+3im))) - -print C -// expect: [ 1 + 1im ] -// expect: [ 3 + 3im ] diff --git a/newlinalg/test/constructors/complexmatrix_tuple_constructor.morpho b/newlinalg/test/constructors/complexmatrix_tuple_constructor.morpho deleted file mode 100644 index fb895cd8c..000000000 --- a/newlinalg/test/constructors/complexmatrix_tuple_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a ComplexMatrix from a List of Lists - -import newlinalg - -var A = ComplexMatrix(((1+im,2-2im),(3+3im,4-4im))) - -print A -// expect: [ 1 + 1im 2 - 2im ] -// expect: [ 3 + 3im 4 - 4im ] \ No newline at end of file diff --git a/newlinalg/test/constructors/complexmatrix_vector_constructor.morpho b/newlinalg/test/constructors/complexmatrix_vector_constructor.morpho deleted file mode 100644 index 55e32e485..000000000 --- a/newlinalg/test/constructors/complexmatrix_vector_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a ComplexMatrix column vector - -import newlinalg - -var A = ComplexMatrix(2) - -print A -// expect: [ 0 + 0im ] -// expect: [ 0 + 0im ] diff --git a/newlinalg/test/constructors/matrix_array_constructor.morpho b/newlinalg/test/constructors/matrix_array_constructor.morpho deleted file mode 100644 index 0658a8f00..000000000 --- a/newlinalg/test/constructors/matrix_array_constructor.morpho +++ /dev/null @@ -1,16 +0,0 @@ -// Create a Matrix from an Array - -import newlinalg - -var a[2,2] -a[0,0]=1 -a[1,0]=3 -a[0,1]=2 -a[1,1]=4 - -var A = Matrix(a) - -print A -// expect: [ 1 2 ] -// expect: [ 3 4 ] - diff --git a/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho b/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho deleted file mode 100644 index 3c98c0b1e..000000000 --- a/newlinalg/test/constructors/matrix_array_constructor_invalid_dimensions.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Matrix constructor from Array with invalid dimensions -import newlinalg - -// Try to construct from a 1D array (should fail - requires 2D) -var a[4] -a[0] = 1 -a[1] = 2 -a[2] = 3 -a[3] = 4 - -print Matrix(a) -// expect error 'LnAlgMtrxInvldArg' diff --git a/newlinalg/test/constructors/matrix_constructor.morpho b/newlinalg/test/constructors/matrix_constructor.morpho deleted file mode 100644 index c4b721149..000000000 --- a/newlinalg/test/constructors/matrix_constructor.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Create a Matrix - -import newlinalg - -var A = Matrix(2,2) - -print A -// expect: [ 0 0 ] -// expect: [ 0 0 ] - diff --git a/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho b/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho deleted file mode 100644 index 6d5954c6d..000000000 --- a/newlinalg/test/constructors/matrix_constructor_edge_cases.morpho +++ /dev/null @@ -1,48 +0,0 @@ -// Matrix constructor edge cases -import newlinalg - -// Zero dimension matrix (0x0) -var A = Matrix(0, 0) -print A.dimensions() -// expect: (0, 0) -print A.count() -// expect: 0 - -// Zero rows, non-zero columns -var B = Matrix(0, 3) -print B.dimensions() -// expect: (0, 3) -print B.count() -// expect: 0 - -// Non-zero rows, zero columns -var C = Matrix(3, 0) -print C.dimensions() -// expect: (3, 0) -print C.count() -// expect: 0 - -// Single element matrix (1x1) -var D = Matrix(1, 1) -D[0,0] = 42 -print D -// expect: [ 42 ] - -// Single row matrix (1xN) -var E = Matrix(1, 3) -E[0,0] = 1 -E[0,1] = 2 -E[0,2] = 3 -print E -// expect: [ 1 2 3 ] - -// Single column matrix (Nx1) -var F = Matrix(3, 1) -F[0,0] = 1 -F[1,0] = 2 -F[2,0] = 3 -print F -// expect: [ 1 ] -// expect: [ 2 ] -// expect: [ 3 ] - diff --git a/newlinalg/test/constructors/matrix_identity_constructor.morpho b/newlinalg/test/constructors/matrix_identity_constructor.morpho deleted file mode 100644 index 2d850ac4e..000000000 --- a/newlinalg/test/constructors/matrix_identity_constructor.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// IdentityMatrix constructor -import newlinalg - -var I = IdentityMatrix(3) - -print I -// expect: [ 1 0 0 ] -// expect: [ 0 1 0 ] -// expect: [ 0 0 1 ] - -var I2 = IdentityMatrix(1) -print I2 -// expect: [ 1 ] diff --git a/newlinalg/test/constructors/matrix_list_constructor.morpho b/newlinalg/test/constructors/matrix_list_constructor.morpho deleted file mode 100644 index 15e238822..000000000 --- a/newlinalg/test/constructors/matrix_list_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a Matrix from a List of Lists - -import newlinalg - -var A = Matrix([[1,2],[3,4]]) - -print A -// expect: [ 1 2 ] -// expect: [ 3 4 ] diff --git a/newlinalg/test/constructors/matrix_list_vector_constructor.morpho b/newlinalg/test/constructors/matrix_list_vector_constructor.morpho deleted file mode 100644 index 8790fd031..000000000 --- a/newlinalg/test/constructors/matrix_list_vector_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a column vector from a list of tuples - -import newlinalg - -var C = Matrix(((1),(2))) - -print C -// expect: [ 1 ] -// expect: [ 2 ] diff --git a/newlinalg/test/constructors/matrix_tuple_constructor.morpho b/newlinalg/test/constructors/matrix_tuple_constructor.morpho deleted file mode 100644 index 7d400bdda..000000000 --- a/newlinalg/test/constructors/matrix_tuple_constructor.morpho +++ /dev/null @@ -1,16 +0,0 @@ -// Create a Matrix from a Tuple of Tuples - -import newlinalg - -var A = Matrix(((1,2),(3,4))) - -print A -// expect: [ 1 2 ] -// expect: [ 3 4 ] - -// Mix Tuples and Lists -var B = Matrix(([1,2],[3,4])) - -print B -// expect: [ 1 2 ] -// expect: [ 3 4 ] diff --git a/newlinalg/test/constructors/matrix_vector_constructor.morpho b/newlinalg/test/constructors/matrix_vector_constructor.morpho deleted file mode 100644 index bf2e0b355..000000000 --- a/newlinalg/test/constructors/matrix_vector_constructor.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Create a Matrix - -import newlinalg - -var A = Matrix(2) - -print A -// expect: [ 0 ] -// expect: [ 0 ] diff --git a/newlinalg/test/constructors/vector_constructor.morpho b/newlinalg/test/constructors/vector_constructor.morpho deleted file mode 100644 index 3a508fb90..000000000 --- a/newlinalg/test/constructors/vector_constructor.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Create a column vector - -import newlinalg - -var A = Matrix(2) - -print A -// expect: [ 0 ] -// expect: [ 0 ] - diff --git a/newlinalg/test/errors/complexmatrix_incompatible_dimensions.morpho b/newlinalg/test/errors/complexmatrix_incompatible_dimensions.morpho deleted file mode 100644 index f9f59eef0..000000000 --- a/newlinalg/test/errors/complexmatrix_incompatible_dimensions.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// Incompatible dimensions error -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im - -var B = ComplexMatrix(3,3) -B[0,0]=1+1im - -// Try to add incompatible matrices -print A + B -// expect error 'LnAlgMtrxIncmptbl' - diff --git a/newlinalg/test/errors/complexmatrix_index_out_of_bounds.morpho b/newlinalg/test/errors/complexmatrix_index_out_of_bounds.morpho deleted file mode 100644 index 6b09281d5..000000000 --- a/newlinalg/test/errors/complexmatrix_index_out_of_bounds.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Index out of bounds error -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im - -// Try to access out of bounds -print A[5,5] -// expect error 'LnAlgMtrxIndxBnds' - diff --git a/newlinalg/test/errors/complexmatrix_non_square_error.morpho b/newlinalg/test/errors/complexmatrix_non_square_error.morpho deleted file mode 100644 index 37fe8049d..000000000 --- a/newlinalg/test/errors/complexmatrix_non_square_error.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Non-square matrix err. (for operations requiring square matrices) -import newlinalg - -var A = ComplexMatrix(2,3) -A[0,0]=1+1im - -// Try trace on non-square matrix -print A.trace() -// expect error 'LnAlgMtrxNtSq' - diff --git a/newlinalg/test/index/complexmatrix_getcolumn.morpho b/newlinalg/test/index/complexmatrix_getcolumn.morpho deleted file mode 100644 index ee1b4b372..000000000 --- a/newlinalg/test/index/complexmatrix_getcolumn.morpho +++ /dev/null @@ -1,19 +0,0 @@ -// Get columns of a ComplexMatrix - -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0] = 1+1im -A[0,1] = 2+2im -A[1,0] = 3+3im -A[1,1] = 4+4im - -print A.column(0) -// expect: [ 1 + 1im ] -// expect: [ 3 + 3im ] - -print A.column(1) -// expect: [ 2 + 2im ] -// expect: [ 4 + 4im ] - -print A.column(2) // expect error 'LnAlgMtrxIndxBnds' diff --git a/newlinalg/test/index/complexmatrix_getindex.morpho b/newlinalg/test/index/complexmatrix_getindex.morpho deleted file mode 100644 index 344d5e6d3..000000000 --- a/newlinalg/test/index/complexmatrix_getindex.morpho +++ /dev/null @@ -1,21 +0,0 @@ -// Get elements of a ComplexMatrix - -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0] = 1+1im -A[1,0] = 2+2im -A[0,1] = 3+3im -A[1,1] = 4+4im - -// Array-like access -print A[0,0] // expect: 1 + 1im -print A[1,0] // expect: 2 + 2im -print A[0,1] // expect: 3 + 3im -print A[1,1] // expect: 4 + 4im - -// Vector-like access -print A[0] // expect: 1 + 1im -print A[1] // expect: 2 + 2im -print A[2] // expect: 3 + 3im -print A[3] // expect: 4 + 4im diff --git a/newlinalg/test/index/complexmatrix_setcolumn.morpho b/newlinalg/test/index/complexmatrix_setcolumn.morpho deleted file mode 100644 index 3e7e5e78d..000000000 --- a/newlinalg/test/index/complexmatrix_setcolumn.morpho +++ /dev/null @@ -1,22 +0,0 @@ -// Set columns of a Matrix - -import newlinalg - -var A = ComplexMatrix(2,2) - -var b = ComplexMatrix(2,1) -b[0] = 1+1im -b[1] = 3+3im - -var c = ComplexMatrix(2,1) -c[0] = 2+2im -c[1] = 4+4im - -A.setColumn(0,b) -A.setColumn(1,c) - -print A -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] - -print A.setColumn(2,b) // expect error 'LnAlgMtrxIndxBnds' diff --git a/newlinalg/test/index/complexmatrix_setindex.morpho b/newlinalg/test/index/complexmatrix_setindex.morpho deleted file mode 100644 index ad73e4bf1..000000000 --- a/newlinalg/test/index/complexmatrix_setindex.morpho +++ /dev/null @@ -1,21 +0,0 @@ -// Set elements of a ComplexMatrix - -import newlinalg - -var A = ComplexMatrix(2,2) - -// Set using two indices -A[0,0] = 1+1im -A[0,1] = 2+2im -A[1,0] = 3+3im -A[1,1] = 4+4im - -print A -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im ] - -// Set using single index (vector-like) -A[0] = 5+5im -print A[0,0] -// expect: 5 + 5im - diff --git a/newlinalg/test/index/complexmatrix_setindex_real.morpho b/newlinalg/test/index/complexmatrix_setindex_real.morpho deleted file mode 100644 index d6ed6f9e3..000000000 --- a/newlinalg/test/index/complexmatrix_setindex_real.morpho +++ /dev/null @@ -1,16 +0,0 @@ -// Set elements of a ComplexMatrix with mixture of Complex and Real args - -import newlinalg - -var A = ComplexMatrix(2,2) - -// Set using two indices -A[0,0] = 1+im // Make sure imag part is zero'd out -A[0,0] = 1 -A[0,1] = 2+2im -A[1,0] = 3.0 -A[1,1] = 4+4im - -print A -// expect: [ 1 + 0im 2 + 2im ] -// expect: [ 3 + 0im 4 + 4im ] diff --git a/newlinalg/test/index/complexmatrix_setslice.morpho b/newlinalg/test/index/complexmatrix_setslice.morpho deleted file mode 100644 index 57f187eaf..000000000 --- a/newlinalg/test/index/complexmatrix_setslice.morpho +++ /dev/null @@ -1,50 +0,0 @@ -// Copy elements of a ComplexMatrix using slices -import newlinalg - -var A = ComplexMatrix(((1+1im,2+2im),(3+3im,4+4im))) - -var B = ComplexMatrix(4,4) - -B[0..1, 0..1] = A -print B -// expect: [ 1 + 1im 2 + 2im 0 + 0im 0 + 0im ] -// expect: [ 3 + 3im 4 + 4im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] - -var C = ComplexMatrix(4,4) -C[0..2:2, 0..2:2] = A -print C -// expect: [ 1 + 1im 0 + 0im 2 + 2im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 3 + 3im 0 + 0im 4 + 4im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] - -var D = ComplexMatrix(4,4) -D[1..2, 1..2] = A -print D -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 1 + 1im 2 + 2im 0 + 0im ] -// expect: [ 0 + 0im 3 + 3im 4 + 4im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] - -var E = ComplexMatrix(4,4) -E[1..3:2, 1..3:2] = A -print E -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 1 + 1im 0 + 0im 2 + 2im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 3 + 3im 0 + 0im 4 + 4im ] - -var F = ComplexMatrix(4,4) -F[0..1, 0] = A[0..1, 1] -print F -// expect: [ 2 + 2im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 4 + 4im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] -// expect: [ 0 + 0im 0 + 0im 0 + 0im 0 + 0im ] - -B[0..5, 0..5] = A -print B -// expect error 'LnAlgMtrxIndxBnds' - diff --git a/newlinalg/test/index/complexmatrix_slice.morpho b/newlinalg/test/index/complexmatrix_slice.morpho deleted file mode 100644 index 0690a8e1f..000000000 --- a/newlinalg/test/index/complexmatrix_slice.morpho +++ /dev/null @@ -1,25 +0,0 @@ -// Slice a ComplexMatrix -import newlinalg - -var A = ComplexMatrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16)))*(1+1im) - -print A[0..1, 0..1] -// expect: [ 1 + 1im 2 + 2im ] -// expect: [ 5 + 5im 6 + 6im ] - -print A[0..2, 0] -// expect: [ 1 + 1im ] -// expect: [ 5 + 5im ] -// expect: [ 9 + 9im ] - -print A[2..0:-1, 0] -// expect: [ 9 + 9im ] -// expect: [ 5 + 5im ] -// expect: [ 1 + 1im ] - -print A[0..3:2, 0..3:2] -// expect: [ 1 + 1im 3 + 3im ] -// expect: [ 9 + 9im 11 + 11im ] - -print A[0..1:2, "Foo"] -// expect error 'LnAlgMtrxNnNmrclArg' diff --git a/newlinalg/test/index/matrix_getcolumn.morpho b/newlinalg/test/index/matrix_getcolumn.morpho deleted file mode 100644 index 59e613ae0..000000000 --- a/newlinalg/test/index/matrix_getcolumn.morpho +++ /dev/null @@ -1,19 +0,0 @@ -// Get columns of a Matrix - -import newlinalg - -var A = Matrix(2,2) -A[0,0] = 1 -A[0,1] = 2 -A[1,0] = 3 -A[1,1] = 4 - -print A.column(0) -// expect: [ 1 ] -// expect: [ 3 ] - -print A.column(1) -// expect: [ 2 ] -// expect: [ 4 ] - -print A.column(2) // expect error 'LnAlgMtrxIndxBnds' \ No newline at end of file diff --git a/newlinalg/test/index/matrix_getindex.morpho b/newlinalg/test/index/matrix_getindex.morpho deleted file mode 100644 index f49b95701..000000000 --- a/newlinalg/test/index/matrix_getindex.morpho +++ /dev/null @@ -1,21 +0,0 @@ -// Get elements of a Matrix - -import newlinalg - -var A = Matrix(2,2) -A[0,0] = 1 -A[1,0] = 2 -A[0,1] = 3 -A[1,1] = 4 - -// Array-like access -print A[0,0] // expect: 1 -print A[1,0] // expect: 2 -print A[0,1] // expect: 3 -print A[1,1] // expect: 4 - -// Vector-like access -print A[0] // expect: 1 -print A[1] // expect: 2 -print A[2] // expect: 3 -print A[3] // expect: 4 \ No newline at end of file diff --git a/newlinalg/test/index/matrix_setcolumn.morpho b/newlinalg/test/index/matrix_setcolumn.morpho deleted file mode 100644 index 38e505ec0..000000000 --- a/newlinalg/test/index/matrix_setcolumn.morpho +++ /dev/null @@ -1,22 +0,0 @@ -// Set columns of a Matrix - -import newlinalg - -var A = Matrix(2,2) - -var b = Matrix(2,1) -b[0] = 1 -b[1] = 3 - -var c = Matrix(2,1) -c[0] = 2 -c[1] = 4 - -A.setColumn(0,b) -A.setColumn(1,c) - -print A -// expect: [ 1 2 ] -// expect: [ 3 4 ] - -print A.setColumn(2,b) // expect error 'LnAlgMtrxIndxBnds' diff --git a/newlinalg/test/index/matrix_setindex.morpho b/newlinalg/test/index/matrix_setindex.morpho deleted file mode 100644 index abe9f6cab..000000000 --- a/newlinalg/test/index/matrix_setindex.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// Set elements of a Matrix - -import newlinalg - -var A = Matrix(2,2) -A[0,0] = 1 -A[0,1] = 2 -A[1,0] = 3 -A[1,1] = 4 - -print A -// expect: [ 1 2 ] -// expect: [ 3 4 ] diff --git a/newlinalg/test/index/matrix_setslice.morpho b/newlinalg/test/index/matrix_setslice.morpho deleted file mode 100644 index 41280a84b..000000000 --- a/newlinalg/test/index/matrix_setslice.morpho +++ /dev/null @@ -1,49 +0,0 @@ -// Copy elements of a Matrix using slices -import newlinalg - -var A = Matrix(((1,2),(3,4))) - -var B = Matrix(4,4) - -B[0..1, 0..1] = A -print B -// expect: [ 1 2 0 0 ] -// expect: [ 3 4 0 0 ] -// expect: [ 0 0 0 0 ] -// expect: [ 0 0 0 0 ] - -var C = Matrix(4,4) -C[0..2:2, 0..2:2] = A -print C -// expect: [ 1 0 2 0 ] -// expect: [ 0 0 0 0 ] -// expect: [ 3 0 4 0 ] -// expect: [ 0 0 0 0 ] - -var D = Matrix(4,4) -D[1..2, 1..2] = A -print D -// expect: [ 0 0 0 0 ] -// expect: [ 0 1 2 0 ] -// expect: [ 0 3 4 0 ] -// expect: [ 0 0 0 0 ] - -var E = Matrix(4,4) -E[1..3:2, 1..3:2] = A -print E -// expect: [ 0 0 0 0 ] -// expect: [ 0 1 0 2 ] -// expect: [ 0 0 0 0 ] -// expect: [ 0 3 0 4 ] - -var F = Matrix(4,4) -F[0..1, 0] = A[0..1, 1] -print F -// expect: [ 2 0 0 0 ] -// expect: [ 4 0 0 0 ] -// expect: [ 0 0 0 0 ] -// expect: [ 0 0 0 0 ] - -B[0..5, 0..5] = A -print B -// expect error 'LnAlgMtrxIndxBnds' \ No newline at end of file diff --git a/newlinalg/test/index/matrix_slice.morpho b/newlinalg/test/index/matrix_slice.morpho deleted file mode 100644 index 5f362fa0a..000000000 --- a/newlinalg/test/index/matrix_slice.morpho +++ /dev/null @@ -1,25 +0,0 @@ -// Slice a Matrix -import newlinalg - -var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) - -print A[0..1, 0..1] -// expect: [ 1 2 ] -// expect: [ 5 6 ] - -print A[0..2, 0] -// expect: [ 1 ] -// expect: [ 5 ] -// expect: [ 9 ] - -print A[2..0:-1, 0] -// expect: [ 9 ] -// expect: [ 5 ] -// expect: [ 1 ] - -print A[0..3:2, 0..3:2] -// expect: [ 1 3 ] -// expect: [ 9 11 ] - -print A[0..1:2, "Foo"] -// expect error 'LnAlgMtrxNnNmrclArg' diff --git a/newlinalg/test/index/matrix_slice_bounds.morpho b/newlinalg/test/index/matrix_slice_bounds.morpho deleted file mode 100644 index 819cef424..000000000 --- a/newlinalg/test/index/matrix_slice_bounds.morpho +++ /dev/null @@ -1,7 +0,0 @@ -// Slice a Matrix out of bounds -import newlinalg - -var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) - -print A[0..5, 0..2] -// expect error 'LnAlgMtrxIndxBnds' diff --git a/newlinalg/test/index/matrix_slice_infinite_range.morpho b/newlinalg/test/index/matrix_slice_infinite_range.morpho deleted file mode 100644 index 3a4466bd5..000000000 --- a/newlinalg/test/index/matrix_slice_infinite_range.morpho +++ /dev/null @@ -1,7 +0,0 @@ -// Slice a Matrix with a range that doesn't halt -import newlinalg - -var A = Matrix(((1,2,3,4),(5,6,7,8),(9,10,11,12),(13,14,15,16))) - -print A[0..3:-1, 0] -// expect error 'LnAlgMtrxInvldArg' diff --git a/newlinalg/test/methods/complexmatrix_conj.morpho b/newlinalg/test/methods/complexmatrix_conj.morpho deleted file mode 100644 index a55c44739..000000000 --- a/newlinalg/test/methods/complexmatrix_conj.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Conjugate of a ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+4im -A[0,1]=2+3im -A[1,0]=3+2im -A[1,1]=4+1im - -print A.conj() -// expect: [ 1 - 4im 2 - 3im ] -// expect: [ 3 - 2im 4 - 1im ] diff --git a/newlinalg/test/methods/complexmatrix_conjTranspose.morpho b/newlinalg/test/methods/complexmatrix_conjTranspose.morpho deleted file mode 100644 index b616fc73d..000000000 --- a/newlinalg/test/methods/complexmatrix_conjTranspose.morpho +++ /dev/null @@ -1,22 +0,0 @@ -// Conjugate of a ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+4im -A[0,1]=2+3im -A[1,0]=3+2im -A[1,1]=4+1im - -var B=A.conjTranspose() -print B -// expect: [ 1 - 4im 3 - 2im ] -// expect: [ 2 - 3im 4 - 1im ] - -for (ev in A.eigenvalues()) print isnumber(ev) -// expect: false -// expect: false - -var C=A+B // create a hermitian matrix -for (ev in C.eigenvalues()) print isnumber(ev) -// expect: true -// expect: true diff --git a/newlinalg/test/methods/complexmatrix_count.morpho b/newlinalg/test/methods/complexmatrix_count.morpho deleted file mode 100644 index 481b8eaba..000000000 --- a/newlinalg/test/methods/complexmatrix_count.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Count elements in ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,3) -A[0,0]=1+1im -A[0,1]=2+2im -A[0,2]=3+3im -A[1,0]=4+4im -A[1,1]=5+5im -A[1,2]=6+6im - -print A.count() -// expect: 6 - diff --git a/newlinalg/test/methods/complexmatrix_dimensions.morpho b/newlinalg/test/methods/complexmatrix_dimensions.morpho deleted file mode 100644 index 1b6cb8b93..000000000 --- a/newlinalg/test/methods/complexmatrix_dimensions.morpho +++ /dev/null @@ -1,9 +0,0 @@ -// Get dimensions of ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,3) -A[0,0]=1+1im - -print A.dimensions() -// expect: (2, 3) - diff --git a/newlinalg/test/methods/complexmatrix_eigensystem.morpho b/newlinalg/test/methods/complexmatrix_eigensystem.morpho deleted file mode 100644 index ef8d57428..000000000 --- a/newlinalg/test/methods/complexmatrix_eigensystem.morpho +++ /dev/null @@ -1,25 +0,0 @@ -// Eigenvalues and eigenvectors -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=0im -A[0,1]=im -A[1,0]=im -A[1,1]=0im - -var es=A.eigensystem() -print es -// expect: ((0 + 1im, 0 - 1im), ) - -print es[0] -// expect: (0 + 1im, 0 - 1im) - -// Compare to analytical eigenvectors -var v = ComplexMatrix(2,2) -v[0,0]=sqrt(2)/2 -v[1,0]=sqrt(2)/2 -v[0,1]=sqrt(2)/2 -v[1,1]=-sqrt(2)/2 - -print abs((es[1]-v).sum()) < 1e-15 -// expect: true diff --git a/newlinalg/test/methods/complexmatrix_eigenvalues.morpho b/newlinalg/test/methods/complexmatrix_eigenvalues.morpho deleted file mode 100644 index 9a9adb813..000000000 --- a/newlinalg/test/methods/complexmatrix_eigenvalues.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Eigenvalues -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=0+0im -A[0,1]=im -A[1,0]=im -A[1,1]=0+0im - -print A.eigenvalues() -// expect: (0 + 1im, 0 - 1im) diff --git a/newlinalg/test/methods/complexmatrix_enumerate.morpho b/newlinalg/test/methods/complexmatrix_enumerate.morpho deleted file mode 100644 index c8ed07116..000000000 --- a/newlinalg/test/methods/complexmatrix_enumerate.morpho +++ /dev/null @@ -1,15 +0,0 @@ -// Enumerate elements of a matrix - -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0] = 1+im -A[0,1] = 0+0im -A[1,0] = 0+0im -A[1,1] = 1-im - -for (x in A) print x -// expect: 1 + 1im -// expect: 0 + 0im -// expect: 0 + 0im -// expect: 1 - 1im \ No newline at end of file diff --git a/newlinalg/test/methods/complexmatrix_format.morpho b/newlinalg/test/methods/complexmatrix_format.morpho deleted file mode 100644 index d5f830dde..000000000 --- a/newlinalg/test/methods/complexmatrix_format.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// Format -import newlinalg -import constants - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[0,1]=exp(im*Pi/4) -A[1,0]=exp(-im*Pi/4) -A[1,1]=-1.5*(1+1im) - -print A.format("%5.2f") -// expect: [ 1.00 + 1.00im 0.71 + 0.71im ] -// expect: [ 0.71 - 0.71im -1.50 - 1.50im ] diff --git a/newlinalg/test/methods/complexmatrix_imag.morpho b/newlinalg/test/methods/complexmatrix_imag.morpho deleted file mode 100644 index 05324513e..000000000 --- a/newlinalg/test/methods/complexmatrix_imag.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Inner product of ComplexMatrices (Frobenius inner product with conjugation) -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+4im -A[0,1]=2+3im -A[1,0]=3+2im -A[1,1]=4+1im - -print A.imag() -// expect: [ 4 3 ] -// expect: [ 2 1 ] diff --git a/newlinalg/test/methods/complexmatrix_inner.morpho b/newlinalg/test/methods/complexmatrix_inner.morpho deleted file mode 100644 index a9d6a7fe1..000000000 --- a/newlinalg/test/methods/complexmatrix_inner.morpho +++ /dev/null @@ -1,17 +0,0 @@ -// Inner product of ComplexMatrices (Frobenius inner product with conjugation) -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[0,1]=2+2im -A[1,0]=3+3im -A[1,1]=4+4im - -var B = ComplexMatrix(2,2) -B[0,0]=1 -B[0,1]=1im -B[1,0]=-1im -B[1,1]=1 - -print A.inner(B) -// expect: 4 - 6im diff --git a/newlinalg/test/methods/complexmatrix_inverse.morpho b/newlinalg/test/methods/complexmatrix_inverse.morpho deleted file mode 100644 index 9ae068292..000000000 --- a/newlinalg/test/methods/complexmatrix_inverse.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Inverse -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=0+0im -A[0,1]=1+im -A[1,0]=1-im -A[1,1]=0+0im - -print A.inverse() -// expect: [ 0 + 0im 0.5 + 0.5im ] -// expect: [ 0.5 - 0.5im 0 + 0im ] diff --git a/newlinalg/test/methods/complexmatrix_inverse_singular.morpho b/newlinalg/test/methods/complexmatrix_inverse_singular.morpho deleted file mode 100644 index 90f1e954d..000000000 --- a/newlinalg/test/methods/complexmatrix_inverse_singular.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Inverse of singular ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+0im -A[0,1]=2+0im -A[1,0]=2+0im -A[1,1]=4+0im - -print A.inverse() -// expect error 'LnAlgMtrxSnglr' - diff --git a/newlinalg/test/methods/complexmatrix_norm.morpho b/newlinalg/test/methods/complexmatrix_norm.morpho deleted file mode 100644 index d3671f1a7..000000000 --- a/newlinalg/test/methods/complexmatrix_norm.morpho +++ /dev/null @@ -1,21 +0,0 @@ -// Norm of a ComplexMatrix -import newlinalg -import constants - -var A = ComplexMatrix(2,2) -A[0,0]=1+im -A[0,1]=2+im -A[1,0]=3-3im -A[1,1]=4-4im - -print abs(A.norm(1) - (4*sqrt(2) + sqrt(5))) < 1e-15 -// expect: true - -print abs(A.norm(Inf) - 7*sqrt(2)) < 1e-15 -// expect: true - -print abs(A.norm() - sqrt(57)) < 1e-15 -// expect: true - -print A.norm(5) -// expect error 'LnAlgMtrxNrmArgs' \ No newline at end of file diff --git a/newlinalg/test/methods/complexmatrix_outer.morpho b/newlinalg/test/methods/complexmatrix_outer.morpho deleted file mode 100644 index 2999f4e36..000000000 --- a/newlinalg/test/methods/complexmatrix_outer.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Outer product of two vectors -import newlinalg - -var A = ComplexMatrix((1+1im,2-2im,3+3im)) -var B = ComplexMatrix((4+4im,5-5im)) - -print A.outer(B) -// expect: [ 0 + 8im 10 + 0im ] -// expect: [ 16 + 0im 0 - 20im ] -// expect: [ 0 + 24im 30 + 0im ] diff --git a/newlinalg/test/methods/complexmatrix_qr.morpho b/newlinalg/test/methods/complexmatrix_qr.morpho deleted file mode 100644 index 08eae0f87..000000000 --- a/newlinalg/test/methods/complexmatrix_qr.morpho +++ /dev/null @@ -1,145 +0,0 @@ -// QR Decomposition for ComplexMatrix -import newlinalg - -// Test with a square complex matrix -var A = ComplexMatrix(((1.0+1.0im, 2.0+0.0im, 3.0-1.0im), - (4.0+2.0im, 5.0+1.0im, 6.0+0.0im), - (7.0+0.0im, 8.0-1.0im, 9.0+2.0im))) - -var qr = A.qr() - -print qr -// expect: (, ) - -var Q = qr[0] -var R = qr[1] - -print Q.dimensions() -// expect: (3, 3) - -print R.dimensions() -// expect: (3, 3) - -// Verify Q is unitary: Q^H * Q should be approximately I (conjugate transpose) -var QHQ = Q.conjTranspose() * Q -var I = ComplexMatrix(3,3) -for (var i = 0; i < 3; i = i + 1) { - I[i,i] = 1.0 + 0.0im -} - -print (QHQ - I).norm() < 1e-10 -// expect: true - -// Verify R is upper triangular (check lower triangle is zero) -var R_lower_norm = 0.0 -for (var i = 0; i < 3; i = i + 1) { - for (var j = 0; j < i; j = j + 1) { - var val = R[i,j] - R_lower_norm += val.abs() - } -} -print R_lower_norm < 1e-10 -// expect: true - -// Verify Q * R has the right structure -var QR = Q * R -print QR.dimensions() -// expect: (3, 3) - -// Test with a non-square matrix (tall matrix) -var B = ComplexMatrix(4,2) -B[0,0] = 1.0 + 1.0im -B[0,1] = 2.0 + 0.0im -B[1,0] = 3.0 - 1.0im -B[1,1] = 4.0 + 2.0im -B[2,0] = 5.0 + 0.0im -B[2,1] = 6.0 - 1.0im -B[3,0] = 7.0 + 1.0im -B[3,1] = 8.0 + 0.0im - -var qr2 = B.qr() -var Q2 = qr2[0] -var R2 = qr2[1] - -print Q2.dimensions() -// expect: (4, 4) - -print R2.dimensions() -// expect: (4, 2) - -// Verify Q2 first 2 columns are orthonormal (unitary) -// For tall matrices, only the first min(m,n) columns from ZUNGQR are orthonormal -// The remaining columns are zero -var Q2_col0 = Q2.column(0) -var Q2_col1 = Q2.column(1) -// Check norms -var norm0 = Q2_col0.norm() -var norm1 = Q2_col1.norm() - -print abs(norm0-1) < 1e-7 // expect: true -print abs(norm1-1) < 1e-7 // expect: true - -// Check orthogonality: inner product should be close to zero -var inner01 = Q2_col0.inner(Q2_col1) -var inner01_mag = inner01.abs() -print inner01_mag < 1e-10 -// expect: true - -// Verify R2 is upper triangular -var R2_lower_norm = 0.0 -for (var i = 0; i < 4; i = i + 1) { - for (var j = 0; j < 2; j = j + 1) { - if (i > j) { - var val = R2[i,j] - R2_lower_norm = val.abs() - } - } -} -print R2_lower_norm < 1e-10 -// expect: true - -// Test with a wide matrix -var C = ComplexMatrix(2,4) -C[0,0] = 1.0 + 1.0im -C[0,1] = 2.0 + 0.0im -C[0,2] = 3.0 - 1.0im -C[0,3] = 4.0 + 2.0im -C[1,0] = 5.0 + 0.0im -C[1,1] = 6.0 - 1.0im -C[1,2] = 7.0 + 1.0im -C[1,3] = 8.0 + 0.0im - -var qr3 = C.qr() -var Q3 = qr3[0] -var R3 = qr3[1] - -print Q3.dimensions() -// expect: (2, 2) - -print R3.dimensions() -// expect: (2, 4) - -// Verify Q3 is unitary -var Q3HQ3 = Q3.conjTranspose() * Q3 -var I2 = ComplexMatrix(2,2) -for (var i = 0; i < 2; i = i + 1) { - I2[i,i] = 1.0 + 0.0im -} -print (Q3HQ3 - I2).norm() < 1e-10 -// expect: true - -// Test with real-valued complex matrix (should work like real matrix) -var D = ComplexMatrix(((1.0+0.0im, 0.0+0.0im), - (0.0+0.0im, 2.0+0.0im))) -var qr4 = D.qr() -var Q4 = qr4[0] -var R4 = qr4[1] - -// Verify Q4 is unitary -var Q4HQ4 = Q4.conjTranspose() * Q4 -var I2b = ComplexMatrix(2,2) -for (var i = 0; i < 2; i = i + 1) { - I2b[i,i] = 1.0 + 0.0im -} -print (Q4HQ4 - I2b).norm() < 1e-10 -// expect: true diff --git a/newlinalg/test/methods/complexmatrix_real.morpho b/newlinalg/test/methods/complexmatrix_real.morpho deleted file mode 100644 index 1c508280e..000000000 --- a/newlinalg/test/methods/complexmatrix_real.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Real part of a ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+4im -A[0,1]=2+3im -A[1,0]=3+2im -A[1,1]=4+1im - -print A.real() -// expect: [ 1 2 ] -// expect: [ 3 4 ] diff --git a/newlinalg/test/methods/complexmatrix_reshape.morpho b/newlinalg/test/methods/complexmatrix_reshape.morpho deleted file mode 100644 index 5f60e09a2..000000000 --- a/newlinalg/test/methods/complexmatrix_reshape.morpho +++ /dev/null @@ -1,19 +0,0 @@ -// Reshape ComplexMatrix -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+1im -A[1,0]=2+2im -A[0,1]=3+3im -A[1,1]=4+4im -print A -// expect: [ 1 + 1im 3 + 3im ] -// expect: [ 2 + 2im 4 + 4im ] - -A.reshape(4,1) -print A -// expect: [ 1 + 1im ] -// expect: [ 2 + 2im ] -// expect: [ 3 + 3im ] -// expect: [ 4 + 4im ] - diff --git a/newlinalg/test/methods/complexmatrix_roll.morpho b/newlinalg/test/methods/complexmatrix_roll.morpho deleted file mode 100644 index e3cf12ca4..000000000 --- a/newlinalg/test/methods/complexmatrix_roll.morpho +++ /dev/null @@ -1,51 +0,0 @@ -// Roll contents of a matrix -import newlinalg - -var A = ComplexMatrix(3,3) -var k=0 -for (i in 0...3) for (j in 0...3) { A[i,j] = Complex(k,k); k+=1 } - -print A -// expect: [ 0 + 0im 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im 5 + 5im ] -// expect: [ 6 + 6im 7 + 7im 8 + 8im ] - -print A.roll(1,1) -// expect: [ 2 + 2im 0 + 0im 1 + 1im ] -// expect: [ 5 + 5im 3 + 3im 4 + 4im ] -// expect: [ 8 + 8im 6 + 6im 7 + 7im ] - -print A.roll(2,1) -// expect: [ 1 + 1im 2 + 2im 0 + 0im ] -// expect: [ 4 + 4im 5 + 5im 3 + 3im ] -// expect: [ 7 + 7im 8 + 8im 6 + 6im ] - -print A.roll(3,1) -// expect: [ 0 + 0im 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im 5 + 5im ] -// expect: [ 6 + 6im 7 + 7im 8 + 8im ] - -print A.roll(4,1) -// expect: [ 2 + 2im 0 + 0im 1 + 1im ] -// expect: [ 5 + 5im 3 + 3im 4 + 4im ] -// expect: [ 8 + 8im 6 + 6im 7 + 7im ] - -print A.roll(-1,0) -// expect: [ 3 + 3im 4 + 4im 5 + 5im ] -// expect: [ 6 + 6im 7 + 7im 8 + 8im ] -// expect: [ 0 + 0im 1 + 1im 2 + 2im ] - -print A.roll(-2,0) -// expect: [ 6 + 6im 7 + 7im 8 + 8im ] -// expect: [ 0 + 0im 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im 5 + 5im ] - -print A.roll(-3,0) -// expect: [ 0 + 0im 1 + 1im 2 + 2im ] -// expect: [ 3 + 3im 4 + 4im 5 + 5im ] -// expect: [ 6 + 6im 7 + 7im 8 + 8im ] - -print A.roll(-4,0) -// expect: [ 3 + 3im 4 + 4im 5 + 5im ] -// expect: [ 6 + 6im 7 + 7im 8 + 8im ] -// expect: [ 0 + 0im 1 + 1im 2 + 2im ] diff --git a/newlinalg/test/methods/complexmatrix_roll_negative.morpho b/newlinalg/test/methods/complexmatrix_roll_negative.morpho deleted file mode 100644 index 3310c4eb9..000000000 --- a/newlinalg/test/methods/complexmatrix_roll_negative.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Negative roll values for ComplexMatrix - -import newlinalg - -var A = ComplexMatrix(3,1) -A[0,0]=1+1im -A[1,0]=2+2im -A[2,0]=3+3im - -print A.roll(-1) -// expect: [ 2 + 2im ] -// expect: [ 3 + 3im ] -// expect: [ 1 + 1im ] - diff --git a/newlinalg/test/methods/complexmatrix_sum.morpho b/newlinalg/test/methods/complexmatrix_sum.morpho deleted file mode 100644 index 3354d422b..000000000 --- a/newlinalg/test/methods/complexmatrix_sum.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// Sum -import newlinalg - -var A = ComplexMatrix(3,2) -A[0,0]=1+im -A[0,1]=2+2im -A[1,0]=3+3im -A[1,1]=4+4im -A[2,0]=5+5im -A[2,1]=6+6im - -print A.sum() -// expect: 21 + 21im diff --git a/newlinalg/test/methods/complexmatrix_svd.morpho b/newlinalg/test/methods/complexmatrix_svd.morpho deleted file mode 100644 index 68aa33688..000000000 --- a/newlinalg/test/methods/complexmatrix_svd.morpho +++ /dev/null @@ -1,22 +0,0 @@ -// Singular Value Decomposition -import newlinalg - -var A = ComplexMatrix(((1+1im,0+0im),(0+0im,2+2im))) - -var svd = A.svd() - -// Test reconstruction: U * S * V^T should approximately equal A -var U = svd[0] -var S = svd[1] -var V = svd[2] - -// Create diagonal matrix from singular values -var Sdiag = ComplexMatrix(2,2) -Sdiag[0,0] = S[0] -Sdiag[1,1] = S[1] - -var VT = V.transpose() -var reconstructed = U * Sdiag * VT - -print (reconstructed - A).norm() < 1e-10 -// expect: true diff --git a/newlinalg/test/methods/complexmatrix_trace.morpho b/newlinalg/test/methods/complexmatrix_trace.morpho deleted file mode 100644 index 694a60aa3..000000000 --- a/newlinalg/test/methods/complexmatrix_trace.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Inverse -import newlinalg - -var A = ComplexMatrix(2,2) -A[0,0]=1+4im -A[0,1]=2+3im -A[1,0]=3+2im -A[1,1]=4+1im - -print A.trace() -// expect: 5 + 5im diff --git a/newlinalg/test/methods/complexmatrix_transpose.morpho b/newlinalg/test/methods/complexmatrix_transpose.morpho deleted file mode 100644 index a6815d88e..000000000 --- a/newlinalg/test/methods/complexmatrix_transpose.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Inverse -import newlinalg - -var A = ComplexMatrix(3,2) -A[0,0]=1+1im -A[0,1]=2+2im -A[1,0]=3+3im -A[1,1]=4+4im -A[2,0]=5+5im -A[2,1]=6+6im - -print A.transpose() -// expect: [ 1 + 1im 3 + 3im 5 + 5im ] -// expect: [ 2 + 2im 4 + 4im 6 + 6im ] diff --git a/newlinalg/test/methods/matrix_count.morpho b/newlinalg/test/methods/matrix_count.morpho deleted file mode 100644 index b5a8c2fa5..000000000 --- a/newlinalg/test/methods/matrix_count.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Count elements in Matrix -import newlinalg - -var A = Matrix(2,3) -A[0,0]=1 -A[0,1]=2 -A[0,2]=3 -A[1,0]=4 -A[1,1]=5 -A[1,2]=6 - -print A.count() -// expect: 6 - diff --git a/newlinalg/test/methods/matrix_dimensions.morpho b/newlinalg/test/methods/matrix_dimensions.morpho deleted file mode 100644 index 4712051e9..000000000 --- a/newlinalg/test/methods/matrix_dimensions.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Get dimensions of Matrix -import newlinalg - -var A = Matrix(2,3) -print A.dimensions() -// expect: (2, 3) - -var a = Matrix([[0.8, -0.4], [0.4, 0.8]]) -print a.dimensions() -// expect: (2, 2) diff --git a/newlinalg/test/methods/matrix_eigensystem.morpho b/newlinalg/test/methods/matrix_eigensystem.morpho deleted file mode 100644 index 1b2cbff74..000000000 --- a/newlinalg/test/methods/matrix_eigensystem.morpho +++ /dev/null @@ -1,20 +0,0 @@ -// Eigenvalues and eigenvectors -import newlinalg - -var A = Matrix(2,2) -A[0,0]=0 -A[0,1]=1 -A[1,0]=1 -A[1,1]=0 - -var es=A.eigensystem() - -print es -// expect: ((1, -1), ) - -print es[0] -// expect: (1, -1) - -print es[1].format("%.2g") -// expect: [ 0.71 -0.71 ] -// expect: [ 0.71 0.71 ] diff --git a/newlinalg/test/methods/matrix_eigenvalues.morpho b/newlinalg/test/methods/matrix_eigenvalues.morpho deleted file mode 100644 index 0ec4f41c9..000000000 --- a/newlinalg/test/methods/matrix_eigenvalues.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Eigenvalues -import newlinalg - -var A = Matrix(2,2) -A[0,0]=0 -A[0,1]=1 -A[1,0]=1 -A[1,1]=0 - -print A.eigenvalues() -// expect: (1, -1) diff --git a/newlinalg/test/methods/matrix_enumerate.morpho b/newlinalg/test/methods/matrix_enumerate.morpho deleted file mode 100644 index a6f7cf7a1..000000000 --- a/newlinalg/test/methods/matrix_enumerate.morpho +++ /dev/null @@ -1,15 +0,0 @@ -// Enumerate elements of a matrix - -import newlinalg - -var A = Matrix(2,2) -A[0,0] = 1 -A[1,0] = 2 -A[0,1] = 3 -A[1,1] = 4 - -for (x in A) print x -// expect: 1 -// expect: 2 -// expect: 3 -// expect: 4 diff --git a/newlinalg/test/methods/matrix_format.morpho b/newlinalg/test/methods/matrix_format.morpho deleted file mode 100644 index 06495b223..000000000 --- a/newlinalg/test/methods/matrix_format.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// Format -import newlinalg -import constants - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=Pi/2 -A[1,0]=Pi/2 -A[1,1]=-1.5 - -print A.format("%5.2f") -// expect: [ 1.00 1.57 ] -// expect: [ 1.57 -1.50 ] diff --git a/newlinalg/test/methods/matrix_inner.morpho b/newlinalg/test/methods/matrix_inner.morpho deleted file mode 100644 index c5539cd96..000000000 --- a/newlinalg/test/methods/matrix_inner.morpho +++ /dev/null @@ -1,18 +0,0 @@ -// Inner product of XMatrices -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -var B = Matrix(2,2) -B[0,0]=1 -B[0,1]=0 -B[1,0]=0 -B[1,1]=1 - -print A.inner(B) -// expect: 5 - diff --git a/newlinalg/test/methods/matrix_inverse.morpho b/newlinalg/test/methods/matrix_inverse.morpho deleted file mode 100644 index 2f269735f..000000000 --- a/newlinalg/test/methods/matrix_inverse.morpho +++ /dev/null @@ -1,12 +0,0 @@ -// Inverse -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -print A.inverse() -// expect: [ -2 1 ] -// expect: [ 1.5 -0.5 ] diff --git a/newlinalg/test/methods/matrix_inverse_singular.morpho b/newlinalg/test/methods/matrix_inverse_singular.morpho deleted file mode 100644 index 7428e58fd..000000000 --- a/newlinalg/test/methods/matrix_inverse_singular.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Inverse -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=2 -A[1,1]=4 - -print A.inverse() -// expect error 'LnAlgMtrxSnglr' diff --git a/newlinalg/test/methods/matrix_norm.morpho b/newlinalg/test/methods/matrix_norm.morpho deleted file mode 100644 index 179158c83..000000000 --- a/newlinalg/test/methods/matrix_norm.morpho +++ /dev/null @@ -1,21 +0,0 @@ -// Norm of an Matrix -import newlinalg -import constants - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=-2 -A[1,0]=3 -A[1,1]=-4 - -print A.norm(1) -// expect: 6 - -print A.norm(Inf) -// expect: 7 - -print abs(A.norm() - sqrt(30)) < 1e-15 -// expect: true - -print A.norm(5) -// expect error 'LnAlgMtrxNrmArgs' \ No newline at end of file diff --git a/newlinalg/test/methods/matrix_outer.morpho b/newlinalg/test/methods/matrix_outer.morpho deleted file mode 100644 index a190ed5dd..000000000 --- a/newlinalg/test/methods/matrix_outer.morpho +++ /dev/null @@ -1,10 +0,0 @@ -// Outer product of two vectors -import newlinalg - -var A = Matrix((1,2,3)) -var B = Matrix((4,5)) - -print A.outer(B) -// expect: [ 4 5 ] -// expect: [ 8 10 ] -// expect: [ 12 15 ] diff --git a/newlinalg/test/methods/matrix_qr.morpho b/newlinalg/test/methods/matrix_qr.morpho deleted file mode 100644 index 50e1abcb5..000000000 --- a/newlinalg/test/methods/matrix_qr.morpho +++ /dev/null @@ -1,135 +0,0 @@ -// QR Decomposition -import newlinalg - -// Test with a square matrix (this one is singular, so R will have a zero on the diagonal) -var A = Matrix(((1.0,2.0,3.0),(4.0,5.0,6.0),(7.0,8.0,9.0))) - -var qr = A.qr() - -print qr -// expect: (, ) - -var Q = qr[0] -var R = qr[1] - -print Q.dimensions() -// expect: (3, 3) - -print R.dimensions() -// expect: (3, 3) - -// Verify Q is orthogonal: Q^T * Q should be approximately I -var QTQ = Q.transpose() * Q -var I = IdentityMatrix(3) - -print (QTQ - I).norm() < 1e-10 -// expect: true - -// Verify R is upper triangular (check lower triangle is zero) -var R_lower_norm = 0.0 -for (var i = 0; i < 3; i = i + 1) { - for (var j = 0; j < i; j = j + 1) { - R_lower_norm = R_lower_norm + R[i,j]*R[i,j] - } -} -print R_lower_norm < 1e-10 -// expect: true - -// Check R's diagonal - since A is singular, one diagonal element should be (close to) zero -// This indicates the matrix has rank 2 (not full rank) -print abs(R[2,2]) < 1e-8 -// expect: true - -// Verify Q * R reconstruction -var QR = Q * R -print (QR - A).norm() < 1e-10 -// expect: true - -// Test with a non-square matrix (tall matrix) -var B = Matrix(4,2) -B[0,0] = 1.0 -B[0,1] = 2.0 -B[1,0] = 3.0 -B[1,1] = 4.0 -B[2,0] = 5.0 -B[2,1] = 6.0 -B[3,0] = 7.0 -B[3,1] = 8.0 - -var qr2 = B.qr() -var Q2 = qr2[0] -var R2 = qr2[1] - -print Q2.dimensions() -// expect: (4, 4) - -print R2.dimensions() -// expect: (4, 2) - -// Verify Q2 first 2 columns are orthonormal -// For tall matrices, only the first min(m,n) columns from DORGQR are orthonormal -// The remaining columns are zero -var Q2_col0 = Q2.column(0) -var Q2_col1 = Q2.column(1) -// Check norms -print Q2_col0.norm() < 1.0 + 1e-10 and Q2_col0.norm() > 1.0 - 1e-10 -// expect: true -print Q2_col1.norm() < 1.0 + 1e-10 and Q2_col1.norm() > 1.0 - 1e-10 -// expect: true -// Check orthogonality: dot product should be close to zero -var dot01 = Q2_col0.inner(Q2_col1) -print dot01 < 1e-10 and dot01 > -1e-10 -// expect: true - -// Verify R2 is upper triangular -var R2_lower_norm = 0.0 -for (var i = 0; i < 4; i = i + 1) { - for (var j = 0; j < 2; j = j + 1) { - if (i > j) { - R2_lower_norm = R2_lower_norm + R2[i,j]*R2[i,j] - } - } -} -print R2_lower_norm < 1e-10 -// expect: true - -// Test with a wide matrix -var C = Matrix(2,4) -C[0,0] = 1.0 -C[0,1] = 2.0 -C[0,2] = 3.0 -C[0,3] = 4.0 -C[1,0] = 5.0 -C[1,1] = 6.0 -C[1,2] = 7.0 -C[1,3] = 8.0 - -var qr3 = C.qr() -var Q3 = qr3[0] -var R3 = qr3[1] - -print Q3.dimensions() -// expect: (2, 2) - -print R3.dimensions() -// expect: (2, 4) - -// Verify Q3 is orthogonal -var Q3TQ3 = Q3.transpose() * Q3 -var I2 = IdentityMatrix(2) -print (Q3TQ3 - I2).norm() < 1e-10 -// expect: true - -// Test with identity matrix -var I3 = IdentityMatrix(3) -var qr4 = I3.qr() -var Q4 = qr4[0] -var R4 = qr4[1] - -// Q should be close to identity -print (Q4 - I3).norm() < 1e-10 -// expect: true - -// R should be close to identity -print (R4 - I3).norm() < 1e-10 -// expect: true diff --git a/newlinalg/test/methods/matrix_reshape.morpho b/newlinalg/test/methods/matrix_reshape.morpho deleted file mode 100644 index f4825fd95..000000000 --- a/newlinalg/test/methods/matrix_reshape.morpho +++ /dev/null @@ -1,19 +0,0 @@ -// Reshape Matrix -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[1,0]=2 -A[0,1]=3 -A[1,1]=4 -print A -// expect: [ 1 3 ] -// expect: [ 2 4 ] - -A.reshape(4,1) -print A -// expect: [ 1 ] -// expect: [ 2 ] -// expect: [ 3 ] -// expect: [ 4 ] - diff --git a/newlinalg/test/methods/matrix_roll.morpho b/newlinalg/test/methods/matrix_roll.morpho deleted file mode 100644 index 379cb4268..000000000 --- a/newlinalg/test/methods/matrix_roll.morpho +++ /dev/null @@ -1,51 +0,0 @@ -// Roll contents of a matrix -import newlinalg - -var A = Matrix(3,3) -var k=0 -for (i in 0...3) for (j in 0...3) { A[i,j] = k; k+=1 } - -print A -// expect: [ 0 1 2 ] -// expect: [ 3 4 5 ] -// expect: [ 6 7 8 ] - -print A.roll(1,1) -// expect: [ 2 0 1 ] -// expect: [ 5 3 4 ] -// expect: [ 8 6 7 ] - -print A.roll(2,1) -// expect: [ 1 2 0 ] -// expect: [ 4 5 3 ] -// expect: [ 7 8 6 ] - -print A.roll(3,1) -// expect: [ 0 1 2 ] -// expect: [ 3 4 5 ] -// expect: [ 6 7 8 ] - -print A.roll(4,1) -// expect: [ 2 0 1 ] -// expect: [ 5 3 4 ] -// expect: [ 8 6 7 ] - -print A.roll(-1,0) -// expect: [ 3 4 5 ] -// expect: [ 6 7 8 ] -// expect: [ 0 1 2 ] - -print A.roll(-2,0) -// expect: [ 6 7 8 ] -// expect: [ 0 1 2 ] -// expect: [ 3 4 5 ] - -print A.roll(-3,0) -// expect: [ 0 1 2 ] -// expect: [ 3 4 5 ] -// expect: [ 6 7 8 ] - -print A.roll(-4,0) -// expect: [ 3 4 5 ] -// expect: [ 6 7 8 ] -// expect: [ 0 1 2 ] diff --git a/newlinalg/test/methods/matrix_sum.morpho b/newlinalg/test/methods/matrix_sum.morpho deleted file mode 100644 index 8f2e4fd1d..000000000 --- a/newlinalg/test/methods/matrix_sum.morpho +++ /dev/null @@ -1,13 +0,0 @@ -// Sum -import newlinalg - -var A = Matrix(3,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 -A[2,0]=5 -A[2,1]=6 - -print A.sum() -// expect: 21 diff --git a/newlinalg/test/methods/matrix_svd.morpho b/newlinalg/test/methods/matrix_svd.morpho deleted file mode 100644 index 16bea32c4..000000000 --- a/newlinalg/test/methods/matrix_svd.morpho +++ /dev/null @@ -1,54 +0,0 @@ -// Singular Value Decomposition -import newlinalg - -var A = Matrix(((1,0),(0,2))) - -var svd = A.svd() - -print svd -// expect: (, (2, 1), ) - -print (svd[0] - Matrix(((0,1),(1,0)))).norm() < 1e-10 -// expect: true - -print svd[1] -// expect: (2, 1) - -print (svd[2] - Matrix(((0,1),(1,0)))).norm() < 1e-10 -// expect: true - -// Test reconstruction: U * S * V^T should approximately equal A -var U = svd[0] -var S = svd[1] -var V = svd[2] - -// Create diagonal matrix from singular values -var Sdiag = Matrix(2,2) -Sdiag[0,0] = S[0] -Sdiag[1,1] = S[1] - -var VT = V.transpose() -var reconstructed = U * Sdiag * VT - -print (reconstructed - A).norm() < 1e-10 -// expect: true - -// Test with a non-square matrix -var B = Matrix(3,2) -B[0,0]=1 -B[0,1]=0 -B[1,0]=0 -B[1,1]=2 -B[2,0]=0 -B[2,1]=0 - -var svd2 = B.svd() - -print svd2[0].dimensions() -// expect: (3, 3) - -print svd2[1] -// expect: (2, 1) - -print svd2[2].dimensions() -// expect: (2, 2) diff --git a/newlinalg/test/methods/matrix_trace.morpho b/newlinalg/test/methods/matrix_trace.morpho deleted file mode 100644 index 5ee330b9f..000000000 --- a/newlinalg/test/methods/matrix_trace.morpho +++ /dev/null @@ -1,11 +0,0 @@ -// Inverse -import newlinalg - -var A = Matrix(2,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 - -print A.trace() -// expect: 5 diff --git a/newlinalg/test/methods/matrix_transpose.morpho b/newlinalg/test/methods/matrix_transpose.morpho deleted file mode 100644 index a04547860..000000000 --- a/newlinalg/test/methods/matrix_transpose.morpho +++ /dev/null @@ -1,14 +0,0 @@ -// Inverse -import newlinalg - -var A = Matrix(3,2) -A[0,0]=1 -A[0,1]=2 -A[1,0]=3 -A[1,1]=4 -A[2,0]=5 -A[2,1]=6 - -print A.transpose() -// expect: [ 1 3 5 ] -// expect: [ 2 4 6 ] \ No newline at end of file diff --git a/newlinalg/test/test.py b/newlinalg/test/test.py deleted file mode 100755 index 7fdaad273..000000000 --- a/newlinalg/test/test.py +++ /dev/null @@ -1,212 +0,0 @@ -#!/usr/bin/env python3 -# Simple automated testing -# T J Atherton Sept 2020 -# -# Each input file is supplied to a test command, the results -# are piped to a file and the output is compared with expectations -# extracted from the input file. -# Expectations are coded into comments in the input file as follows: - -# import necessary modules -import os, glob, sys -import regex as rx -from functools import reduce -import operator -import colored -from colored import stylize - -# define what command to use to invoke the interpreter -command = 'morpho6' - -# define the file extension to test -ext = 'morpho' - -# We reduce any errors to this value -err = '@error' - -# We reduce any stacktrace lines to this values -stk = '@stacktrace' - -# Removes control characters -def remove_control_characters(str): - return rx.sub(r'\x1b[^m]*m', '', str.rstrip()) - -# Simplify error reports -def simplify_errors(str): - # this monster regex extraxts NAME from error messages of the form error ... 'NAME' - return rx.sub('.*[E|e]rror[ :]*\'([A-z;a-z]*)\'.*', err+'[\\1]', str.rstrip()) - -# Simplify stacktrace -def simplify_stacktrace(str): - return rx.sub(r'.*at line.*', stk, str.rstrip()) - -# Find an expected value -def findvalue(str): - return rx.findall(r'// expect: ?(.*)', str) - -# Find an expected error -def finderror(str): - #return rx.findall(r'\/\/ expect ?(.*) error', str) - return rx.findall(r'.*[E|e]rror[ :].*?(.*)', str) - -# Find an expected error -def iserror(str): - #return rx.findall(r'\/\/ expect ?(.*) error', str) - test=rx.findall(r'@error.*', str) - return len(test)>0 - -# Find an expected error -def isin(str): - #return rx.findall(r'\/\/ expect ?(.*) error', str) - test=rx.findall(r'.*in .*', str) - return len(test)>0 - -# Remove elements from a list -def remove(list, remove_list): - test_list = list - for i in remove_list: - try: - test_list.remove(i) - except ValueError: - pass - return test_list - -# Find what is expected -def findexpected(str): - out = finderror(str) # is it an error? - if (out!=[]): - out = [simplify_errors(str)] # if so, simplify it - else: - out = findvalue(str) # or something else? - return out - -# Works out what we expect from the input file -def getexpect(filepath): - # Load the file - file_object = open(filepath, 'r', encoding="utf8") - lines = file_object.readlines() - file_object.close() - #Find any expected values over all lines - if (lines != []): - out = list(map(findexpected, lines)) - out = reduce(operator.concat, out) - else: - out = [] - return out - -# Gets the output generated -def getoutput(filepath): - # Load the file - file_object = open(filepath, 'r', encoding="utf8") - lines = file_object.readlines() - file_object.close() - # remove all control characters - lines = list(map(remove_control_characters, lines)) - # Convert errors to our universal error code - lines = list(map(simplify_errors, lines)) - # Identify stack trace lines - lines = list(map(simplify_stacktrace, lines)) - for i in range(len(lines)-1): - if (iserror(lines[i])): - if (isin(lines[i+1])): - lines[i+1]=stk - # and remove them - return list(filter(lambda x: x!=stk, lines)) - -# Test a file -def test(file,testLog,CI): - ret = 0 - if not CI: - print(file+":", end=" ") - - # Create a temporary file in the same directory - tmp = file + '.out' - - #Get the expected output - expected=getexpect(file) - - # Run the test - os.system(command + ' ' +file + ' > ' + tmp) - - # If we produced output - if os.path.exists(tmp): - # Get the output - out=getoutput(tmp) - - # Was it expected? - if(expected==out): - if not CI: - print(stylize("Passed",colored.fg("green"))) - ret = 1 - else: - if not CI: - print(stylize("Failed",colored.fg("red"))) - print(" Expected: ", expected) - print(" Output: ", out) - else: - print("\n::error file = {",file,"}::{",file," Failed}") - - - #also print to the test log - print(file+":", end=" ",file = testLog) - print("Failed", file = testLog) - - if len(out) == len(expected): - failedTests = list(i for i in range(len(out)) if expected[i] != out[i]) - print("Tests " + str(failedTests) + " did not match expected results.", file = testLog) - for testNum in failedTests: - print("Test "+str(testNum), file = testLog) - print(" Expected: ", expected[testNum], file = testLog) - print(" Output: ", out[testNum], file = testLog) - else: - print(" Expected: ", expected, file = testLog) - print(" Output: ", out, file = testLog) - - - print("\n",file = testLog) - - - # Delete the temporary file - os.remove(tmp) - - return ret - -print('--Begin testing---------------------') - -# open a test log -# write failures to log -success=0 # number of successful tests -total=0 # total number of tests - -# look for a command line arguement that says -# this is being run for continous integration -CI = False -# Also look for a command line argument that says this is being run with multiple threads -MT = False -for arg in sys.argv: - if arg == '-c': # if the argument is -c, then we are running in CI mode - CI = True - if arg == '-m': # if the argument is -m, then we are running in multi-thread mode - MT = True - -failedTestsFileName = "FailedTests.txt" -if MT: - failedTestsFileName = "FailedTestsMultiThreaded.txt" - command += " -w4" - print("Running tests with 4 threads") - -files=glob.glob('**/**.'+ext, recursive=True) -with open(failedTestsFileName,'w', encoding="utf8") as testLog: - - for f in files: - # print(f) - success+=test(f,testLog,CI) - total+=1 - -# if (not CI) and (not success == total): -# os.system("emacs FailedTests.txt &") - -print('--End testing-----------------------') -print(success, 'out of', total, 'tests passed.') -if CI and success Date: Mon, 26 Jan 2026 14:09:06 -0500 Subject: [PATCH 254/473] Update LAPACKE path for linux build --- src/linalg/complexmatrix.c | 99 ++++++++++++++++++++------------------ src/linalg/matrix.c | 20 ++++---- src/linalg/matrix.h | 8 +++ src/support/platform.c | 34 +++++++------ 4 files changed, 88 insertions(+), 73 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index a24b96553..9d63416c3 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -57,10 +57,10 @@ static double _normfn(objectmatrix *a, matrix_norm_t nrm) { int nrows=a->nrows, ncols=a->ncols; #ifdef MORPHO_LINALG_USE_LAPACKE - return LAPACKE_zlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); + return LAPACKE_zlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, (linalg_complexdouble_t *) a->elements, a->nrows); #else double work[a->nrows]; - return zlange_(&cnrm, &nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, work); + return zlange_(&cnrm, &nrows, &ncols, (linalg_complexdouble_t *) a->elements, &nrows, work); #endif } @@ -69,10 +69,10 @@ static linalgError_t _solve(objectmatrix *a, objectmatrix *b, int *pivot) { int n=a->nrows, nrhs = b->ncols, info; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, a->elements, n, pivot, b->elements, n); + info=LAPACKE_zgesv(LAPACK_COL_MAJOR, n, nrhs, (linalg_complexdouble_t *) a->elements, n, pivot, (linalg_complexdouble_t *) b->elements, n); #else - zgesv_(&n, &nrhs, (__LAPACK_double_complex *) a->elements, - &n, pivot, (__LAPACK_double_complex *) b->elements, &n, &info); + zgesv_(&n, &nrhs, (linalg_complexdouble_t *) a->elements, + &n, pivot, (linalg_complexdouble_t *) b->elements, &n, &info); #endif return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); @@ -83,10 +83,10 @@ static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec int info, n=a->nrows; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, a->elements, n, (__LAPACK_double_complex *) w, NULL, n, (vec ? vec->elements : NULL), n); + info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, (linalg_complexdouble_t *) a->elements, n, (linalg_complexdouble_t *) w, NULL, n, (linalg_complexdouble_t *) (vec ? vec->elements : NULL), n); #else int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; - zgeev_("N", (vec ? "V" : "N"), &n, (__LAPACK_double_complex *) a->elements, &n, (__LAPACK_double_complex *) w, NULL, &n, (__LAPACK_double_complex *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); + zgeev_("N", (vec ? "V" : "N"), &n, (linalg_complexdouble_t *) a->elements, &n, (linalg_complexdouble_t *) w, NULL, &n, (linalg_complexdouble_t *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); #endif return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS)); @@ -98,35 +98,37 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat int minmn = (m < n) ? m : n; #ifdef MORPHO_LINALG_USE_LAPACKE + double* superb = malloc(minmn * sizeof(double)); info = LAPACKE_zgesvd(LAPACK_COL_MAJOR, (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT m, n, - (__LAPACK_double_complex *) a->elements, m, // input matrix A (overwritten) + (linalg_complexdouble_t *) a->elements, m, // input matrix A (overwritten) s, // singular values (min(m,n)) - (__LAPACK_double_complex *) (u ? u->elements : NULL), m, // U matrix (m×m) - (__LAPACK_double_complex *) (vt ? vt->elements : NULL), n // VT matrix (n×n) + (linalg_complexdouble_t *) (u ? u->elements : NULL), m, // U matrix (m×m) + (linalg_complexdouble_t *) (vt ? vt->elements : NULL), n, // VT matrix (n×n) + superb ); #else int lwork = -1; - __LAPACK_double_complex work_query; + linalg_complexdouble_t work_query; double rwork[5 * minmn]; // rwork needs at least 5*min(m,n) for zgesvd // Query optimal work size zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, - (__LAPACK_double_complex *) a->elements, &m, s, - (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, - (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, + (linalg_complexdouble_t *) a->elements, &m, s, + (linalg_complexdouble_t *) (u ? u->elements : NULL), &m, + (linalg_complexdouble_t *) (vt ? vt->elements : NULL), &n, &work_query, &lwork, rwork, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); lwork = (int)creal(work_query); - __LAPACK_double_complex work[lwork]; + linalg_complexdouble_t work[lwork]; zgesvd_((u ? "A" : "N"), (vt ? "A" : "N"), &m, &n, - (__LAPACK_double_complex *) a->elements, &m, s, - (__LAPACK_double_complex *) (u ? u->elements : NULL), &m, - (__LAPACK_double_complex *) (vt ? vt->elements : NULL), &n, + (linalg_complexdouble_t *) a->elements, &m, s, + (linalg_complexdouble_t *) (u ? u->elements : NULL), &m, + (linalg_complexdouble_t *) (vt ? vt->elements : NULL), &n, work, &lwork, rwork, &info); #endif @@ -137,58 +139,59 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; - __LAPACK_double_complex tau[minmn]; // Compute QR factorization without pivoting: A = Q*R #ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zgeqrf(LAPACK_COL_MAJOR, m, n, (__LAPACK_double_complex *) a->elements, m, tau); + linalg_complexdouble_t tau[minmn]; + info = LAPACKE_zgeqrf(LAPACK_COL_MAJOR, m, n, (linalg_complexdouble_t *) a->elements, m, tau); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else + linalg_complexdouble_t tau[minmn]; int lwork = -1; - __LAPACK_double_complex work_query; + linalg_complexdouble_t work_query; // Query optimal work size for ZGEQRF, which is reused for ZUNGQR - zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, &work_query, &lwork, &info); + zgeqrf_(&m, &n, (linalg_complexdouble_t *) a->elements, &m, tau, &work_query, &lwork, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); int lwork_geqrf = (int) creal(work_query); - __LAPACK_double_complex work[lwork_geqrf]; + linalg_complexdouble_t work[lwork_geqrf]; lwork = lwork_geqrf; // Compute QR factorization without pivoting - zgeqrf_(&m, &n, (__LAPACK_double_complex *) a->elements, &m, tau, work, &lwork, &info); + zgeqrf_(&m, &n, (linalg_complexdouble_t *) a->elements, &m, tau, work, &lwork, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #endif // Extract R (upper triangle of a) into r // Copy entire matrix first then zero out below the diagonal matrix_copy(a, r); - __LAPACK_double_complex *relems = (__LAPACK_double_complex *) r->elements; + linalg_complexdouble_t *relems = (linalg_complexdouble_t *) r->elements; for (int j = 0; j < n && j < m - 1; j++) { - memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(__LAPACK_double_complex)); + memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(linalg_complexdouble_t)); } // Generate Q from reflectors if (q) { // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) // ZGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns - __LAPACK_double_complex *aelems = (__LAPACK_double_complex *) a->elements; - __LAPACK_double_complex *qelems = (__LAPACK_double_complex *) q->elements; + linalg_complexdouble_t *aelems = (linalg_complexdouble_t *) a->elements; + linalg_complexdouble_t *qelems = (linalg_complexdouble_t *) q->elements; for (int j = 0; j < n; j++) { cblas_zcopy(m, &aelems[j * m], 1, &qelems[j * m], 1); } #ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, minmn, minmn, (__LAPACK_double_complex *) q->elements, m, tau); + info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, minmn, minmn, (linalg_complexdouble_t *) q->elements, m, tau); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else lwork = lwork_geqrf; - zungqr_(&m, &minmn, &minmn, (__LAPACK_double_complex *) q->elements, &m, tau, work, &lwork, &info); + zungqr_(&m, &minmn, &minmn, (linalg_complexdouble_t *) q->elements, &m, tau, work, &lwork, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #endif // If Q should be m×m, zero out remaining columns if m > minmn - if (m > minmn) memset(&q->elements[minmn * m * q->nvals], 0, (m - minmn) * m * sizeof(__LAPACK_double_complex)); + if (m > minmn) memset(&q->elements[minmn * m * q->nvals], 0, (m - minmn) * m * sizeof(linalg_complexdouble_t)); } return LINALGERR_OK; @@ -248,7 +251,7 @@ linalgError_t complexmatrix_getelement(objectcomplexmatrix *matrix, MatrixIdx_t static linalgError_t _stridedcopy(objectmatrix *x, objectmatrix *y, int offset) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_dcopy((__LAPACK_int) x->ncols*x->nrows, x->elements+offset, x->nvals, y->elements, y->nvals); + cblas_dcopy((linalg_int_t) x->ncols*x->nrows, x->elements+offset, x->nvals, y->elements, y->nvals); return LINALGERR_OK; } @@ -271,24 +274,24 @@ linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectmatrix *a, objectmat cblas_zgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, a->nrows, b->ncols, a->ncols, - &alpha, (__LAPACK_double_complex *) a->elements, - a->nrows, (__LAPACK_double_complex *) b->elements, b->nrows, - &beta, (__LAPACK_double_complex *) c->elements, c->nrows); + &alpha, (linalg_complexdouble_t *) a->elements, + a->nrows, (linalg_complexdouble_t *) b->elements, b->nrows, + &beta, (linalg_complexdouble_t *) c->elements, c->nrows); return LINALGERR_OK; } /** Scales a matrix x <- scale * x >*/ void complematrix_scale(objectmatrix *a, MorphoComplex scale) { - cblas_zscal(a->nrows * a->ncols, (__LAPACK_double_complex *) &scale, (__LAPACK_double_complex *) a->elements, 1); + cblas_zscal(a->nrows * a->ncols, (linalg_complexdouble_t *) &scale, (linalg_complexdouble_t *) a->elements, 1); } /** Finds the Frobenius inner product of two complex matrices (a, b) = \sum_{i,j} conj(a)_ij * b_ij */ linalgError_t complexmatrix_inner(objectcomplexmatrix *a, objectcomplexmatrix *b, MorphoComplex *out) { if (!(a->ncols==b->ncols && a->nrows==b->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_zdotc_sub(a->nrows * a->ncols, (__LAPACK_double_complex *) a->elements, 1, - (__LAPACK_double_complex *) b->elements, 1, - (__LAPACK_double_complex *) out); + cblas_zdotc_sub(a->nrows * a->ncols, (linalg_complexdouble_t *) a->elements, 1, + (linalg_complexdouble_t *) b->elements, 1, + (linalg_complexdouble_t *) out); return LINALGERR_OK; } @@ -297,9 +300,9 @@ linalgError_t complexmatrix_r1update(MorphoComplex alpha, objectcomplexmatrix *a MatrixIdx_t m=a->nrows*a->ncols, n=b->nrows*b->ncols; if (!(m==c->nrows && n==c->ncols)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_zgeru(CblasColMajor, m, n, (__LAPACK_double_complex *) &alpha, (__LAPACK_double_complex *) a->elements, 1, - (__LAPACK_double_complex *) b->elements, 1, - (__LAPACK_double_complex *) c->elements, c->nrows); + cblas_zgeru(CblasColMajor, m, n, (linalg_complexdouble_t *) &alpha, (linalg_complexdouble_t *) a->elements, 1, + (linalg_complexdouble_t *) b->elements, 1, + (linalg_complexdouble_t *) c->elements, c->nrows); return LINALGERR_OK; } @@ -307,7 +310,7 @@ linalgError_t complexmatrix_r1update(MorphoComplex alpha, objectcomplexmatrix *a linalgError_t complexmatrix_trace(objectcomplexmatrix *a, MorphoComplex *out) { if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; MorphoComplex one = MCBuild(1.0, 0.0); - cblas_zdotu_sub(a->nrows, (__LAPACK_double_complex *) a->elements, a->ncols+1, (__LAPACK_double_complex *) &one, 0, (__LAPACK_double_complex *) out); + cblas_zdotu_sub(a->nrows, (linalg_complexdouble_t *) a->elements, a->ncols+1, (linalg_complexdouble_t *) &one, 0, (linalg_complexdouble_t *) out); return LINALGERR_OK; } @@ -319,17 +322,17 @@ linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { int pivot[nrows]; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgetrf(LAPACK_COL_MAJOR, nrows, ncols, a->elements, nrows, pivot); + info=LAPACKE_zgetrf(LAPACK_COL_MAJOR, nrows, ncols, (linalg_complexdouble_t *) a->elements, nrows, pivot); #else - zgetrf_(&nrows, &ncols, (__LAPACK_double_complex *) a->elements, &nrows, pivot, &info); + zgetrf_(&nrows, &ncols, (linalg_complexdouble_t *) a->elements, &nrows, pivot, &info); #endif if (info!=0) return (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS); #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgetri(LAPACK_COL_MAJOR, nrows, a->elements, nrows, pivot); + info=LAPACKE_zgetri(LAPACK_COL_MAJOR, nrows, (linalg_complexdouble_t *) a->elements, nrows, pivot); #else - int lwork=nrows*ncols; __LAPACK_double_complex work[nrows*ncols]; - zgetri_(&nrows, (__LAPACK_double_complex *) a->elements, &nrows, pivot, work, &lwork, &info); + int lwork=nrows*ncols; linalg_complexdouble_t work[nrows*ncols]; + zgetri_(&nrows, (linalg_complexdouble_t *) a->elements, &nrows, pivot, work, &lwork, &info); #endif return (info==0 ? LINALGERR_OK : (info>0 ? LINALGERR_MATRIX_SINGULAR : LINALGERR_LAPACK_INVLD_ARGS)); diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index acdabae84..044927e06 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -155,6 +155,7 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat int minmn = (m < n) ? m : n; #ifdef MORPHO_LINALG_USE_LAPACKE + double* superb = malloc(minmn * sizeof(double)); info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT @@ -162,7 +163,8 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat a->elements, m, // input matrix A (overwritten) s, // singular values (min(m,n)) (u ? u->elements : NULL), m, // U matrix (m×m) - (vt ? vt->elements : NULL), n // VT matrix (n×n) + (vt ? vt->elements : NULL), n, // VT matrix (n×n) + superb ); #else int lwork = -1; @@ -286,7 +288,7 @@ objectmatrix *matrix_new(MatrixIdx_t nrows, MatrixIdx_t ncols, bool zero) { objectmatrix *matrix_clone(objectmatrix *in) { objectmatrix *new = matrix_newwithtype(in->obj.type, in->nrows, in->ncols, in->nvals, false); - if (new) cblas_dcopy((__LAPACK_int) in->nels, in->elements, 1, new->elements, 1); + if (new) cblas_dcopy((linalg_int_t) in->nels, in->elements, 1, new->elements, 1); return new; } @@ -420,7 +422,7 @@ linalgError_t matrix_getcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b MatrixIdx_t col_idx = col; LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, a->ncols)); if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; - cblas_dcopy((__LAPACK_int) b->nels, a->elements+a->nvals*col_idx*a->nrows, 1, b->elements, 1); + cblas_dcopy((linalg_int_t) b->nels, a->elements+a->nvals*col_idx*a->nrows, 1, b->elements, 1); return LINALGERR_OK; } @@ -429,7 +431,7 @@ linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b MatrixIdx_t col_idx = col; LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, a->ncols)); if (b->nels!=a->nrows*a->nvals) return LINALGERR_INCOMPATIBLE_DIM; - cblas_dcopy((__LAPACK_int) b->nels, b->elements, 1, a->elements+a->nvals*col_idx*a->nrows, 1); + cblas_dcopy((linalg_int_t) b->nels, b->elements, 1, a->elements+a->nvals*col_idx*a->nrows, 1); return LINALGERR_OK; } @@ -437,7 +439,7 @@ linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b linalgError_t matrix_setcolumnptr(objectmatrix *a, MatrixIdx_t col, double *b) { MatrixIdx_t col_idx = col; LINALG_ERRCHECKRETURN(matrix_validateindex(&col_idx, a->ncols)); - cblas_dcopy((__LAPACK_int) a->nrows*a->nvals, b, 1, a->elements+a->nvals*col_idx*a->nrows, 1); + cblas_dcopy((linalg_int_t) a->nrows*a->nvals, b, 1, a->elements+a->nvals*col_idx*a->nrows, 1); return LINALGERR_OK; } @@ -467,7 +469,7 @@ MatrixCount_t matrix_countdof(objectmatrix *a) { linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_daxpy((__LAPACK_int) x->nels, alpha, x->elements, 1, y->elements, 1); + cblas_daxpy((linalg_int_t) x->nels, alpha, x->elements, 1, y->elements, 1); return LINALGERR_OK; } @@ -475,7 +477,7 @@ linalgError_t matrix_axpy(double alpha, objectmatrix *x, objectmatrix *y) { linalgError_t matrix_copy(objectmatrix *x, objectmatrix *y) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - cblas_dcopy((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + cblas_dcopy((linalg_int_t) x->nels, x->elements, 1, y->elements, 1); return LINALGERR_OK; } @@ -496,7 +498,7 @@ linalgError_t matrix_copyat(objectmatrix *a, objectmatrix *out, int row0, int co /** Scales a matrix x <- scale * x >*/ void matrix_scale(objectmatrix *x, double scale) { - cblas_dscal((__LAPACK_int) x->nels, scale, x->elements, 1); + cblas_dscal((linalg_int_t) x->nels, scale, x->elements, 1); } /** Loads the zero matrix a <- 0 */ @@ -593,7 +595,7 @@ linalgError_t matrix_trace(objectmatrix *a, double *out) { linalgError_t matrix_inner(objectmatrix *x, objectmatrix *y, double *out) { if (!(x->ncols==y->ncols && x->nrows==y->nrows)) return LINALGERR_INCOMPATIBLE_DIM; - *out=cblas_ddot((__LAPACK_int) x->nels, x->elements, 1, y->elements, 1); + *out=cblas_ddot((linalg_int_t) x->nels, x->elements, 1, y->elements, 1); return LINALGERR_OK; } diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index 1445fa3ca..d911825c4 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -29,6 +29,14 @@ #define MATRIX_LAPACK_PRESENT #endif +#ifdef MORPHO_LINALG_USE_LAPACKE +typedef lapack_complex_double linalg_complexdouble_t; +typedef lapack_int linalg_int_t; +#else +typedef __LAPACK_double_complex linalg_complexdouble_t; +typedef __LAPACK_int linalg_int_t; +#endif + #include "cmplx.h" #include "list.h" diff --git a/src/support/platform.c b/src/support/platform.c index 35556abf8..7aff7cdae 100644 --- a/src/support/platform.c +++ b/src/support/platform.c @@ -10,6 +10,24 @@ * - APIs for using threads * - Functions that involve time */ +#define _GNU_SOURCE + +#ifdef _WIN32 + #include + #include +#else + #define _POSIX_C_SOURCE 199309L + #include + #include + #include + #include + #include + #include + #include + #include + #include +#endif + #include #include #include @@ -18,22 +36,6 @@ #include "platform.h" #include "error.h" -#ifdef _WIN32 -#include -#include -#else -#define _POSIX_C_SOURCE 199309L -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif - /* ********************************************************************** * Platform name * ********************************************************************** */ From dcfdf7cdc84b4fb4ebd9f01188a186dccd0e2780 Mon Sep 17 00:00:00 2001 From: T J Atherton Date: Mon, 26 Jan 2026 20:36:46 -0500 Subject: [PATCH 255/473] Revised boxing scheme Works on AArch64. --- src/builtin/builtin.c | 4 +- src/datastructures/value.h | 111 +++++++++++++++++++------------------ 2 files changed, 59 insertions(+), 56 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 313bc940e..f1f85d747 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -453,12 +453,12 @@ void builtin_initialize(void) { builtin_setclasstable(&builtin_classtable); // Initialize core object types - objectstringtype=object_addtype(&objectstringdefn); objectclasstype=object_addtype(&objectclassdefn); + objectstringtype=object_addtype(&objectstringdefn); objectbuiltinfunctiontype=object_addtype(&objectbuiltinfunctiondefn); varray__sigparseinit(&sigparseworklist); - + /* Initialize builtin classes and functions */ instance_initialize(); // Must initialize first so that Object exists diff --git a/src/datastructures/value.h b/src/datastructures/value.h index 29dc1abd6..b466fa312 100644 --- a/src/datastructures/value.h +++ b/src/datastructures/value.h @@ -9,6 +9,7 @@ #include #include +#include #include #include "build.h" @@ -23,10 +24,10 @@ typedef struct sobject object; /** Values are the basic data type in morpho: each variable declared with 'var' corresponds to one value. Values can contain the following types: - VALUE_NIL - nil - VALUE_INTEGER - 32 bit integer - VALUE_DOUBLE - - VALUE_BOOL - boolean type + VALUE_NIL - nil + VALUE_INTEGER - 32 bit integer + VALUE_DOUBLE - + VALUE_BOOL - boolean type VALUE_OBJECT - pointer to an object The implementation of a value is intentionally opaque and can be NAN boxed into a 64-bit double or left as a struct. This file therefore defines several kinds of macro to: @@ -41,92 +42,94 @@ typedef struct sobject object; typedef uint64_t value; /** Define macros that enable us to refer to various bits */ -#define SIGN_BIT ((uint64_t) 0x8000000000000000) -#define QNAN ((uint64_t) 0x7ffc000000000000) -#define LOWER_WORD ((uint64_t) 0x00000000ffffffff) +#define QNAN ((uint64_t) 0x7ff8000000000000ull) +#define LOWER_WORD ((uint64_t) 0x00000000ffffffffull) -/** Store the type in bits 47-49 */ -#define TAG_NIL (1ull<<47) // 001 -#define TAG_BOOL (2ull<<47) // 010 -#define TAG_INT (3ull<<47) // 011 -#define TAG_OBJ SIGN_BIT +/** Store the type in bits 48-50 */ +#define TAG_SHIFT 48 +#define TAG_MASK ((uint64_t) (0x7ull << TAG_SHIFT)) // bits 48..50 +#define PAYLOAD_MASK ((uint64_t) 0x0000ffffffffffffull) // bits 0..47 +#define EXP_MASK ((uint64_t) 0x7ff0000000000000ull) // Exponent bits + +#define TAG_NIL ((uint64_t) 1ull << TAG_SHIFT) +#define TAG_BOOL ((uint64_t) 2ull << TAG_SHIFT) +#define TAG_INT ((uint64_t) 3ull << TAG_SHIFT) +#define TAG_OBJ ((uint64_t) 4ull << TAG_SHIFT) + +/** Manipulations */ +#define MORPHO_EXPALLONES(v) ((((uint64_t)(v)) & EXP_MASK) == EXP_MASK) +#define MORPHO_TAGBITS(v) (((uint64_t)(v)) & TAG_MASK) /** Bool values are stored in the lowest bit */ #define TAG_TRUE 1 #define TAG_FALSE 0 -/** Bit mask used to select type bits */ -#define TYPE_BITS (TAG_OBJ | TAG_NIL | TAG_BOOL | TAG_INT) - /** Map VALUE_XXX macros to type bits */ #define VALUE_NIL (TAG_NIL) #define VALUE_INTEGER (TAG_INT) -#define VALUE_DOUBLE () +#define VALUE_DOUBLE ((uint64_t) 0ull) #define VALUE_BOOL (TAG_BOOL) #define VALUE_OBJECT (TAG_OBJ) /** Get the type from a value */ -#define MORPHO_GETTYPE(x) ((x) & TYPE_BITS) - -/** Union to enable conversion of a double to a 64 bit integer */ -typedef union { - uint64_t bits; - double num; -} doubleunion; +#define MORPHO_GETTYPE(x) (MORPHO_ISBOXED(x) ? MORPHO_TAGBITS(x) : VALUE_DOUBLE) -/** Converts a double to a value by type punning */ +/** Converts a double to a value */ static inline value doubletovalue(double num) { - doubleunion data; - data.num = num; - return data.bits; + value bits; + memcpy(&bits, &num, sizeof(bits)); + // If this is NaN or Inf (exp all ones), force tag bits to 0 so it is a genuine float NaN/Inf + if ((bits & EXP_MASK) == EXP_MASK) { + bits &= ~TAG_MASK; + } + return bits; } -/** Converts a value to a double by type punning */ +/** Converts a value to a double */ static inline double valuetodouble(value v) { - doubleunion data; - data.bits = v; - return data.num; + double num; + memcpy(&num, &v, sizeof(num)); + return num; } /** Create a literal */ -#define MORPHO_NIL ((value) (uint64_t) (QNAN | TAG_NIL)) -#define MORPHO_TRUE ((value) (uint64_t) (QNAN | TAG_BOOL | TAG_TRUE)) -#define MORPHO_FALSE ((value) (uint64_t) (QNAN | TAG_BOOL | TAG_FALSE)) +#define MORPHO_NIL ((value) (QNAN | TAG_NIL)) +#define MORPHO_TRUE ((value) (QNAN | TAG_BOOL | TAG_TRUE)) +#define MORPHO_FALSE ((value) (QNAN | TAG_BOOL | TAG_FALSE)) -#define MORPHO_INTEGER(x) ((((uint64_t) (x)) & LOWER_WORD) | QNAN | TAG_INT) +#define MORPHO_BOOL(x) ((x) ? MORPHO_TRUE : MORPHO_FALSE) +#define MORPHO_INTEGER(x) ((value) (QNAN | TAG_INT | (((uint64_t)(x)) & LOWER_WORD))) #define MORPHO_FLOAT(x) doubletovalue(x) -#define MORPHO_BOOL(x) ((x) ? MORPHO_TRUE : MORPHO_FALSE) -#define MORPHO_OBJECT(x) ((value) (TAG_OBJ | QNAN | (uint64_t)(uintptr_t)(x))) +#define MORPHO_OBJECT(x) ((value) (QNAN | TAG_OBJ | (((uint64_t)(uintptr_t)(x)) & PAYLOAD_MASK))) /** Test for the type of a value */ -#define MORPHO_ISNIL(v) ((v) == MORPHO_NIL) -#define MORPHO_ISINTEGER(v) (((v) & (QNAN | TYPE_BITS)) == (QNAN | TAG_INT)) -#define MORPHO_ISFLOAT(v) (((v) & QNAN) != QNAN) -#define MORPHO_ISBOOL(v) (((v) & (QNAN | TYPE_BITS)) == (QNAN | TAG_BOOL)) -#define MORPHO_ISOBJECT(v) \ - (((v) & (QNAN | TYPE_BITS))== (QNAN | TAG_OBJ)) +#define MORPHO_ISNIL(v) ((v) == MORPHO_NIL) +#define MORPHO_ISBOXED(v) (MORPHO_EXPALLONES(v) && (MORPHO_TAGBITS(v) != 0)) +#define MORPHO_ISINTEGER(v) (MORPHO_ISBOXED(v) && (MORPHO_TAGBITS(v) == TAG_INT)) +#define MORPHO_ISBOOL(v) (MORPHO_ISBOXED(v) && (MORPHO_TAGBITS(v) == TAG_BOOL)) +#define MORPHO_ISOBJECT(v) (MORPHO_ISBOXED(v) && (MORPHO_TAGBITS(v) == TAG_OBJ)) +#define MORPHO_ISFLOAT(v) (!MORPHO_ISBOXED(v)) /** Get a value */ -#define MORPHO_GETINTEGERVALUE(v) ((int) ((uint32_t) (v & LOWER_WORD))) +#define MORPHO_GETPAYLOAD(v) (((uint64_t)(v)) & PAYLOAD_MASK) +#define MORPHO_GETINTEGERVALUE(v) ((int32_t) ((uint32_t)((uint64_t)(v) & LOWER_WORD))) #define MORPHO_GETFLOATVALUE(v) valuetodouble(v) #define MORPHO_GETBOOLVALUE(v) ((v) == MORPHO_TRUE) -#define MORPHO_GETOBJECT(v) ((object *) (uintptr_t) ((v) & ~(TAG_OBJ | QNAN))) +#define MORPHO_GETOBJECT(v) ((object *)(uintptr_t)(((uint64_t)(v)) & PAYLOAD_MASK)) static inline bool morpho_ofsametype(value a, value b) { - if (MORPHO_ISFLOAT(a) || MORPHO_ISFLOAT(b)) { - return MORPHO_ISFLOAT(a) && MORPHO_ISFLOAT(b); - } else { - if ((a & TYPE_BITS)==(b & TYPE_BITS)) { - return true; - } - } + bool af = MORPHO_ISFLOAT(a); + bool bf = MORPHO_ISFLOAT(b); + + if (af || bf) return (af && bf); - return false; + /* both are boxed: compare tag field only */ + return ((a & TAG_MASK) == (b & TAG_MASK)); } /** Get a non-object's type field as an integer */ static inline int _getorderedtype(value x) { - return (MORPHO_ISFLOAT(x) ? 0 : (((x) & TYPE_BITS)>>47) & 0x7); + return MORPHO_ISFLOAT(x) ? 0 : (int)(((uint64_t)x & TAG_MASK) >> TAG_SHIFT); } #define MORPHO_GETORDEREDTYPE(x) _getorderedtype(x) From 0255436e0f8d8f52d253872ba7796691c1a1deff Mon Sep 17 00:00:00 2001 From: T J Atherton Date: Mon, 26 Jan 2026 21:13:16 -0500 Subject: [PATCH 256/473] Fix issues with QR decomposition --- src/linalg/complexmatrix.c | 2 +- src/linalg/matrix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 9d63416c3..a773dd805 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -177,7 +177,7 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { // ZGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns linalg_complexdouble_t *aelems = (linalg_complexdouble_t *) a->elements; linalg_complexdouble_t *qelems = (linalg_complexdouble_t *) q->elements; - for (int j = 0; j < n; j++) { + for (int j = 0; j < minmn; j++) { cblas_zcopy(m, &aelems[j * m], 1, &qelems[j * m], 1); } diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 044927e06..557e65845 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -223,7 +223,7 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { if (q) { // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) // DGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns - for (int j = 0; j < n; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); + for (int j = 0; j < minmn; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); #ifdef MORPHO_LINALG_USE_LAPACKE info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, minmn, minmn, q->elements, m, tau); From de6119e1169c215b38be6a2aae27766840fafc99 Mon Sep 17 00:00:00 2001 From: Ivan Pravdin Date: Wed, 4 Feb 2026 15:38:52 -0500 Subject: [PATCH 257/473] Add CMake option to build with profiler Add option to CMakeLists.txt to build with/without Morpho profiler without manually chaging build.h --- CMakeLists.txt | 6 ++++++ src/build.h | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c2c0bc078..53af09297 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ option(MORPHO_GCSTRESSTEST "Stress tests the garbage collector" OFF) option(MORPHO_BUILD_LINALG "Builds with linear algebra" ON) option(MORPHO_BUILD_SPARSE "Builds with sparse matrix support" ON) option(MORPHO_BUILD_GEOMETRY "Builds with geometry library" ON) +option(MORPHO_BUILD_PROFILER "Builds with profiler" OFF) #------------------------------------------------------------------------------- # Process options @@ -53,6 +54,11 @@ if(MORPHO_BUILD_GEOMETRY) target_compile_definitions(morpho PUBLIC MORPHO_INCLUDE_GEOMETRY) endif() +# Build with profiler +if(MORPHO_BUILD_PROFILER) +target_compile_definitions(morpho PUBLIC _DEBUG_PROFILER) +endif() + #------------------------------------------------------------------------------- # BLAS and LAPACK #------------------------------------------------------------------------------- diff --git a/src/build.h b/src/build.h index 4c5f4bb35..7a04d687c 100644 --- a/src/build.h +++ b/src/build.h @@ -185,4 +185,6 @@ //#define MORPHO_OPCODE_USAGE /** @brief Buiild with profile support */ -#define MORPHO_PROFILER +#ifdef _DEBUG_PROFILER + #define MORPHO_PROFILER +#endif From 89d9272b3fd467a0a59d027a0159f01000a64714 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Fri, 13 Feb 2026 19:51:58 -0500 Subject: [PATCH 258/473] Turn profiler on by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53af09297..59a9e1803 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ option(MORPHO_GCSTRESSTEST "Stress tests the garbage collector" OFF) option(MORPHO_BUILD_LINALG "Builds with linear algebra" ON) option(MORPHO_BUILD_SPARSE "Builds with sparse matrix support" ON) option(MORPHO_BUILD_GEOMETRY "Builds with geometry library" ON) -option(MORPHO_BUILD_PROFILER "Builds with profiler" OFF) +option(MORPHO_BUILD_PROFILER "Builds with profiler" ON) #------------------------------------------------------------------------------- # Process options From 6e50e68e3e66b7183272cda2f954e13622a88009 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 13:08:54 -0500 Subject: [PATCH 259/473] Fix System.help() --- src/classes/system.c | 7 ++----- src/support/help.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/classes/system.c b/src/classes/system.c index 2c2705566..d4f822e25 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -140,11 +140,8 @@ value System_help(vm *v, int nargs, value *args) { varray_charinit(&result); if (morpho_help(query, &result)) { - objectstring *new=object_stringfromvarraychar(&result); - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } + out=object_stringfromvarraychar(&result); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); } varray_charclear(&result); diff --git a/src/support/help.c b/src/support/help.c index 8de489ad3..776dba390 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -33,7 +33,11 @@ /* ********************************************************************** * Markdown lexer - * ********************************************************************** */ + * ********************************************************************** + * Token table is sorted for longest-match (e.g. ### before ## before #). + * The preprocessor captures any run of characters that does not match a + * defined token as a single MD_TEXT token. Whitespace is not skipped, + * so newlines and indentation are visible to the parser. */ enum { MD_TEXT, @@ -85,7 +89,9 @@ tokendefn mdtokens[] = { { "___", MD_UNDERSCORE3 , NULL }, { " ", MD_FOURSPACES , NULL }, { "\t", MD_TAB , NULL }, + { "\r\n", MD_NEWLINE , md_lexnewline }, { "\n", MD_NEWLINE , md_lexnewline }, + { "\r", MD_NEWLINE , md_lexnewline }, { "", TOKEN_NONE , NULL } }; @@ -110,7 +116,7 @@ bool md_lexpreprocess(lexer *l, token *tok, error *err) { * Initialize a Markdown lexer * ------------------------------------------------------- */ -void help_initializemdlexer(lexer *l, char *src) { +void help_initializemdlexer(lexer *l, const char *src) { lex_init(l, src, 0); lex_settokendefns(l, mdtokens); lex_setprefn(l, md_lexpreprocess); From 9970ced585090178e122b1cc2f314a89058ce33a Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:53:32 -0500 Subject: [PATCH 260/473] Support italic text --- src/support/help.c | 82 ++++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 776dba390..8b8372040 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -142,10 +142,19 @@ bool md_parsebold(parser *p, void *out) { return true; } +/** Parses italic: called after consuming opening * or _; consumes TEXT then closing delimiter (same as bold). */ +bool md_parseitalic(parser *p, void *out) { + tokentype delim = p->previous.type; /* MD_ASTERISK or MD_UNDERSCORE */ + while (parse_checktokenadvance(p, MD_TEXT)); + return parse_checktokenadvance(p, delim); +} + parserule md_rules[] = { - PARSERULE_PREFIX(MD_ASTERISK2, md_parsebold ), - PARSERULE_PREFIX(MD_UNDERSCORE2, md_parsebold ), - PARSERULE_PREFIX(MD_BACKTICK, md_parseinlinecode ), + PARSERULE_PREFIX(MD_ASTERISK, md_parseitalic ), + PARSERULE_PREFIX(MD_UNDERSCORE, md_parseitalic ), + PARSERULE_PREFIX(MD_ASTERISK2, md_parsebold ), + PARSERULE_PREFIX(MD_UNDERSCORE2, md_parsebold ), + PARSERULE_PREFIX(MD_BACKTICK, md_parseinlinecode ), PARSERULE_UNUSED(TOKEN_NONE) }; @@ -153,15 +162,18 @@ parserule md_rules[] = { * Markdown parse rules * ------------------------------------------------------- */ -/** Check if a token type is a 'textual' token */ -tokentype _inlinetokens[] = { MD_TEXT, MD_COLON, MD_BACKTICK, MD_LEFTPAREN, MD_RIGHTPAREN }; +/** Check if a token type is a 'textual' token (incl. * _ for italic, ** __ for bold, ` for code) */ +tokentype _inlinetokens[] = { + MD_TEXT, MD_COLON, MD_BACKTICK, MD_LEFTPAREN, MD_RIGHTPAREN, + MD_ASTERISK, MD_UNDERSCORE, MD_ASTERISK2, MD_UNDERSCORE2 +}; int _ninlinetokens = sizeof(_inlinetokens)/sizeof(tokentype); bool md_checktexttoken(parser *p) { return parse_checktokenmulti(p, _ninlinetokens, _inlinetokens); } -/** Parses text writen in markdown; stops at a non-textual token */ +/** Parses text written in markdown; stops at a non-textual token. Line ends with NEWLINE or EOF. */ bool md_parsetext(parser *p, void *out) { while (md_checktexttoken(p)) { parse_advance(p); @@ -170,29 +182,29 @@ bool md_parsetext(parser *p, void *out) { if (!rule->prefix(p, out)) return false; } } - - parse_checktokenadvance(p, MD_NEWLINE); - - return true; + /* Line terminator: newline or end of file */ + if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); + if (parse_checktoken(p, MD_EOF)) return true; + return false; } -/** Parses a markdown header */ +/** Parses a markdown header (title then newline or EOF). */ bool md_parseheader(parser *p, void *out) { PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); - parse_checktokenadvance(p, MD_NEWLINE); - return true; + if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); + if (parse_checktoken(p, MD_EOF)) return true; + return false; } -/** Parses markdown code. */ +/** Parses markdown code block (indented lines until newline or EOF). */ bool md_parsecode(parser *p, void *out) { while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) { parse_advance(p); } - - parse_checktokenadvance(p, MD_NEWLINE); - - return true; + if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); + if (parse_checktoken(p, MD_EOF)) return true; + return false; } /** Parses a markdown list. */ @@ -200,25 +212,21 @@ bool md_parselist(parser *p, void *out) { return md_parsetext(p, out); } -bool md_parseurl(parser *p, void *out) { // TODO: This is a placeholder - PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); - PARSE_CHECK(parse_checktokenadvance(p, MD_HASH)); - PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); - return true; +/** Parses the rest of a link definition after ]: (e.g. " # (target)" or " # (subtopics)"). Consumes until newline or EOF. */ +bool md_parseurl(parser *p, void *out) { + while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) { + parse_advance(p); + } + if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); + return true; /* EOF is valid end of link line */ } -/** Parses a markdown link */ +/** Parses a markdown link definition [label]: # (optional) ... */ bool md_parselink(parser *p, void *out) { PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); PARSE_CHECK(md_parseurl(p, out)); - if (parse_checktokenadvance(p, MD_LEFTPAREN)) { - PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); - PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTPAREN)); - } - parse_checktokenadvance(p, MD_NEWLINE); - return true; } @@ -239,12 +247,13 @@ bool md_parseblock(parser *p, void *out) { return md_parselist(p, out); } else if (parse_checktokenadvance(p, MD_LEFTSQUAREBRACE)) { return md_parselink(p, out); - } else if (parse_checktokenadvance(p, MD_NEWLINE)) { // A blank line + } else if (parse_checktokenadvance(p, MD_NEWLINE)) { /* blank line */ return true; + } else if (parse_checktoken(p, MD_EOF)) { + return true; /* let outer loop exit */ } else { UNREACHABLE("Unrecognized token."); } - return false; } @@ -261,7 +270,7 @@ bool md_parse(parser *p, void *out) { * Initialize a Markdown parser * ------------------------------------------------------- */ -/** Initializes a parser to parse JSON */ +/** Initializes a parser to parse Markdown (help format). */ void help_initializemdparser(parser *p, lexer *l, error *err, void *out) { parse_init(p, l, err, out); parse_setbaseparsefn(p, md_parse); @@ -283,9 +292,12 @@ bool help_parse(char *src) { parser p; help_initializemdparser(&p, &l, &err, NULL); - parse(&p); + bool success = parse(&p); - return true; + parse_clear(&p); + lex_clear(&l); + + return success; } /* ********************************************************************** From 82fa7cea3d32ad028a77cee3091cc2842196650e Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 19:33:21 -0500 Subject: [PATCH 261/473] Help topic parser --- src/support/help.c | 342 ++++++++++++++++++++++++++++++++++++++------- src/support/help.h | 78 +++++++++++ 2 files changed, 372 insertions(+), 48 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 8b8372040..def403c96 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -7,6 +7,8 @@ #include #include #include +#include +#include #include #include "classes.h" @@ -16,6 +18,7 @@ #include "lex.h" #include "parse.h" #include "file.h" +#include "memory.h" /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all @@ -158,6 +161,37 @@ parserule md_rules[] = { PARSERULE_UNUSED(TOKEN_NONE) }; +/* ------------------------------------------------------- + * Parse output: build AST (blocks + topic list) + * ------------------------------------------------------- */ + +/** Output context for the parser: current file, topic list, and base for span offsets. */ +typedef struct { + md_file *file; + varray_md_topic *topics; + int file_index; + int current_header_level; /* 1–3, set before md_parseheader */ +} md_parseout; + +static void md_push_header(parser *p, md_parseout *out, size_t block_start, size_t title_start, size_t title_len); +static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start); +static void md_push_code(parser *p, md_parseout *out, size_t block_start); +static void md_push_list(parser *p, md_parseout *out, size_t block_start); +static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t label_start, size_t label_len, size_t target_start, size_t target_len); + +/** Span from the token we just consumed (p->previous). */ +static md_span md_span_previous(parser *p, const char *base) { + md_span s; + s.start = (size_t)(p->previous.start - base); + s.length = p->previous.length; + return s; +} + +/** End position of the token we just consumed. */ +static size_t md_end_previous(parser *p, const char *base) { + return (size_t)(p->previous.start - base) + p->previous.length; +} + /* ------------------------------------------------------- * Markdown parse rules * ------------------------------------------------------- */ @@ -175,6 +209,10 @@ bool md_checktexttoken(parser *p) { /** Parses text written in markdown; stops at a non-textual token. Line ends with NEWLINE or EOF. */ bool md_parsetext(parser *p, void *out) { + md_parseout *ctx = (md_parseout *) out; + const char *base = ctx->file->source; + size_t block_start = (size_t)(p->current.start - base); + while (md_checktexttoken(p)) { parse_advance(p); parserule *rule = parse_getrule(p, p->previous.type); @@ -183,33 +221,64 @@ bool md_parsetext(parser *p, void *out) { } } /* Line terminator: newline or end of file */ - if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); - if (parse_checktoken(p, MD_EOF)) return true; - return false; + if (parse_checktoken(p, MD_NEWLINE)) { if (!parse_advance(p)) return false; } + else if (!parse_checktoken(p, MD_EOF)) return false; + + md_push_paragraph(p, ctx, block_start); + return true; } /** Parses a markdown header (title then newline or EOF). */ bool md_parseheader(parser *p, void *out) { + md_parseout *ctx = (md_parseout *) out; + const char *base = ctx->file->source; + size_t block_start = (size_t)(p->previous.start - base); /* # token already consumed */ + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); - if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); - if (parse_checktoken(p, MD_EOF)) return true; - return false; + size_t title_start = (size_t)(p->previous.start - base); + size_t title_len = p->previous.length; + + if (parse_checktoken(p, MD_NEWLINE)) { PARSE_CHECK(parse_advance(p)); } + else if (!parse_checktoken(p, MD_EOF)) return false; + + md_push_header(p, ctx, block_start, title_start, title_len); + return true; } /** Parses markdown code block (indented lines until newline or EOF). */ bool md_parsecode(parser *p, void *out) { - while (!parse_checktoken(p, MD_NEWLINE) && - !parse_checktoken(p, MD_EOF)) { + md_parseout *ctx = (md_parseout *) out; + size_t block_start = (size_t)(p->previous.start - ctx->file->source); /* 4 spaces / tab already consumed */ + + while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) { parse_advance(p); } - if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); - if (parse_checktoken(p, MD_EOF)) return true; - return false; + if (parse_checktoken(p, MD_NEWLINE)) { if (!parse_advance(p)) return false; } + else if (!parse_checktoken(p, MD_EOF)) return false; + + md_push_code(p, ctx, block_start); + return true; } -/** Parses a markdown list. */ +/** Parses a markdown list (list item line; records as list block). */ bool md_parselist(parser *p, void *out) { - return md_parsetext(p, out); + md_parseout *ctx = (md_parseout *) out; + const char *base = ctx->file->source; + size_t block_start = (size_t)(p->previous.start - base); /* *, +, or - already consumed */ + + /* Reuse text parsing but record as list block */ + while (md_checktexttoken(p)) { + parse_advance(p); + parserule *rule = parse_getrule(p, p->previous.type); + if (rule && rule->prefix) { + if (!rule->prefix(p, out)) return false; + } + } + if (parse_checktoken(p, MD_NEWLINE)) { if (!parse_advance(p)) return false; } + else if (!parse_checktoken(p, MD_EOF)) return false; + + md_push_list(p, ctx, block_start); + return true; } /** Parses the rest of a link definition after ]: (e.g. " # (target)" or " # (subtopics)"). Consumes until newline or EOF. */ @@ -223,20 +292,39 @@ bool md_parseurl(parser *p, void *out) { /** Parses a markdown link definition [label]: # (optional) ... */ bool md_parselink(parser *p, void *out) { + md_parseout *ctx = (md_parseout *) out; + const char *base = ctx->file->source; + size_t block_start = (size_t)(p->previous.start - base); /* [ already consumed */ + PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + size_t label_start = (size_t)(p->previous.start - base); + size_t label_len = p->previous.length; + PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); + + size_t target_start = (size_t)(p->current.start - base); PARSE_CHECK(md_parseurl(p, out)); + size_t target_end = md_end_previous(p, base); + size_t target_len = (target_end > target_start) ? (target_end - target_start) : 0; + + md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } /** Parse a markdown 'block' */ bool md_parseblock(parser *p, void *out) { + md_parseout *ctx = (md_parseout *) out; if (md_checktexttoken(p)) { return md_parsetext(p, out); - } else if (parse_checktokenadvance(p, MD_HASH) || - parse_checktokenadvance(p, MD_HASH2) || - parse_checktokenadvance(p, MD_HASH3)) { + } else if (parse_checktokenadvance(p, MD_HASH)) { + ctx->current_header_level = 1; + return md_parseheader(p, out); + } else if (parse_checktokenadvance(p, MD_HASH2)) { + ctx->current_header_level = 2; + return md_parseheader(p, out); + } else if (parse_checktokenadvance(p, MD_HASH3)) { + ctx->current_header_level = 3; return md_parseheader(p, out); } else if (parse_checktokenadvance(p, MD_FOURSPACES) || parse_checktokenadvance(p, MD_TAB)) { @@ -278,25 +366,169 @@ void help_initializemdparser(parser *p, lexer *l, error *err, void *out) { parse_setskipnewline(p, false, TOKEN_NONE); } +/* ********************************************************************** + * Markdown AST: definitions and topic list helpers + * ********************************************************************** */ + +DEFINE_VARRAY(md_block, md_block); +DEFINE_VARRAY(md_file, md_file); +DEFINE_VARRAY(md_topic, md_topic); + +void md_block_clear(md_block *b) { + varray_intclear(&b->children); +} + +void md_file_init(md_file *f) { + f->source = NULL; + f->sourcelen = 0; + varray_md_blockinit(&f->blocks); +} + +void md_file_clear(md_file *f) { + if (f->source) MORPHO_FREE(f->source); + f->source = NULL; + f->sourcelen = 0; + for (unsigned int i = 0; i < f->blocks.count; i++) md_block_clear(&f->blocks.data[i]); + varray_md_blockclear(&f->blocks); +} + +int md_topic_compare(const void *a, const void *b) { + const md_topic *ta = (const md_topic *) a; + const md_topic *tb = (const md_topic *) b; + return strcmp(ta->name, tb->name); +} + +void help_sorttopics(varray_md_topic *topics) { + if (topics->data && topics->count > 0) + qsort(topics->data, topics->count, sizeof(md_topic), md_topic_compare); +} + +int help_findtopic(varray_md_topic *topics, const char *name) { + if (!topics->data || topics->count == 0) return -1; + md_topic key = { .name = (char *) name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; + md_topic *found = (md_topic *) bsearch(&key, topics->data, topics->count, sizeof(md_topic), md_topic_compare); + return found ? (int) (found - topics->data) : -1; +} + +/** End offset of the block from the last consumed token. */ +static size_t md_block_end(parser *p, const char *base) { + return md_end_previous(p, base); +} + +/** Set a span to (start, length). */ +static void md_span_set(md_span *s, size_t start, size_t length) { + s->start = start; + s->length = length; +} + +/** Initialize common block fields (type, span, parent, children). */ +static void md_block_init(md_block *b, md_blocktype type, size_t block_start, size_t block_end) { + b->type = type; + md_span_set(&b->span, block_start, block_end - block_start); + b->parent = -1; + varray_intinit(&b->children); +} + +/** Set header block fields (level and title span). */ +static void md_block_set_header(md_block *b, int level, size_t title_start, size_t title_len) { + b->as.header.level = level; + md_span_set(&b->as.header.title, title_start, title_len); +} + +/** Set link-def block fields (label and target spans). */ +static void md_block_set_link_def(md_block *b, size_t label_start, size_t label_len, size_t target_start, size_t target_len) { + md_span_set(&b->as.link_def.label, label_start, label_len); + md_span_set(&b->as.link_def.target, target_start, target_len); +} + +static void md_push_header(parser *p, md_parseout *out, size_t block_start, size_t title_start, size_t title_len) { + const char *base = out->file->source; + size_t block_end = md_block_end(p, base); + + md_block b; + md_block_init(&b, MD_BLOCK_HEADER, block_start, block_end); + md_block_set_header(&b, out->current_header_level, title_start, title_len); + varray_md_blockwrite(&out->file->blocks, b); + + /* Topic: lowercase name from title span */ + char *name = (char *) MORPHO_MALLOC(title_len + 1); + if (name) { + for (size_t i = 0; i < title_len; i++) + name[i] = (char) tolower((unsigned char) base[title_start + i]); + name[title_len] = '\0'; + md_topic topic = { + .name = name, + .file_index = out->file_index, + .block_index = out->file->blocks.count - 1, + .level = out->current_header_level, + .parent_topic = -1 + }; + varray_md_topicwrite(out->topics, topic); + } +} + +static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start) { + const char *base = out->file->source; + size_t block_end = md_block_end(p, base); + md_block b; + md_block_init(&b, MD_BLOCK_PARAGRAPH, block_start, block_end); + varray_md_blockwrite(&out->file->blocks, b); +} + +static void md_push_code(parser *p, md_parseout *out, size_t block_start) { + const char *base = out->file->source; + size_t block_end = md_block_end(p, base); + md_block b; + md_block_init(&b, MD_BLOCK_CODE, block_start, block_end); + varray_md_blockwrite(&out->file->blocks, b); +} + +static void md_push_list(parser *p, md_parseout *out, size_t block_start) { + const char *base = out->file->source; + size_t block_end = md_block_end(p, base); + md_block b; + md_block_init(&b, MD_BLOCK_LIST, block_start, block_end); + varray_md_blockwrite(&out->file->blocks, b); +} + +static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t label_start, size_t label_len, size_t target_start, size_t target_len) { + const char *base = out->file->source; + size_t block_end = md_block_end(p, base); + md_block b; + md_block_init(&b, MD_BLOCK_LINK_DEF, block_start, block_end); + md_block_set_link_def(&b, label_start, label_len, target_start, target_len); + varray_md_blockwrite(&out->file->blocks, b); +} + /* ********************************************************************** * Parse help files * ********************************************************************** */ -bool help_parse(char *src) { +static varray_md_file s_files; +static varray_md_topic s_topics; + +bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { error err; error_init(&err); - + + md_parseout parseout = { + .file = file, + .topics = topics, + .file_index = file_index, + .current_header_level = 1 + }; + lexer l; - help_initializemdlexer(&l, src); - + help_initializemdlexer(&l, file->source); + parser p; - help_initializemdparser(&p, &l, &err, NULL); - + help_initializemdparser(&p, &l, &err, &parseout); + bool success = parse(&p); - + parse_clear(&p); lex_clear(&l); - + return success; } @@ -304,42 +536,48 @@ bool help_parse(char *src) { * Morpho help files * ********************************************************************** */ -/** Loads a help file - * @param file file to load - * @returns true if any help entries were successfully loaded */ +/** Loads a help file into the AST (appends to s_files and s_topics). */ bool help_load(char *filename) { - bool success=false; - + bool success = false; FILE *f = fopen(filename, "r"); - if (f) { - varray_char contents; - varray_charinit(&contents); - - if (file_readintovarray(f, &contents)) { - success=help_parse(contents.data); - } - - varray_charclear(&contents); - + if (!f) return false; + + varray_char contents; + varray_charinit(&contents); + if (!file_readintovarray(f, &contents)) { fclose(f); + varray_charclear(&contents); + return false; } - + fclose(f); + + md_file mdfile; + md_file_init(&mdfile); + mdfile.source = contents.data; + mdfile.sourcelen = (contents.count > 0) ? contents.count - 1 : 0; + + int file_index = (int) s_files.count; + success = help_parse(&mdfile, &s_topics, file_index); + if (success) varray_md_filewrite(&s_files, mdfile); + else md_file_clear(&mdfile); + return success; } -/** Searches for help files - * @returns true if any help files were successfully processed. */ +/** Finds and loads all help files; populates s_files and s_topics, then sorts topics. */ void help_findfiles(void) { varray_value files; varray_valueinit(&files); - + if (morpho_listresources(MORPHO_RESOURCE_HELP, &files)) { - for (int i=0; i +#include "varray.h" + +/* ------------------------------------------------------- + * Markdown AST: source-backed spans, hierarchical blocks + * ------------------------------------------------------- */ + +/** Span into a stored source buffer (offset + length). */ +typedef struct { + size_t start; + size_t length; +} md_span; + +/** Block type. */ +typedef enum { + MD_BLOCK_HEADER, + MD_BLOCK_PARAGRAPH, + MD_BLOCK_CODE, + MD_BLOCK_LIST, + MD_BLOCK_LINK_DEF, + MD_BLOCK_BLANK +} md_blocktype; + +/** A single block: maps to a span in source; type-specific data; optional hierarchy. */ +typedef struct { + md_blocktype type; + md_span span; + union { + struct { int level; md_span title; } header; + struct { md_span label; md_span target; } link_def; + /* paragraph, code, list: span covers content */ + } as; + int parent; /* block index of parent, or -1 if top-level */ + varray_int children; /* indices of child blocks within same file */ +} md_block; + +DECLARE_VARRAY(md_block, md_block); + +/** One source file: owned source text + varray of blocks (with spans into source). */ +typedef struct { + char *source; + size_t sourcelen; + varray_md_block blocks; +} md_file; + +DECLARE_VARRAY(md_file, md_file); + +/** Topic entry: header in the master list, sorted by name for O(log n) lookup. */ +typedef struct { + char *name; /* lowercase, owned */ + int file_index; + unsigned int block_index; + int level; /* header level 1–3 */ + int parent_topic; /* topic index of parent, or -1 */ +} md_topic; + +DECLARE_VARRAY(md_topic, md_topic); + +/** Initialize / clear a block (clears children). */ +void md_block_clear(md_block *b); + +/** Initialize / clear a file (frees source, clears blocks). */ +void md_file_init(md_file *f); +void md_file_clear(md_file *f); + +/** Topic list: compare by name for bsearch. */ +int md_topic_compare(const void *a, const void *b); + +/** Sort topic list by name (call after loading so lookup is O(log n)). */ +void help_sorttopics(varray_md_topic *topics); + +/** Find topic index by name (binary search). Returns -1 if not found. */ +int help_findtopic(varray_md_topic *topics, const char *name); + +/* ------------------------------------------------------- + * Help API + * ------------------------------------------------------- */ + bool morpho_help(char *query, varray_char *result); void help_initialize(void); From 178a51303a17c788065f12f6f34edd97750eaef2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 19:48:47 -0500 Subject: [PATCH 262/473] Help finding system --- src/datastructures/varray.h | 4 +- src/support/help.c | 80 ++++++++++++++++++++++++++++++++++++- src/support/help.h | 22 ++++++++++ 3 files changed, 102 insertions(+), 4 deletions(-) diff --git a/src/datastructures/varray.h b/src/datastructures/varray.h index dbf836db6..2c87b105f 100644 --- a/src/datastructures/varray.h +++ b/src/datastructures/varray.h @@ -41,7 +41,7 @@ } varray_##name; \ \ void varray_##name##init(varray_##name *v); \ - bool varray_##name##add(varray_##name *v, type *data, int count); \ + bool varray_##name##add(varray_##name *v, const type *data, int count); \ bool varray_##name##resize(varray_##name *v, int count); \ int varray_##name##write(varray_##name *v, type data); \ void varray_##name##clear(varray_##name *v); @@ -53,7 +53,7 @@ void varray_##name##init(varray_##name *v) { \ v->data=NULL; \ } \ \ -bool varray_##name##add(varray_##name *v, type *data, int count) { \ +bool varray_##name##add(varray_##name *v, const type *data, int count) { \ if (v->capacitycount + count) { \ unsigned int capacity = varray_powerof2ceiling(v->count + count); \ v->data = (type *) morpho_allocate(v->data, v->capacity * sizeof(type), \ diff --git a/src/support/help.c b/src/support/help.c index def403c96..f611d1ff0 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -501,12 +501,62 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t } /* ********************************************************************** - * Parse help files + * Help topic lookup and content range * ********************************************************************** */ static varray_md_file s_files; static varray_md_topic s_topics; +/** Number of blocks that form this topic's content (header + following until next same-level or higher header). */ +static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_file *file) { + unsigned int i = topic->block_index; + unsigned int n = file->blocks.count; + int level = topic->level; + while (i < n) { + const md_block *b = &file->blocks.data[i]; + if (b->type == MD_BLOCK_HEADER && b->as.header.level <= level && i > topic->block_index) + break; + i++; + } + return i - topic->block_index; +} + +bool help_topictotext(const help_topic *t, varray_char *result) { + if (!t || !t->file || !t->file->source || !result) return false; + const char *src = t->file->source; + size_t src_len = t->file->sourcelen; + + for (unsigned int i = 0; i < t->nblocks; i++) { + const md_block *b = &t->content_blocks[i]; + if (b->span.start >= src_len) continue; + size_t len = b->span.length; + if (b->span.start + len > src_len) len = src_len - b->span.start; + + switch (b->type) { + case MD_BLOCK_HEADER: { + /* Skip leading # and space for plain text */ + const char *p = src + b->as.header.title.start; + size_t tlen = b->as.header.title.length; + if (b->as.header.title.start + tlen > src_len) tlen = src_len - b->as.header.title.start; + while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } + if (tlen > 0) varray_charadd(result, p, (int) tlen); + varray_charadd(result, "\n\n", 2); + break; + } + case MD_BLOCK_PARAGRAPH: + case MD_BLOCK_LIST: + case MD_BLOCK_CODE: + varray_charadd(result, src + b->span.start, (int) len); + if (len > 0 && src[b->span.start + len - 1] != '\n') varray_charadd(result, "\n", 1); + break; + case MD_BLOCK_LINK_DEF: + case MD_BLOCK_BLANK: + break; + } + } + return true; +} + bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { error err; error_init(&err); @@ -585,8 +635,34 @@ void help_findfiles(void) { * ********************************************************************** */ /** Interface to the morpho help system */ +bool morpho_helptopic(const char *query, help_topic *out) { + /* Topic names are stored lowercase; search key must match. */ + char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; + size_t qlen = 0; + while (query[qlen] && qlen < MORPHO_MAX_HELPQUERY_LENGTH - 1) { + qbuf[qlen] = (char) tolower((unsigned char) query[qlen]); + qlen++; + } + qbuf[qlen] = '\0'; + + int idx = help_findtopic(&s_topics, qbuf); + if (idx < 0) return false; + const md_topic *topic = &s_topics.data[idx]; + if (topic->file_index < 0 || (unsigned int) topic->file_index >= s_files.count) return false; + const md_file *file = &s_files.data[topic->file_index]; + if (topic->block_index >= file->blocks.count) return false; + + out->topic = topic; + out->file = file; + out->content_blocks = &file->blocks.data[topic->block_index]; + out->nblocks = help_topiccontentnblocks(topic, file); + return true; +} + bool morpho_help(char *query, varray_char *result) { - return false; + help_topic t; + if (!morpho_helptopic(query, &t)) return false; + return help_topictotext(&t, result); } /* ********************************************************************** diff --git a/src/support/help.h b/src/support/help.h index 7c4a222ba..bf655368a 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -10,6 +10,9 @@ #include #include "varray.h" +/** Maximum length of a help query string (used for lookup buffer). */ +#define MORPHO_MAX_HELPQUERY_LENGTH 512 + /* ------------------------------------------------------- * Markdown AST: source-backed spans, hierarchical blocks * ------------------------------------------------------- */ @@ -81,10 +84,29 @@ void help_sorttopics(varray_md_topic *topics); /** Find topic index by name (binary search). Returns -1 if not found. */ int help_findtopic(varray_md_topic *topics, const char *name); +/* ------------------------------------------------------- + * Help topic view (for flexible rendering) + * ------------------------------------------------------- */ + +/** A resolved help topic: pointer to the topic entry, its file, and the slice of blocks that form its content (header + following blocks until the next same-level or higher header). Callers can use this to render raw MD, plain text, or terminal-styled output. */ +typedef struct { + const md_topic *topic; + const md_file *file; + const md_block *content_blocks; /* first block of content (header) */ + unsigned int nblocks; +} help_topic; + +/** Resolve a query to a help topic. Fills *out and returns true if found; otherwise returns false and *out is unchanged. */ +bool morpho_helptopic(const char *query, help_topic *out); + +/** Render a help topic as plain text into result (no markdown formatting). Returns true on success. */ +bool help_topictotext(const help_topic *t, varray_char *result); + /* ------------------------------------------------------- * Help API * ------------------------------------------------------- */ +/** Look up help for query and write plain-text result. Returns true if topic found. (Convenience wrapper for morpho_helptopic + help_topictotext.) */ bool morpho_help(char *query, varray_char *result); void help_initialize(void); From 8e5e5f88b172c8ea0648a3e534a5bbb08795e627 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 20:06:21 -0500 Subject: [PATCH 263/473] Correct topic names --- src/classes/system.c | 2 +- src/support/help.c | 38 ++++++++++++++++++++++++++++++++++---- src/support/help.h | 16 +++++++++++----- 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/src/classes/system.c b/src/classes/system.c index d4f822e25..86470bb9f 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -139,7 +139,7 @@ value System_help(vm *v, int nargs, value *args) { varray_char result; varray_charinit(&result); - if (morpho_help(query, &result)) { + if (morpho_helpastext(query, &result)) { out=object_stringfromvarraychar(&result); if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); } diff --git a/src/support/help.c b/src/support/help.c index f611d1ff0..1a224f14e 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -450,7 +450,14 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size md_block_set_header(&b, out->current_header_level, title_start, title_len); varray_md_blockwrite(&out->file->blocks, b); - /* Topic: lowercase name from title span */ + /* Topic: lowercase name from title span (trim leading/trailing whitespace) */ + while (title_len && (unsigned char) base[title_start] <= ' ') { + title_start++; + title_len--; + } + while (title_len && (unsigned char) base[title_start + title_len - 1] <= ' ') { + title_len--; + } char *name = (char *) MORPHO_MALLOC(title_len + 1); if (name) { for (size_t i = 0; i < title_len; i++) @@ -557,6 +564,23 @@ bool help_topictotext(const help_topic *t, varray_char *result) { return true; } +bool help_topicrawmd(const help_topic *t, varray_char *result) { + if (!t || !t->file || !t->file->source || !result) return false; + const char *src = t->file->source; + size_t src_len = t->file->sourcelen; + + for (unsigned int i = 0; i < t->nblocks; i++) { + const md_block *b = &t->content_blocks[i]; + if (b->span.start >= src_len) continue; + size_t len = b->span.length; + if (b->span.start + len > src_len) len = src_len - b->span.start; + if (len == 0) continue; + varray_charadd(result, src + b->span.start, (int) len); + if (src[b->span.start + len - 1] != '\n') varray_charadd(result, "\n", 1); + } + return true; +} + bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { error err; error_init(&err); @@ -635,7 +659,7 @@ void help_findfiles(void) { * ********************************************************************** */ /** Interface to the morpho help system */ -bool morpho_helptopic(const char *query, help_topic *out) { +bool morpho_helpastopic(const char *query, help_topic *out) { /* Topic names are stored lowercase; search key must match. */ char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; size_t qlen = 0; @@ -659,12 +683,18 @@ bool morpho_helptopic(const char *query, help_topic *out) { return true; } -bool morpho_help(char *query, varray_char *result) { +bool morpho_helpastext(char *query, varray_char *result) { help_topic t; - if (!morpho_helptopic(query, &t)) return false; + if (!morpho_helpastopic(query, &t)) return false; return help_topictotext(&t, result); } +bool morpho_helpasmd(char *query, varray_char *result) { + help_topic t; + if (!morpho_helpastopic(query, &t)) return false; + return help_topicrawmd(&t, result); +} + /* ********************************************************************** * Initialization/finalization * ********************************************************************** */ diff --git a/src/support/help.h b/src/support/help.h index bf655368a..ad7c0a766 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -96,18 +96,24 @@ typedef struct { unsigned int nblocks; } help_topic; -/** Resolve a query to a help topic. Fills *out and returns true if found; otherwise returns false and *out is unchanged. */ -bool morpho_helptopic(const char *query, help_topic *out); - /** Render a help topic as plain text into result (no markdown formatting). Returns true on success. */ bool help_topictotext(const help_topic *t, varray_char *result); +/** Append a help topic's raw markdown from source into result. Returns true on success. */ +bool help_topicrawmd(const help_topic *t, varray_char *result); + /* ------------------------------------------------------- * Help API * ------------------------------------------------------- */ -/** Look up help for query and write plain-text result. Returns true if topic found. (Convenience wrapper for morpho_helptopic + help_topictotext.) */ -bool morpho_help(char *query, varray_char *result); +/** Resolve a query to a help topic. Fills *out and returns true if found; otherwise returns false and *out is unchanged. */ + bool morpho_helpastopic(const char *query, help_topic *out); + +/** Look up help for query and write plain-text result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topictotext.) */ +bool morpho_helpastext(char *query, varray_char *result); + +/** Look up help for query and write raw markdown into result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topicrawmd.) */ +bool morpho_helpasmd(char *query, varray_char *result); void help_initialize(void); void help_finalize(void); From e448cbf84fe0b0929637fc0c8453d48d3dad8891 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 20:13:22 -0500 Subject: [PATCH 264/473] Hierarchical search --- src/support/help.c | 75 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 4 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 1a224f14e..562662e0e 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -514,6 +514,52 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t static varray_md_file s_files; static varray_md_topic s_topics; +/** Maximum number of query segments (e.g. "System respondsto" -> 2). */ +#define MORPHO_HELP_QUERY_MAXSEGMENTS 8 + +/** Find topic index by file and block index. Returns -1 if not found. */ +static int help_findtopicbyblock(int file_index, unsigned int block_index) { + for (unsigned int i = 0; i < s_topics.count; i++) { + if (s_topics.data[i].file_index == file_index && s_topics.data[i].block_index == block_index) + return (int) i; + } + return -1; +} + +/** True if header title span (trimmed, lowercased) equals name. */ +static bool help_headertitleeq(const char *base, size_t start, size_t len, const char *name) { + while (len && (unsigned char) base[start] <= ' ') { start++; len--; } + while (len && (unsigned char) base[start + len - 1] <= ' ') len--; + while (len && *name && (char) tolower((unsigned char) base[start]) == *name) { + start++; + len--; + name++; + } + return len == 0 && *name == '\0'; +} + +/** Find first subtopic of parent with given name (same file, block after parent, level > parent). Returns topic index or -1. */ +static int help_findsubtopic(int parent_idx, const char *name) { + if (parent_idx < 0 || (unsigned int) parent_idx >= s_topics.count) return -1; + const md_topic *parent = &s_topics.data[parent_idx]; + if (parent->file_index < 0 || (unsigned int) parent->file_index >= s_files.count) return -1; + const md_file *file = &s_files.data[parent->file_index]; + const char *base = file->source; + size_t base_len = file->sourcelen; + + for (unsigned int i = parent->block_index + 1; i < file->blocks.count; i++) { + const md_block *b = &file->blocks.data[i]; + if (b->type != MD_BLOCK_HEADER) continue; + if (b->as.header.level <= parent->level) return -1; /* left section */ + size_t start = b->as.header.title.start; + size_t len = b->as.header.title.length; + if (start + len > base_len) len = base_len - start; + if (help_headertitleeq(base, start, len, name)) + return help_findtopicbyblock(parent->file_index, i); + } + return -1; +} + /** Number of blocks that form this topic's content (header + following until next same-level or higher header). */ static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_file *file) { unsigned int i = topic->block_index; @@ -658,19 +704,40 @@ void help_findfiles(void) { * Morpho help files * ********************************************************************** */ -/** Interface to the morpho help system */ +/** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ bool morpho_helpastopic(const char *query, help_topic *out) { - /* Topic names are stored lowercase; search key must match. */ + /* Copy query, lowercase, and replace '.' and ' ' with nul to form segments. */ char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; size_t qlen = 0; while (query[qlen] && qlen < MORPHO_MAX_HELPQUERY_LENGTH - 1) { - qbuf[qlen] = (char) tolower((unsigned char) query[qlen]); + char c = query[qlen]; + qbuf[qlen] = (c == '.' || c == ' ') ? '\0' : (char) tolower((unsigned char) c); qlen++; } qbuf[qlen] = '\0'; - int idx = help_findtopic(&s_topics, qbuf); + /* Collect segment pointers (non-empty runs). */ + const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; + int nsegs = 0; + const char *p = qbuf; + while (nsegs < MORPHO_HELP_QUERY_MAXSEGMENTS && p < qbuf + qlen) { + while (p < qbuf + qlen && *p == '\0') p++; + if (p >= qbuf + qlen) break; + segs[nsegs++] = p; + while (p < qbuf + qlen && *p != '\0') p++; + } + if (nsegs == 0) return false; + + /* Resolve first segment to a topic. */ + int idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) return false; + + /* Resolve remaining segments as subtopics. */ + for (int i = 1; i < nsegs; i++) { + idx = help_findsubtopic(idx, segs[i]); + if (idx < 0) return false; + } + const md_topic *topic = &s_topics.data[idx]; if (topic->file_index < 0 || (unsigned int) topic->file_index >= s_files.count) return false; const md_file *file = &s_files.data[topic->file_index]; From 23705fdf29166eb87be2e64610f5f95b07957a1e Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 20:31:28 -0500 Subject: [PATCH 265/473] Hint if query didn't match --- src/classes/system.c | 8 +- src/support/help.c | 286 ++++++++++++++++++++++++++++--------------- src/support/help.h | 4 + 3 files changed, 196 insertions(+), 102 deletions(-) diff --git a/src/classes/system.c b/src/classes/system.c index 86470bb9f..aed29f96a 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -139,11 +139,9 @@ value System_help(vm *v, int nargs, value *args) { varray_char result; varray_charinit(&result); - if (morpho_helpastext(query, &result)) { - out=object_stringfromvarraychar(&result); - if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); - } - + morpho_helpastext(query, &result); /* fills result with help text or a "not found" hint */ + out = object_stringfromvarraychar(&result); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); varray_charclear(&result); } diff --git a/src/support/help.c b/src/support/help.c index 562662e0e..2b02493ac 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -196,6 +196,12 @@ static size_t md_end_previous(parser *p, const char *base) { * Markdown parse rules * ------------------------------------------------------- */ +/** Consume newline or require EOF; return true if valid line end. */ +static bool md_parselineend(parser *p) { + if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); + return parse_checktoken(p, MD_EOF); +} + /** Check if a token type is a 'textual' token (incl. * _ for italic, ** __ for bold, ` for code) */ tokentype _inlinetokens[] = { MD_TEXT, MD_COLON, MD_BACKTICK, MD_LEFTPAREN, MD_RIGHTPAREN, @@ -220,10 +226,7 @@ bool md_parsetext(parser *p, void *out) { if (!rule->prefix(p, out)) return false; } } - /* Line terminator: newline or end of file */ - if (parse_checktoken(p, MD_NEWLINE)) { if (!parse_advance(p)) return false; } - else if (!parse_checktoken(p, MD_EOF)) return false; - + PARSE_CHECK(md_parselineend(p)); md_push_paragraph(p, ctx, block_start); return true; } @@ -238,9 +241,7 @@ bool md_parseheader(parser *p, void *out) { size_t title_start = (size_t)(p->previous.start - base); size_t title_len = p->previous.length; - if (parse_checktoken(p, MD_NEWLINE)) { PARSE_CHECK(parse_advance(p)); } - else if (!parse_checktoken(p, MD_EOF)) return false; - + PARSE_CHECK(md_parselineend(p)); md_push_header(p, ctx, block_start, title_start, title_len); return true; } @@ -250,12 +251,8 @@ bool md_parsecode(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; size_t block_start = (size_t)(p->previous.start - ctx->file->source); /* 4 spaces / tab already consumed */ - while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) { - parse_advance(p); - } - if (parse_checktoken(p, MD_NEWLINE)) { if (!parse_advance(p)) return false; } - else if (!parse_checktoken(p, MD_EOF)) return false; - + while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) parse_advance(p); + PARSE_CHECK(md_parselineend(p)); md_push_code(p, ctx, block_start); return true; } @@ -274,9 +271,7 @@ bool md_parselist(parser *p, void *out) { if (!rule->prefix(p, out)) return false; } } - if (parse_checktoken(p, MD_NEWLINE)) { if (!parse_advance(p)) return false; } - else if (!parse_checktoken(p, MD_EOF)) return false; - + PARSE_CHECK(md_parselineend(p)); md_push_list(p, ctx, block_start); return true; } @@ -421,6 +416,12 @@ static void md_span_set(md_span *s, size_t start, size_t length) { s->length = length; } +/** Trim leading and trailing whitespace from (start, len) in place. */ +static void md_trimspan(const char *base, size_t *start, size_t *len) { + while (*len && (unsigned char) base[*start] <= ' ') { (*start)++; (*len)--; } + while (*len && (unsigned char) base[*start + *len - 1] <= ' ') (*len)--; +} + /** Initialize common block fields (type, span, parent, children). */ static void md_block_init(md_block *b, md_blocktype type, size_t block_start, size_t block_end) { b->type = type; @@ -441,6 +442,14 @@ static void md_block_set_link_def(md_block *b, size_t label_start, size_t label_ md_span_set(&b->as.link_def.target, target_start, target_len); } +/** Push a simple block (paragraph, code, list); type and span only. */ +static void md_push_simpleblock(parser *p, md_parseout *out, size_t block_start, md_blocktype type) { + const char *base = out->file->source; + md_block b; + md_block_init(&b, type, block_start, md_block_end(p, base)); + varray_md_blockwrite(&out->file->blocks, b); +} + static void md_push_header(parser *p, md_parseout *out, size_t block_start, size_t title_start, size_t title_len) { const char *base = out->file->source; size_t block_end = md_block_end(p, base); @@ -450,19 +459,14 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size md_block_set_header(&b, out->current_header_level, title_start, title_len); varray_md_blockwrite(&out->file->blocks, b); - /* Topic: lowercase name from title span (trim leading/trailing whitespace) */ - while (title_len && (unsigned char) base[title_start] <= ' ') { - title_start++; - title_len--; - } - while (title_len && (unsigned char) base[title_start + title_len - 1] <= ' ') { - title_len--; - } - char *name = (char *) MORPHO_MALLOC(title_len + 1); + /* Topic: lowercase name from trimmed title span */ + size_t ns = title_start, nl = title_len; + md_trimspan(base, &ns, &nl); + char *name = (char *) MORPHO_MALLOC(nl + 1); if (name) { - for (size_t i = 0; i < title_len; i++) - name[i] = (char) tolower((unsigned char) base[title_start + i]); - name[title_len] = '\0'; + for (size_t i = 0; i < nl; i++) + name[i] = (char) tolower((unsigned char) base[ns + i]); + name[nl] = '\0'; md_topic topic = { .name = name, .file_index = out->file_index, @@ -475,27 +479,13 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size } static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start) { - const char *base = out->file->source; - size_t block_end = md_block_end(p, base); - md_block b; - md_block_init(&b, MD_BLOCK_PARAGRAPH, block_start, block_end); - varray_md_blockwrite(&out->file->blocks, b); + md_push_simpleblock(p, out, block_start, MD_BLOCK_PARAGRAPH); } - static void md_push_code(parser *p, md_parseout *out, size_t block_start) { - const char *base = out->file->source; - size_t block_end = md_block_end(p, base); - md_block b; - md_block_init(&b, MD_BLOCK_CODE, block_start, block_end); - varray_md_blockwrite(&out->file->blocks, b); + md_push_simpleblock(p, out, block_start, MD_BLOCK_CODE); } - static void md_push_list(parser *p, md_parseout *out, size_t block_start) { - const char *base = out->file->source; - size_t block_end = md_block_end(p, base); - md_block b; - md_block_init(&b, MD_BLOCK_LIST, block_start, block_end); - varray_md_blockwrite(&out->file->blocks, b); + md_push_simpleblock(p, out, block_start, MD_BLOCK_LIST); } static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t label_start, size_t label_len, size_t target_start, size_t target_len) { @@ -516,6 +506,30 @@ static varray_md_topic s_topics; /** Maximum number of query segments (e.g. "System respondsto" -> 2). */ #define MORPHO_HELP_QUERY_MAXSEGMENTS 8 +/** Max edit distance to suggest a topic (only suggest if close enough). */ +#define MORPHO_HELP_SUGGEST_MAXDIST 3 +/** Edit distance return when string too long (no match). */ +#define MORPHO_HELP_EDIT_NOMATCH 255 + +/** Parse query into lowercased segments in qbuf; segs[] points into qbuf. Returns nsegs (0 if none). */ +static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { + size_t qlen = 0; + while (query[qlen] && qlen < MORPHO_MAX_HELPQUERY_LENGTH - 1) { + char c = query[qlen]; + qbuf[qlen] = (c == '.' || c == ' ') ? '\0' : (char) tolower((unsigned char) c); + qlen++; + } + qbuf[qlen] = '\0'; + int nsegs = 0; + const char *p = qbuf; + while (nsegs < MORPHO_HELP_QUERY_MAXSEGMENTS && p < qbuf + qlen) { + while (p < qbuf + qlen && *p == '\0') p++; + if (p >= qbuf + qlen) break; + segs[nsegs++] = p; + while (p < qbuf + qlen && *p != '\0') p++; + } + return nsegs; +} /** Find topic index by file and block index. Returns -1 if not found. */ static int help_findtopicbyblock(int file_index, unsigned int block_index) { @@ -528,8 +542,7 @@ static int help_findtopicbyblock(int file_index, unsigned int block_index) { /** True if header title span (trimmed, lowercased) equals name. */ static bool help_headertitleeq(const char *base, size_t start, size_t len, const char *name) { - while (len && (unsigned char) base[start] <= ' ') { start++; len--; } - while (len && (unsigned char) base[start + len - 1] <= ' ') len--; + md_trimspan(base, &start, &len); while (len && *name && (char) tolower((unsigned char) base[start]) == *name) { start++; len--; @@ -560,6 +573,61 @@ static int help_findsubtopic(int parent_idx, const char *name) { return -1; } +/** Levenshtein distance between two strings (for "did you mean"). */ +static unsigned int help_editdistance(const char *a, const char *b) { + size_t na = strlen(a), nb = strlen(b); + if (na == 0) return (unsigned int) nb; + if (nb == 0) return (unsigned int) na; + if (na > MORPHO_HELP_EDITMAXLEN || nb > MORPHO_HELP_EDITMAXLEN) return MORPHO_HELP_EDIT_NOMATCH; + unsigned int row0[MORPHO_HELP_EDITMAXLEN + 1], row1[MORPHO_HELP_EDITMAXLEN + 1]; + unsigned int *prev = row0, *curr = row1; + for (size_t j = 0; j <= nb; j++) prev[j] = (unsigned int) j; + for (size_t i = 1; i <= na; i++) { + curr[0] = (unsigned int) i; + for (size_t j = 1; j <= nb; j++) { + unsigned int cost = (a[i - 1] == b[j - 1]) ? 0 : 1; + unsigned int del = prev[j] + 1, ins = curr[j - 1] + 1, sub = prev[j - 1] + cost; + curr[j] = (del < ins) ? (del < sub ? del : sub) : (ins < sub ? ins : sub); + } + { unsigned int *t = prev; prev = curr; curr = t; } + } + return prev[nb]; +} + +static const char MORPHO_HELP_NOTFOUND[] = "Topic not found."; + +/** Find top-level topic name closest to name; NULL if none within distance. */ +static const char *help_findclosesttopic(const char *name) { + const char *best = NULL; + unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; + for (unsigned int i = 0; i < s_topics.count; i++) { + if (s_topics.data[i].level != 1 || !s_topics.data[i].name) continue; + unsigned int d = help_editdistance(name, s_topics.data[i].name); + if (d < best_d) { best_d = d; best = s_topics.data[i].name; } + } + return best; +} + +/** Find subtopic name under parent closest to name; NULL if none within distance. */ +static const char *help_findclosestsubtopic(int parent_idx, const char *name) { + if (parent_idx < 0 || (unsigned int) parent_idx >= s_topics.count) return NULL; + const md_topic *parent = &s_topics.data[parent_idx]; + if (parent->file_index < 0 || (unsigned int) parent->file_index >= s_files.count) return NULL; + const md_file *file = &s_files.data[parent->file_index]; + const char *best = NULL; + unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; + for (unsigned int i = parent->block_index + 1; i < file->blocks.count; i++) { + const md_block *b = &file->blocks.data[i]; + if (b->type != MD_BLOCK_HEADER) continue; + if (b->as.header.level <= parent->level) break; + int ti = help_findtopicbyblock(parent->file_index, i); + if (ti < 0 || !s_topics.data[ti].name) continue; + unsigned int d = help_editdistance(name, s_topics.data[ti].name); + if (d < best_d) { best_d = d; best = s_topics.data[ti].name; } + } + return best; +} + /** Number of blocks that form this topic's content (header + following until next same-level or higher header). */ static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_file *file) { unsigned int i = topic->block_index; @@ -574,11 +642,26 @@ static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_fil return i - topic->block_index; } -bool help_topictotext(const help_topic *t, varray_char *result) { +/** Fill a help_topic view from resolved topic and file. */ +static void help_topicfill(help_topic *out, const md_topic *topic, const md_file *file) { + out->topic = topic; + out->file = file; + out->content_blocks = &file->blocks.data[topic->block_index]; + out->nblocks = help_topiccontentnblocks(topic, file); +} + +/** Validate topic and get source pointer/length; return false if invalid. */ +static bool help_topicsrc(const help_topic *t, varray_char *result, const char **src, size_t *src_len) { if (!t || !t->file || !t->file->source || !result) return false; - const char *src = t->file->source; - size_t src_len = t->file->sourcelen; + *src = t->file->source; + *src_len = t->file->sourcelen; + return true; +} +bool help_topictotext(const help_topic *t, varray_char *result) { + const char *src; + size_t src_len; + if (!help_topicsrc(t, result, &src, &src_len)) return false; for (unsigned int i = 0; i < t->nblocks; i++) { const md_block *b = &t->content_blocks[i]; if (b->span.start >= src_len) continue; @@ -611,10 +694,9 @@ bool help_topictotext(const help_topic *t, varray_char *result) { } bool help_topicrawmd(const help_topic *t, varray_char *result) { - if (!t || !t->file || !t->file->source || !result) return false; - const char *src = t->file->source; - size_t src_len = t->file->sourcelen; - + const char *src; + size_t src_len; + if (!help_topicsrc(t, result, &src, &src_len)) return false; for (unsigned int i = 0; i < t->nblocks; i++) { const md_block *b = &t->content_blocks[i]; if (b->span.start >= src_len) continue; @@ -643,13 +725,10 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { parser p; help_initializemdparser(&p, &l, &err, &parseout); - - bool success = parse(&p); - + bool ok = parse(&p); parse_clear(&p); lex_clear(&l); - - return success; + return ok; } /* ********************************************************************** @@ -658,10 +737,8 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { /** Loads a help file into the AST (appends to s_files and s_topics). */ bool help_load(char *filename) { - bool success = false; FILE *f = fopen(filename, "r"); if (!f) return false; - varray_char contents; varray_charinit(&contents); if (!file_readintovarray(f, &contents)) { @@ -670,18 +747,14 @@ bool help_load(char *filename) { return false; } fclose(f); - md_file mdfile; md_file_init(&mdfile); mdfile.source = contents.data; mdfile.sourcelen = (contents.count > 0) ? contents.count - 1 : 0; - - int file_index = (int) s_files.count; - success = help_parse(&mdfile, &s_topics, file_index); - if (success) varray_md_filewrite(&s_files, mdfile); + bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); + if (ok) varray_md_filewrite(&s_files, mdfile); else md_file_clear(&mdfile); - - return success; + return ok; } /** Finds and loads all help files; populates s_files and s_topics, then sorts topics. */ @@ -701,34 +774,16 @@ void help_findfiles(void) { } /* ********************************************************************** - * Morpho help files + * Help API * ********************************************************************** */ /** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ bool morpho_helpastopic(const char *query, help_topic *out) { - /* Copy query, lowercase, and replace '.' and ' ' with nul to form segments. */ char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; - size_t qlen = 0; - while (query[qlen] && qlen < MORPHO_MAX_HELPQUERY_LENGTH - 1) { - char c = query[qlen]; - qbuf[qlen] = (c == '.' || c == ' ') ? '\0' : (char) tolower((unsigned char) c); - qlen++; - } - qbuf[qlen] = '\0'; - - /* Collect segment pointers (non-empty runs). */ const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; - int nsegs = 0; - const char *p = qbuf; - while (nsegs < MORPHO_HELP_QUERY_MAXSEGMENTS && p < qbuf + qlen) { - while (p < qbuf + qlen && *p == '\0') p++; - if (p >= qbuf + qlen) break; - segs[nsegs++] = p; - while (p < qbuf + qlen && *p != '\0') p++; - } - if (nsegs == 0) return false; + int nsegs = help_parsequery(query, qbuf, segs); + if (nsegs <= 0) return false; - /* Resolve first segment to a topic. */ int idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) return false; @@ -743,23 +798,60 @@ bool morpho_helpastopic(const char *query, help_topic *out) { const md_file *file = &s_files.data[topic->file_index]; if (topic->block_index >= file->blocks.count) return false; - out->topic = topic; - out->file = file; - out->content_blocks = &file->blocks.data[topic->block_index]; - out->nblocks = help_topiccontentnblocks(topic, file); + help_topicfill(out, topic, file); return true; } +/** Append "Topic 'query' not found [. Did you mean 'suggest'?]." to result. suggest2 optional (then suggest is "suggest1.suggest2"). */ +static void help_hintappend(varray_char *result, const char *query, const char *suggest1, const char *suggest2) { + char buf[MORPHO_HELP_HINTBUFSIZE]; + int n = suggest1 + ? (suggest2 ? snprintf(buf, sizeof(buf), "Topic '%s' not found. Did you mean '%s.%s'?", query, suggest1, suggest2) + : snprintf(buf, sizeof(buf), "Topic '%s' not found. Did you mean '%s'?", query, suggest1)) + : snprintf(buf, sizeof(buf), "Topic '%s' not found.", query); + if (n > 0 && (size_t) n < sizeof(buf)) varray_charadd(result, buf, n); +} + +/** Build a hint for a failed query and append to result (caller may clear result first). */ +static void help_queryhint(const char *query, varray_char *result) { + if (!result) return; + char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; + const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; + int nsegs = help_parsequery(query, qbuf, segs); + if (nsegs == 0) { + varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); + return; + } + int idx = help_findtopic(&s_topics, segs[0]); + if (idx < 0) { + help_hintappend(result, query, help_findclosesttopic(segs[0]), NULL); + return; + } + for (int i = 1; i < nsegs; i++) { + int next = help_findsubtopic(idx, segs[i]); + if (next < 0) { + const md_topic *parent = &s_topics.data[idx]; + const char *closest = help_findclosestsubtopic(idx, segs[i]); + help_hintappend(result, query, closest ? parent->name : NULL, closest); + return; + } + idx = next; + } + varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); +} + bool morpho_helpastext(char *query, varray_char *result) { help_topic t; - if (!morpho_helpastopic(query, &t)) return false; - return help_topictotext(&t, result); + if (morpho_helpastopic(query, &t)) return help_topictotext(&t, result); + help_queryhint(query, result); + return false; } bool morpho_helpasmd(char *query, varray_char *result) { help_topic t; - if (!morpho_helpastopic(query, &t)) return false; - return help_topicrawmd(&t, result); + if (morpho_helpastopic(query, &t)) return help_topicrawmd(&t, result); + help_queryhint(query, result); + return false; } /* ********************************************************************** diff --git a/src/support/help.h b/src/support/help.h index ad7c0a766..0c74b2b9c 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -12,6 +12,10 @@ /** Maximum length of a help query string (used for lookup buffer). */ #define MORPHO_MAX_HELPQUERY_LENGTH 512 +/** Maximum length of a single string for edit-distance (suggestion). */ +#define MORPHO_HELP_EDITMAXLEN 128 +/** Buffer size for "not found" hint message. */ +#define MORPHO_HELP_HINTBUFSIZE 256 /* ------------------------------------------------------- * Markdown AST: source-backed spans, hierarchical blocks From 43c0b75a1e7650e9f3c9b497f7ce65e7d9fd310d Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 20:35:11 -0500 Subject: [PATCH 266/473] Suggestions for errors at any level --- src/support/help.c | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 2b02493ac..1248581d3 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -802,12 +802,11 @@ bool morpho_helpastopic(const char *query, help_topic *out) { return true; } -/** Append "Topic 'query' not found [. Did you mean 'suggest'?]." to result. suggest2 optional (then suggest is "suggest1.suggest2"). */ -static void help_hintappend(varray_char *result, const char *query, const char *suggest1, const char *suggest2) { +/** Append "Topic 'query' not found [. Did you mean 'suggest'?]." to result. suggest is full path or NULL. */ +static void help_hintappend(varray_char *result, const char *query, const char *suggest) { char buf[MORPHO_HELP_HINTBUFSIZE]; - int n = suggest1 - ? (suggest2 ? snprintf(buf, sizeof(buf), "Topic '%s' not found. Did you mean '%s.%s'?", query, suggest1, suggest2) - : snprintf(buf, sizeof(buf), "Topic '%s' not found. Did you mean '%s'?", query, suggest1)) + int n = suggest + ? snprintf(buf, sizeof(buf), "Topic '%s' not found. Did you mean '%s'?", query, suggest) : snprintf(buf, sizeof(buf), "Topic '%s' not found.", query); if (n > 0 && (size_t) n < sizeof(buf)) varray_charadd(result, buf, n); } @@ -824,18 +823,35 @@ static void help_queryhint(const char *query, varray_char *result) { } int idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) { - help_hintappend(result, query, help_findclosesttopic(segs[0]), NULL); + help_hintappend(result, query, help_findclosesttopic(segs[0])); return; } + char path[MORPHO_MAX_HELPQUERY_LENGTH]; + int path_len = (int) strlen(segs[0]); + if (path_len >= (int) sizeof(path)) path_len = (int) sizeof(path) - 1; + memcpy(path, segs[0], (size_t) path_len); + path[path_len] = '\0'; + for (int i = 1; i < nsegs; i++) { int next = help_findsubtopic(idx, segs[i]); if (next < 0) { - const md_topic *parent = &s_topics.data[idx]; const char *closest = help_findclosestsubtopic(idx, segs[i]); - help_hintappend(result, query, closest ? parent->name : NULL, closest); + char suggest[MORPHO_MAX_HELPQUERY_LENGTH]; + if (closest && path_len + 1 + (int) strlen(closest) < (int) sizeof(suggest)) + snprintf(suggest, sizeof(suggest), "%s.%s", path, closest); + else + suggest[0] = '\0'; + help_hintappend(result, query, suggest[0] ? suggest : NULL); return; } idx = next; + if (path_len > 0 && path_len < (int) sizeof(path) - 1) { + path[path_len++] = '.'; + int seglen = (int) strlen(segs[i]); + if (path_len + seglen >= (int) sizeof(path)) seglen = (int) sizeof(path) - 1 - path_len; + if (seglen > 0) { memcpy(path + path_len, segs[i], (size_t) seglen); path_len += seglen; } + path[path_len] = '\0'; + } } varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); } From c8bec1e6302f5e4a2050abdd691c4cf36fa17638 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 20:47:30 -0500 Subject: [PATCH 267/473] Hints for more complex queries --- src/support/help.c | 93 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 91 insertions(+), 2 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 1248581d3..b279af916 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -531,6 +531,55 @@ static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { return nsegs; } +/** Find parent topic index (same file, level < current, block_index < current, largest block_index). */ +static int help_findparent(int idx) { + if (idx < 0 || (unsigned int) idx >= s_topics.count) return -1; + const md_topic *t = &s_topics.data[idx]; + int level = t->level; + if (level <= 1) return -1; + int parent = -1; + unsigned int best_block = 0; + for (unsigned int i = 0; i < s_topics.count; i++) { + if (s_topics.data[i].file_index != t->file_index) continue; + if (s_topics.data[i].level >= level) continue; + if (s_topics.data[i].block_index >= t->block_index) continue; + if (parent < 0 || s_topics.data[i].block_index > best_block) { + parent = (int) i; + best_block = s_topics.data[i].block_index; + } + } + return parent; +} + +/** Write full display path for topic (e.g. "System.clock") into buf. */ +static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { + if (!bufsize || idx < 0 || (unsigned int) idx >= s_topics.count) { if (bufsize) buf[0] = '\0'; return; } + const md_topic *t = &s_topics.data[idx]; + if (!t->name) { buf[0] = '\0'; return; } + int p = (t->level > 1) ? help_findparent(idx) : -1; + if (p >= 0) { + help_topic_displaypath(p, buf, bufsize); + size_t len = strlen(buf); + if (len + 1 < bufsize) snprintf(buf + len, bufsize - len, ".%s", t->name); + } else { + size_t n = strlen(t->name); + if (n >= bufsize) n = bufsize - 1; + memcpy(buf, t->name, n); + buf[n] = '\0'; + } +} + +/** Find all topic indices with given name. Fills indices[] up to max, returns count. */ +#define MORPHO_HELP_MAX_MULTIMATCH 8 +static int help_findallbyname(const char *name, int indices[], int max) { + int n = 0; + for (unsigned int i = 0; i < s_topics.count && n < max; i++) { + if (s_topics.data[i].name && strcmp(s_topics.data[i].name, name) == 0) + indices[n++] = (int) i; + } + return n; +} + /** Find topic index by file and block index. Returns -1 if not found. */ static int help_findtopicbyblock(int file_index, unsigned int block_index) { for (unsigned int i = 0; i < s_topics.count; i++) { @@ -784,8 +833,17 @@ bool morpho_helpastopic(const char *query, help_topic *out) { int nsegs = help_parsequery(query, qbuf, segs); if (nsegs <= 0) return false; - int idx = help_findtopic(&s_topics, segs[0]); - if (idx < 0) return false; + int idx; + if (nsegs == 1) { + int multi[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); + if (n == 0) return false; + if (n >= 2) return false; /* multiple matches: caller will show hint */ + idx = multi[0]; + } else { + idx = help_findtopic(&s_topics, segs[0]); + if (idx < 0) return false; + } /* Resolve remaining segments as subtopics. */ for (int i = 1; i < nsegs; i++) { @@ -811,6 +869,23 @@ static void help_hintappend(varray_char *result, const char *query, const char * if (n > 0 && (size_t) n < sizeof(buf)) varray_charadd(result, buf, n); } +/** Append "Topic 'query' had multiple matches: did you mean 'A' or 'B'?" (or "..., 'A', 'B', or 'C'?"). */ +static void help_hintappend_multi(varray_char *result, const char *query, int indices[], int count) { + char buf[MORPHO_HELP_HINTBUFSIZE]; + char path[MORPHO_MAX_HELPQUERY_LENGTH]; + int n = snprintf(buf, sizeof(buf), "Topic '%s' had multiple matches: did you mean ", query); + for (int i = 0; i < count && n < (int) sizeof(buf) - 4; i++) { + help_topic_displaypath(indices[i], path, sizeof(path)); + if (i == 0) + n += snprintf(buf + n, sizeof(buf) - (size_t) n, "'%s'", path); + else if (i == count - 1) + n += snprintf(buf + n, sizeof(buf) - (size_t) n, " or '%s'?", path); + else + n += snprintf(buf + n, sizeof(buf) - (size_t) n, ", '%s'", path); + } + if (n > 0 && (size_t) n < sizeof(buf)) varray_charadd(result, buf, n); +} + /** Build a hint for a failed query and append to result (caller may clear result first). */ static void help_queryhint(const char *query, varray_char *result) { if (!result) return; @@ -821,6 +896,20 @@ static void help_queryhint(const char *query, varray_char *result) { varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); return; } + if (nsegs == 1) { + int multi[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); + if (n >= 2) { + help_hintappend_multi(result, query, multi, n); + return; + } + if (n == 0) { + help_hintappend(result, query, help_findclosesttopic(segs[0])); + return; + } + varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); + return; + } int idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) { help_hintappend(result, query, help_findclosesttopic(segs[0])); From 194f70886d8fb691164d3344a5cf4cd95351224f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 20:54:24 -0500 Subject: [PATCH 268/473] Improve code legibility --- src/support/help.c | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index b279af916..59dd63c17 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -219,6 +219,7 @@ bool md_parsetext(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->current.start - base); + // Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers while (md_checktexttoken(p)) { parse_advance(p); parserule *rule = parse_getrule(p, p->previous.type); @@ -263,7 +264,7 @@ bool md_parselist(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); /* *, +, or - already consumed */ - /* Reuse text parsing but record as list block */ + // Reuse text parsing (inline rules) but record as list block while (md_checktexttoken(p)) { parse_advance(p); parserule *rule = parse_getrule(p, p->previous.type); @@ -291,13 +292,12 @@ bool md_parselink(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); /* [ already consumed */ + // [ label ] : then rest of line (target) PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); size_t label_start = (size_t)(p->previous.start - base); size_t label_len = p->previous.length; - PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); - size_t target_start = (size_t)(p->current.start - base); PARSE_CHECK(md_parseurl(p, out)); size_t target_end = md_end_previous(p, base); @@ -307,9 +307,10 @@ bool md_parselink(parser *p, void *out) { return true; } -/** Parse a markdown 'block' */ +/** Parse a markdown 'block' */ bool md_parseblock(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; + // Dispatch by first token: text, #/##/###, indent, list, [link], newline, EOF if (md_checktexttoken(p)) { return md_parsetext(p, out); } else if (parse_checktokenadvance(p, MD_HASH)) { @@ -459,7 +460,7 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size md_block_set_header(&b, out->current_header_level, title_start, title_len); varray_md_blockwrite(&out->file->blocks, b); - /* Topic: lowercase name from trimmed title span */ + // Topic: trimmed title span, lowercased, for index lookup size_t ns = title_start, nl = title_len; md_trimspan(base, &ns, &nl); char *name = (char *) MORPHO_MALLOC(nl + 1); @@ -513,6 +514,7 @@ static varray_md_topic s_topics; /** Parse query into lowercased segments in qbuf; segs[] points into qbuf. Returns nsegs (0 if none). */ static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { + // Copy query, lowercase, replace '.' and ' ' with nul size_t qlen = 0; while (query[qlen] && qlen < MORPHO_MAX_HELPQUERY_LENGTH - 1) { char c = query[qlen]; @@ -520,6 +522,7 @@ static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { qlen++; } qbuf[qlen] = '\0'; + // Collect segment start pointers (skip nuls, take runs) int nsegs = 0; const char *p = qbuf; while (nsegs < MORPHO_HELP_QUERY_MAXSEGMENTS && p < qbuf + qlen) { @@ -537,6 +540,7 @@ static int help_findparent(int idx) { const md_topic *t = &s_topics.data[idx]; int level = t->level; if (level <= 1) return -1; + // Same file, strictly earlier block, lower level; keep one with largest block_index int parent = -1; unsigned int best_block = 0; for (unsigned int i = 0; i < s_topics.count; i++) { @@ -558,10 +562,12 @@ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { if (!t->name) { buf[0] = '\0'; return; } int p = (t->level > 1) ? help_findparent(idx) : -1; if (p >= 0) { + // Recurse for parent path, then append ".name" help_topic_displaypath(p, buf, bufsize); size_t len = strlen(buf); if (len + 1 < bufsize) snprintf(buf + len, bufsize - len, ".%s", t->name); } else { + // Top-level or no parent: just the topic name size_t n = strlen(t->name); if (n >= bufsize) n = bufsize - 1; memcpy(buf, t->name, n); @@ -609,10 +615,11 @@ static int help_findsubtopic(int parent_idx, const char *name) { const char *base = file->source; size_t base_len = file->sourcelen; + // Scan blocks after parent; stop when we hit same-or-higher level (left section) for (unsigned int i = parent->block_index + 1; i < file->blocks.count; i++) { const md_block *b = &file->blocks.data[i]; if (b->type != MD_BLOCK_HEADER) continue; - if (b->as.header.level <= parent->level) return -1; /* left section */ + if (b->as.header.level <= parent->level) return -1; // left section size_t start = b->as.header.title.start; size_t len = b->as.header.title.length; if (start + len > base_len) len = base_len - start; @@ -628,6 +635,7 @@ static unsigned int help_editdistance(const char *a, const char *b) { if (na == 0) return (unsigned int) nb; if (nb == 0) return (unsigned int) na; if (na > MORPHO_HELP_EDITMAXLEN || nb > MORPHO_HELP_EDITMAXLEN) return MORPHO_HELP_EDIT_NOMATCH; + // Two-row DP: prev row and current row, swap each iteration unsigned int row0[MORPHO_HELP_EDITMAXLEN + 1], row1[MORPHO_HELP_EDITMAXLEN + 1]; unsigned int *prev = row0, *curr = row1; for (size_t j = 0; j <= nb; j++) prev[j] = (unsigned int) j; @@ -682,6 +690,7 @@ static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_fil unsigned int i = topic->block_index; unsigned int n = file->blocks.count; int level = topic->level; + // Advance until we hit a header at same or higher level (or end of file) while (i < n) { const md_block *b = &file->blocks.data[i]; if (b->type == MD_BLOCK_HEADER && b->as.header.level <= level && i > topic->block_index) @@ -717,13 +726,13 @@ bool help_topictotext(const help_topic *t, varray_char *result) { size_t len = b->span.length; if (b->span.start + len > src_len) len = src_len - b->span.start; + // Per-block: header (title only, no #), paragraph/list/code (span), link/blank skip switch (b->type) { case MD_BLOCK_HEADER: { - /* Skip leading # and space for plain text */ const char *p = src + b->as.header.title.start; size_t tlen = b->as.header.title.length; if (b->as.header.title.start + tlen > src_len) tlen = src_len - b->as.header.title.start; - while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } + while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } // strip leading # and space if (tlen > 0) varray_charadd(result, p, (int) tlen); varray_charadd(result, "\n\n", 2); break; @@ -736,7 +745,7 @@ bool help_topictotext(const help_topic *t, varray_char *result) { break; case MD_BLOCK_LINK_DEF: case MD_BLOCK_BLANK: - break; + break; // omit from plain text } } return true; @@ -761,17 +770,14 @@ bool help_topicrawmd(const help_topic *t, varray_char *result) { bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { error err; error_init(&err); - md_parseout parseout = { .file = file, .topics = topics, .file_index = file_index, .current_header_level = 1 }; - lexer l; help_initializemdlexer(&l, file->source); - parser p; help_initializemdparser(&p, &l, &err, &parseout); bool ok = parse(&p); @@ -796,6 +802,7 @@ bool help_load(char *filename) { return false; } fclose(f); + // Steal buffer into md_file; parse appends topics to s_topics md_file mdfile; md_file_init(&mdfile); mdfile.source = contents.data; @@ -810,7 +817,6 @@ bool help_load(char *filename) { void help_findfiles(void) { varray_value files; varray_valueinit(&files); - if (morpho_listresources(MORPHO_RESOURCE_HELP, &files)) { for (unsigned int i = 0; i < files.count; i++) { if (MORPHO_ISSTRING(files.data[i])) help_load(MORPHO_GETCSTRING(files.data[i])); @@ -818,7 +824,6 @@ void help_findfiles(void) { for (unsigned int i = 0; i < files.count; i++) morpho_freeobject(files.data[i]); } varray_valueclear(&files); - help_sorttopics(&s_topics); } @@ -833,19 +838,20 @@ bool morpho_helpastopic(const char *query, help_topic *out) { int nsegs = help_parsequery(query, qbuf, segs); if (nsegs <= 0) return false; + // Single segment: resolve by name; fail if 0 or multiple matches (caller shows hint) int idx; if (nsegs == 1) { int multi[MORPHO_HELP_MAX_MULTIMATCH]; int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); if (n == 0) return false; - if (n >= 2) return false; /* multiple matches: caller will show hint */ + if (n >= 2) return false; // multiple matches: caller will show hint idx = multi[0]; } else { idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) return false; } - /* Resolve remaining segments as subtopics. */ + // Resolve remaining segments as subtopics for (int i = 1; i < nsegs; i++) { idx = help_findsubtopic(idx, segs[i]); if (idx < 0) return false; @@ -855,7 +861,6 @@ bool morpho_helpastopic(const char *query, help_topic *out) { if (topic->file_index < 0 || (unsigned int) topic->file_index >= s_files.count) return false; const md_file *file = &s_files.data[topic->file_index]; if (topic->block_index >= file->blocks.count) return false; - help_topicfill(out, topic, file); return true; } @@ -874,6 +879,7 @@ static void help_hintappend_multi(varray_char *result, const char *query, int in char buf[MORPHO_HELP_HINTBUFSIZE]; char path[MORPHO_MAX_HELPQUERY_LENGTH]; int n = snprintf(buf, sizeof(buf), "Topic '%s' had multiple matches: did you mean ", query); + // First: "'A'"; middle: ", 'B'"; last: " or 'C'?" for (int i = 0; i < count && n < (int) sizeof(buf) - 4; i++) { help_topic_displaypath(indices[i], path, sizeof(path)); if (i == 0) @@ -896,6 +902,7 @@ static void help_queryhint(const char *query, varray_char *result) { varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); return; } + // Single segment: multi-match hint, or "not found" + closest, or NOTFOUND if (nsegs == 1) { int multi[MORPHO_HELP_MAX_MULTIMATCH]; int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); @@ -910,6 +917,7 @@ static void help_queryhint(const char *query, varray_char *result) { varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); return; } + // Multi-segment: resolve first, then walk subtopics; on first failure suggest path.closest int idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) { help_hintappend(result, query, help_findclosesttopic(segs[0])); @@ -934,6 +942,7 @@ static void help_queryhint(const char *query, varray_char *result) { return; } idx = next; + // Append "." + segs[i] to path for next level if (path_len > 0 && path_len < (int) sizeof(path) - 1) { path[path_len++] = '.'; int seglen = (int) strlen(segs[i]); From 5d8d838f3988764ebdbdb92517104d6a2d27e282 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 21:36:13 -0500 Subject: [PATCH 269/473] Fix queries --- src/support/help.c | 73 +++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 23 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 59dd63c17..d0fd79cf2 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -100,18 +100,13 @@ tokendefn mdtokens[] = { /** Lexer token preprocessor function */ bool md_lexpreprocess(lexer *l, token *tok, error *err) { - // Keep going until we match a token or reach the end - while (!lex_identifytoken(l, false, NULL) && - !lex_isatend(l)) { + while (!lex_identifytoken(l, false, NULL) && !lex_isatend(l)) { lex_advance(l); } - - // If we captured anything, record it as text - if (l->current>l->start) { + if (l->current > l->start) { lex_recordtoken(l, MD_TEXT, tok); return true; } - return false; } @@ -286,23 +281,44 @@ bool md_parseurl(parser *p, void *out) { return true; /* EOF is valid end of link line */ } -/** Parses a markdown link definition [label]: # (optional) ... */ +/** Parses a markdown link definition [label]: # (optional) ... + * The lexer often gives one MD_TEXT for "label]: target" (no separate ] : tokens). + * Accept either: TEXT then ] then : then rest, or one TEXT containing "]: " and split it. */ bool md_parselink(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); /* [ already consumed */ - // [ label ] : then rest of line (target) PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); size_t label_start = (size_t)(p->previous.start - base); size_t label_len = p->previous.length; - PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); - PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); - size_t target_start = (size_t)(p->current.start - base); - PARSE_CHECK(md_parseurl(p, out)); - size_t target_end = md_end_previous(p, base); - size_t target_len = (target_end > target_start) ? (target_end - target_start) : 0; - + size_t target_start; + size_t target_len; + + const char *txt = p->previous.start; + size_t txt_len = p->previous.length; + const char *sep = "]: "; + size_t sep_len = 3; + const char *found = NULL; + if (txt_len >= sep_len) { + for (size_t i = 0; i + sep_len <= txt_len; i++) { + if (memcmp(txt + i, sep, sep_len) == 0) { found = txt + i; break; } + } + } + if (found != NULL) { + label_len = (size_t)(found - txt); + target_start = label_start + label_len + sep_len; + target_len = (txt_len > label_len + sep_len) ? (txt_len - label_len - sep_len) : 0; + if (target_len > 0 && base[target_start + target_len - 1] == '\n') target_len--; + /* Rest of line (and newline) was in the TEXT token; next token is next line */ + } else { + PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); + PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); + target_start = (size_t)(p->current.start - base); + PARSE_CHECK(md_parseurl(p, out)); + size_t target_end = md_end_previous(p, base); + target_len = (target_end > target_start) ? (target_end - target_start) : 0; + } md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } @@ -685,15 +701,14 @@ static const char *help_findclosestsubtopic(int parent_idx, const char *name) { return best; } -/** Number of blocks that form this topic's content (header + following until next same-level or higher header). */ +/** Number of blocks that form this topic's content (header + following until next header of any level). */ static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_file *file) { unsigned int i = topic->block_index; unsigned int n = file->blocks.count; - int level = topic->level; - // Advance until we hit a header at same or higher level (or end of file) + // Advance until we hit any next header (so a # topic doesn't swallow all ## sections) while (i < n) { const md_block *b = &file->blocks.data[i]; - if (b->type == MD_BLOCK_HEADER && b->as.header.level <= level && i > topic->block_index) + if (b->type == MD_BLOCK_HEADER && i > topic->block_index) break; i++; } @@ -802,14 +817,26 @@ bool help_load(char *filename) { return false; } fclose(f); - // Steal buffer into md_file; parse appends topics to s_topics + // Parse appends topics to s_topics with file_index = s_files.count. If parse fails we must + // remove those topics so they don't point at the next file we append. md_file mdfile; md_file_init(&mdfile); mdfile.source = contents.data; mdfile.sourcelen = (contents.count > 0) ? contents.count - 1 : 0; + unsigned int n_topics_before = s_topics.count; bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); - if (ok) varray_md_filewrite(&s_files, mdfile); - else md_file_clear(&mdfile); + if (ok) { + varray_md_filewrite(&s_files, mdfile); + } else { + md_file_clear(&mdfile); + /* Remove topics added during the failed parse; they have file_index = s_files.count */ + while (s_topics.count > n_topics_before) { + md_topic *t = &s_topics.data[s_topics.count - 1]; + if (t->name) MORPHO_FREE(t->name); + t->name = NULL; + s_topics.count--; + } + } return ok; } From fdc06bbafa17838488e18bd851fb31613b73f7f0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 21:48:52 -0500 Subject: [PATCH 270/473] Improve parsing --- src/support/help.c | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index d0fd79cf2..c33619421 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -128,7 +128,7 @@ void help_initializemdlexer(lexer *l, const char *src) { bool md_parseinlinecode(parser *p, void *out) { while (parse_checktokenadvance(p, MD_TEXT)); - parse_checktokenadvance(p, MD_BACKTICK); + parse_checktokenadvance(p, MD_BACKTICK); /* optional closing; unclosed is ok */ return true; } @@ -136,11 +136,10 @@ bool md_parsebold(parser *p, void *out) { while (parse_checktokenadvance(p, MD_TEXT)); if (parse_checktoken(p, MD_ASTERISK2) || parse_checktoken(p, MD_UNDERSCORE2)) parse_advance(p); - return true; } -/** Parses italic: called after consuming opening * or _; consumes TEXT then closing delimiter (same as bold). */ +/** Parses italic: called after consuming opening * or _; consumes TEXT then closing delimiter. */ bool md_parseitalic(parser *p, void *out) { tokentype delim = p->previous.type; /* MD_ASTERISK or MD_UNDERSCORE */ while (parse_checktokenadvance(p, MD_TEXT)); @@ -214,12 +213,16 @@ bool md_parsetext(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->current.start - base); - // Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers + // Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers. + // A leading * or _ is treated as text (list-marker style); we could parse as list item later. while (md_checktexttoken(p)) { parse_advance(p); + size_t tok_start = (size_t)(p->previous.start - base); parserule *rule = parse_getrule(p, p->previous.type); if (rule && rule->prefix) { - if (!rule->prefix(p, out)) return false; + bool leading_asterisk_or_underscore = (tok_start == block_start && + (p->previous.type == MD_ASTERISK || p->previous.type == MD_UNDERSCORE)); + if (!leading_asterisk_or_underscore && !rule->prefix(p, out)) return false; } } PARSE_CHECK(md_parselineend(p)); @@ -227,7 +230,7 @@ bool md_parsetext(parser *p, void *out) { return true; } -/** Parses a markdown header (title then newline or EOF). */ +/** Parses a markdown header (title then newline or EOF). Accepts one or more MD_TEXT tokens for the title. */ bool md_parseheader(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; @@ -236,6 +239,9 @@ bool md_parseheader(parser *p, void *out) { PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); size_t title_start = (size_t)(p->previous.start - base); size_t title_len = p->previous.length; + while (parse_checktokenadvance(p, MD_TEXT)) { + title_len = (size_t)((p->previous.start - base) + p->previous.length - title_start); + } PARSE_CHECK(md_parselineend(p)); md_push_header(p, ctx, block_start, title_start, title_len); @@ -309,7 +315,8 @@ bool md_parselink(parser *p, void *out) { label_len = (size_t)(found - txt); target_start = label_start + label_len + sep_len; target_len = (txt_len > label_len + sep_len) ? (txt_len - label_len - sep_len) : 0; - if (target_len > 0 && base[target_start + target_len - 1] == '\n') target_len--; + while (target_len > 0 && (base[target_start + target_len - 1] == '\n' || base[target_start + target_len - 1] == '\r')) + target_len--; /* Rest of line (and newline) was in the TEXT token; next token is next line */ } else { PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); @@ -817,17 +824,27 @@ bool help_load(char *filename) { return false; } fclose(f); + // Own a copy of the source so each file in s_files has independent storage. + size_t len = (contents.count > 0) ? contents.count - 1 : 0; + char *copy = (char *) MORPHO_MALLOC(len + 1); + if (!copy) { + varray_charclear(&contents); + return false; + } + memcpy(copy, contents.data, len + 1); + varray_charclear(&contents); // Parse appends topics to s_topics with file_index = s_files.count. If parse fails we must // remove those topics so they don't point at the next file we append. md_file mdfile; md_file_init(&mdfile); - mdfile.source = contents.data; - mdfile.sourcelen = (contents.count > 0) ? contents.count - 1 : 0; + mdfile.source = copy; + mdfile.sourcelen = len; unsigned int n_topics_before = s_topics.count; bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); if (ok) { varray_md_filewrite(&s_files, mdfile); } else { + fprintf(stderr, "Help file failed to parse: %s\n", filename); md_file_clear(&mdfile); /* Remove topics added during the failed parse; they have file_index = s_files.count */ while (s_topics.count > n_topics_before) { @@ -870,9 +887,14 @@ bool morpho_helpastopic(const char *query, help_topic *out) { if (nsegs == 1) { int multi[MORPHO_HELP_MAX_MULTIMATCH]; int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); - if (n == 0) return false; - if (n >= 2) return false; // multiple matches: caller will show hint - idx = multi[0]; + if (n == 1) { + idx = multi[0]; + } else if (n == 0) { + idx = help_findtopic(&s_topics, segs[0]); /* fallback: bsearch by name */ + if (idx < 0) return false; + } else { + return false; /* multiple matches: caller will show hint */ + } } else { idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) return false; From 668ece69d59bdd59e6b2fcdea3c32635dea15769 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:04:10 -0500 Subject: [PATCH 271/473] Help parsing errors --- src/support/help.c | 92 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 80 insertions(+), 12 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index c33619421..34d1b4809 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -15,6 +15,7 @@ #include "help.h" #include "resources.h" +#include "error.h" #include "lex.h" #include "parse.h" #include "file.h" @@ -67,6 +68,22 @@ enum { MD_EOF }; +/* Markdown parser error codes (registered in help_initialize) */ +#define MD_UNCLOSEDITALIC "MDUnclItal" +#define MD_UNCLOSEDITALIC_MSG "Unclosed italic (missing closing * or _)." +#define MD_EXPECTLINEEND "MDExpLnEnd" +#define MD_EXPECTLINEEND_MSG "Expected end of line." +#define MD_EXPECTHEADERTEXT "MDExpHdrTxt" +#define MD_EXPECTHEADERTEXT_MSG "Expected header text after #." +#define MD_LINKEXPECTTEXT "MDLnkExpTxt" +#define MD_LINKEXPECTTEXT_MSG "Link definition expects label text after [." +#define MD_LINKEXPECTBRACKET "MDLnkExpBr" +#define MD_LINKEXPECTBRACKET_MSG "Link definition expects ] after label." +#define MD_LINKEXPECTCOLON "MDLnkExpCol" +#define MD_LINKEXPECTCOLON_MSG "Link definition expects : after ]." +#define MD_UNEXPECTEDTOKEN "MDUnexpTok" +#define MD_UNEXPECTEDTOKEN_MSG "Unexpected markdown token." + bool md_lexnewline(lexer *l, token *tok, error *err) { lex_newline(l); return true; @@ -143,7 +160,11 @@ bool md_parsebold(parser *p, void *out) { bool md_parseitalic(parser *p, void *out) { tokentype delim = p->previous.type; /* MD_ASTERISK or MD_UNDERSCORE */ while (parse_checktokenadvance(p, MD_TEXT)); - return parse_checktokenadvance(p, delim); + if (!parse_checktokenadvance(p, delim)) { + parse_error(p, false, MD_UNCLOSEDITALIC); + return false; + } + return true; } parserule md_rules[] = { @@ -225,7 +246,10 @@ bool md_parsetext(parser *p, void *out) { if (!leading_asterisk_or_underscore && !rule->prefix(p, out)) return false; } } - PARSE_CHECK(md_parselineend(p)); + if (!md_parselineend(p)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; + } md_push_paragraph(p, ctx, block_start); return true; } @@ -236,14 +260,20 @@ bool md_parseheader(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); /* # token already consumed */ - PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + if (!parse_checktokenadvance(p, MD_TEXT)) { + parse_error(p, false, MD_EXPECTHEADERTEXT); + return false; + } size_t title_start = (size_t)(p->previous.start - base); size_t title_len = p->previous.length; while (parse_checktokenadvance(p, MD_TEXT)) { title_len = (size_t)((p->previous.start - base) + p->previous.length - title_start); } - PARSE_CHECK(md_parselineend(p)); + if (!md_parselineend(p)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; + } md_push_header(p, ctx, block_start, title_start, title_len); return true; } @@ -254,7 +284,10 @@ bool md_parsecode(parser *p, void *out) { size_t block_start = (size_t)(p->previous.start - ctx->file->source); /* 4 spaces / tab already consumed */ while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) parse_advance(p); - PARSE_CHECK(md_parselineend(p)); + if (!md_parselineend(p)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; + } md_push_code(p, ctx, block_start); return true; } @@ -273,7 +306,10 @@ bool md_parselist(parser *p, void *out) { if (!rule->prefix(p, out)) return false; } } - PARSE_CHECK(md_parselineend(p)); + if (!md_parselineend(p)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; + } md_push_list(p, ctx, block_start); return true; } @@ -295,7 +331,10 @@ bool md_parselink(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); /* [ already consumed */ - PARSE_CHECK(parse_checktokenadvance(p, MD_TEXT)); + if (!parse_checktokenadvance(p, MD_TEXT)) { + parse_error(p, false, MD_LINKEXPECTTEXT); + return false; + } size_t label_start = (size_t)(p->previous.start - base); size_t label_len = p->previous.length; size_t target_start; @@ -319,10 +358,19 @@ bool md_parselink(parser *p, void *out) { target_len--; /* Rest of line (and newline) was in the TEXT token; next token is next line */ } else { - PARSE_CHECK(parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)); - PARSE_CHECK(parse_checktokenadvance(p, MD_COLON)); + if (!parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)) { + parse_error(p, false, MD_LINKEXPECTBRACKET); + return false; + } + if (!parse_checktokenadvance(p, MD_COLON)) { + parse_error(p, false, MD_LINKEXPECTCOLON); + return false; + } target_start = (size_t)(p->current.start - base); - PARSE_CHECK(md_parseurl(p, out)); + if (!md_parseurl(p, out)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; + } size_t target_end = md_end_previous(p, base); target_len = (target_end > target_start) ? (target_end - target_start) : 0; } @@ -359,9 +407,9 @@ bool md_parseblock(parser *p, void *out) { } else if (parse_checktoken(p, MD_EOF)) { return true; /* let outer loop exit */ } else { - UNREACHABLE("Unrecognized token."); + parse_error(p, false, MD_UNEXPECTEDTOKEN); + return false; } - return false; } /** Base markdown parse type */ @@ -805,6 +853,17 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { bool ok = parse(&p); parse_clear(&p); lex_clear(&l); + if (!ok && morpho_checkerror(&err)) { + fprintf(stderr, "Help parse error [%s]: %s", err.id ? err.id : "?", err.msg); + if (err.line != ERROR_POSNUNIDENTIFIABLE || err.posn != ERROR_POSNUNIDENTIFIABLE) { + fprintf(stderr, " ("); + if (err.line != ERROR_POSNUNIDENTIFIABLE) fprintf(stderr, "line %d", err.line); + if (err.posn != ERROR_POSNUNIDENTIFIABLE) + fprintf(stderr, "%sposition %d", err.line != ERROR_POSNUNIDENTIFIABLE ? ", " : "", err.posn); + fprintf(stderr, ")"); + } + fprintf(stderr, "\n"); + } return ok; } @@ -1023,6 +1082,15 @@ bool morpho_helpasmd(char *query, varray_char *result) { /** @brief Initialize help system */ void help_initialize(void) { + /* Markdown parser errors */ + morpho_defineerror(MD_UNCLOSEDITALIC, ERROR_PARSE, MD_UNCLOSEDITALIC_MSG); + morpho_defineerror(MD_EXPECTLINEEND, ERROR_PARSE, MD_EXPECTLINEEND_MSG); + morpho_defineerror(MD_EXPECTHEADERTEXT, ERROR_PARSE, MD_EXPECTHEADERTEXT_MSG); + morpho_defineerror(MD_LINKEXPECTTEXT, ERROR_PARSE, MD_LINKEXPECTTEXT_MSG); + morpho_defineerror(MD_LINKEXPECTBRACKET, ERROR_PARSE, MD_LINKEXPECTBRACKET_MSG); + morpho_defineerror(MD_LINKEXPECTCOLON, ERROR_PARSE, MD_LINKEXPECTCOLON_MSG); + morpho_defineerror(MD_UNEXPECTEDTOKEN, ERROR_PARSE, MD_UNEXPECTEDTOKEN_MSG); + varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); help_findfiles(); From 1522e0f96aed995fb2b8e987d3058c8b9c85f606 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:23:18 -0500 Subject: [PATCH 272/473] Fix inline code parsing --- src/support/help.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 34d1b4809..c26b04c2b 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -71,6 +71,8 @@ enum { /* Markdown parser error codes (registered in help_initialize) */ #define MD_UNCLOSEDITALIC "MDUnclItal" #define MD_UNCLOSEDITALIC_MSG "Unclosed italic (missing closing * or _)." +#define MD_UNCLOSEDINLINECODE "MDUnclCode" +#define MD_UNCLOSEDINLINECODE_MSG "Unclosed inline code (missing closing `)." #define MD_EXPECTLINEEND "MDExpLnEnd" #define MD_EXPECTLINEEND_MSG "Expected end of line." #define MD_EXPECTHEADERTEXT "MDExpHdrTxt" @@ -143,9 +145,14 @@ void help_initializemdlexer(lexer *l, const char *src) { * Markdown parse table (for inline syntax) * ------------------------------------------------------- */ +/** Parses inline code span. Content is ignored until closing backtick. */ bool md_parseinlinecode(parser *p, void *out) { - while (parse_checktokenadvance(p, MD_TEXT)); - parse_checktokenadvance(p, MD_BACKTICK); /* optional closing; unclosed is ok */ + while (!parse_checktoken(p, MD_BACKTICK) && !parse_checktoken(p, MD_EOF)) + parse_advance(p); + if (!parse_checktokenadvance(p, MD_BACKTICK)) { + parse_error(p, false, MD_UNCLOSEDINLINECODE); + return false; + } return true; } @@ -1084,6 +1091,7 @@ bool morpho_helpasmd(char *query, varray_char *result) { void help_initialize(void) { /* Markdown parser errors */ morpho_defineerror(MD_UNCLOSEDITALIC, ERROR_PARSE, MD_UNCLOSEDITALIC_MSG); + morpho_defineerror(MD_UNCLOSEDINLINECODE, ERROR_PARSE, MD_UNCLOSEDINLINECODE_MSG); morpho_defineerror(MD_EXPECTLINEEND, ERROR_PARSE, MD_EXPECTLINEEND_MSG); morpho_defineerror(MD_EXPECTHEADERTEXT, ERROR_PARSE, MD_EXPECTHEADERTEXT_MSG); morpho_defineerror(MD_LINKEXPECTTEXT, ERROR_PARSE, MD_LINKEXPECTTEXT_MSG); From 3ea2e14dac1d1d2f60dd2306eaf2fb21bbdfea49 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:29:40 -0500 Subject: [PATCH 273/473] Correct error reporting --- src/support/help.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index c26b04c2b..511a09fed 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -864,9 +864,9 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { fprintf(stderr, "Help parse error [%s]: %s", err.id ? err.id : "?", err.msg); if (err.line != ERROR_POSNUNIDENTIFIABLE || err.posn != ERROR_POSNUNIDENTIFIABLE) { fprintf(stderr, " ("); - if (err.line != ERROR_POSNUNIDENTIFIABLE) fprintf(stderr, "line %d", err.line); + if (err.line != ERROR_POSNUNIDENTIFIABLE) fprintf(stderr, "line %d", err.line + 1); if (err.posn != ERROR_POSNUNIDENTIFIABLE) - fprintf(stderr, "%sposition %d", err.line != ERROR_POSNUNIDENTIFIABLE ? ", " : "", err.posn); + fprintf(stderr, "%sposition %d", err.line != ERROR_POSNUNIDENTIFIABLE ? ", " : "", err.posn + 1); fprintf(stderr, ")"); } fprintf(stderr, "\n"); From 927dcc147acd6b9ec492783ffcd61e81b6442186 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:38:17 -0500 Subject: [PATCH 274/473] Allow literals in text --- src/support/help.c | 64 +++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 511a09fed..27aba5268 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -231,29 +231,47 @@ tokentype _inlinetokens[] = { }; int _ninlinetokens = sizeof(_inlinetokens)/sizeof(tokentype); +/** Token types that can appear literally in paragraph/list text (consumed without inline rules). */ +tokentype _literalintext[] = { + MD_HASH, MD_HASH2, MD_HASH3, MD_LEFTSQUAREBRACE, MD_RIGHTSQUAREBRACE, + MD_FOURSPACES, MD_TAB, MD_PLUS, MD_DASH +}; +int _nliteralintext = sizeof(_literalintext)/sizeof(tokentype); + bool md_checktexttoken(parser *p) { return parse_checktokenmulti(p, _ninlinetokens, _inlinetokens); } +/** True if current token can be consumed as literal in paragraph/list (no prefix rule). */ +static bool md_checkliteralintext(parser *p) { + return parse_checktokenmulti(p, _nliteralintext, _literalintext); +} + /** Parses text written in markdown; stops at a non-textual token. Line ends with NEWLINE or EOF. */ bool md_parsetext(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; size_t block_start = (size_t)(p->current.start - base); - // Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers. - // A leading * or _ is treated as text (list-marker style); we could parse as list item later. - while (md_checktexttoken(p)) { - parse_advance(p); - size_t tok_start = (size_t)(p->previous.start - base); - parserule *rule = parse_getrule(p, p->previous.type); - if (rule && rule->prefix) { - bool leading_asterisk_or_underscore = (tok_start == block_start && - (p->previous.type == MD_ASTERISK || p->previous.type == MD_UNDERSCORE)); - if (!leading_asterisk_or_underscore && !rule->prefix(p, out)) return false; + for (;;) { + // Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers. + // A leading * or _ is treated as text (list-marker style); we could parse as list item later. + while (md_checktexttoken(p)) { + parse_advance(p); + size_t tok_start = (size_t)(p->previous.start - base); + parserule *rule = parse_getrule(p, p->previous.type); + if (rule && rule->prefix) { + bool leading_asterisk_or_underscore = (tok_start == block_start && + (p->previous.type == MD_ASTERISK || p->previous.type == MD_UNDERSCORE)); + if (!leading_asterisk_or_underscore && !rule->prefix(p, out)) return false; + } + } + if (md_parselineend(p)) break; + // Allow block-style tokens to appear literally in prose (e.g. "+" in "minimization + retriangulation"). + if (md_checkliteralintext(p)) { + parse_advance(p); + continue; } - } - if (!md_parselineend(p)) { parse_error(p, true, MD_EXPECTLINEEND); return false; } @@ -305,15 +323,21 @@ bool md_parselist(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); /* *, +, or - already consumed */ - // Reuse text parsing (inline rules) but record as list block - while (md_checktexttoken(p)) { - parse_advance(p); - parserule *rule = parse_getrule(p, p->previous.type); - if (rule && rule->prefix) { - if (!rule->prefix(p, out)) return false; + for (;;) { + // Reuse text parsing (inline rules) but record as list block + while (md_checktexttoken(p)) { + parse_advance(p); + parserule *rule = parse_getrule(p, p->previous.type); + if (rule && rule->prefix) { + if (!rule->prefix(p, out)) return false; + } + } + if (md_parselineend(p)) break; + // Allow block-style tokens literally in list item (e.g. "+" in "minimization + retriangulation"). + if (md_checkliteralintext(p)) { + parse_advance(p); + continue; } - } - if (!md_parselineend(p)) { parse_error(p, true, MD_EXPECTLINEEND); return false; } From 1b03d19ccf61efed8bf815f9b64c442d44fb9202 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 22:54:06 -0500 Subject: [PATCH 275/473] Correct order for parseblock --- src/support/help.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 27aba5268..5e414b0ab 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -412,10 +412,8 @@ bool md_parselink(parser *p, void *out) { /** Parse a markdown 'block' */ bool md_parseblock(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; - // Dispatch by first token: text, #/##/###, indent, list, [link], newline, EOF - if (md_checktexttoken(p)) { - return md_parsetext(p, out); - } else if (parse_checktokenadvance(p, MD_HASH)) { + /* Dispatch by first token. Check block-start alternatives first. */ + if (parse_checktokenadvance(p, MD_HASH)) { ctx->current_header_level = 1; return md_parseheader(p, out); } else if (parse_checktokenadvance(p, MD_HASH2)) { @@ -427,16 +425,24 @@ bool md_parseblock(parser *p, void *out) { } else if (parse_checktokenadvance(p, MD_FOURSPACES) || parse_checktokenadvance(p, MD_TAB)) { return md_parsecode(p, out); - } else if (parse_checktokenadvance(p, MD_ASTERISK) || - parse_checktokenadvance(p, MD_PLUS) || - parse_checktokenadvance(p, MD_DASH)) { - return md_parselist(p, out); + } else if (parse_checktoken(p, MD_ASTERISK) || + parse_checktoken(p, MD_PLUS) || + parse_checktoken(p, MD_DASH)) { + /* CommonMark: list marker must be followed by space or tab; else treat as paragraph (e.g. *Goodbye* italic). */ + char c = lex_peekahead(p->lex, p->current.length); + if (c == ' ' || c == '\t') { + parse_advance(p); + return md_parselist(p, out); + } + return md_parsetext(p, out); } else if (parse_checktokenadvance(p, MD_LEFTSQUAREBRACE)) { return md_parselink(p, out); } else if (parse_checktokenadvance(p, MD_NEWLINE)) { /* blank line */ return true; } else if (parse_checktoken(p, MD_EOF)) { return true; /* let outer loop exit */ + } else if (md_checktexttoken(p)) { + return md_parsetext(p, out); } else { parse_error(p, false, MD_UNEXPECTEDTOKEN); return false; From ba45f304e3239f0a8e51e275e9dc112b8bd456f2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:01:16 -0500 Subject: [PATCH 276/473] Fix text consumption --- src/support/help.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 5e414b0ab..466479471 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -254,17 +254,11 @@ bool md_parsetext(parser *p, void *out) { size_t block_start = (size_t)(p->current.start - base); for (;;) { - // Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers. - // A leading * or _ is treated as text (list-marker style); we could parse as list item later. + /* Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers. */ while (md_checktexttoken(p)) { parse_advance(p); - size_t tok_start = (size_t)(p->previous.start - base); parserule *rule = parse_getrule(p, p->previous.type); - if (rule && rule->prefix) { - bool leading_asterisk_or_underscore = (tok_start == block_start && - (p->previous.type == MD_ASTERISK || p->previous.type == MD_UNDERSCORE)); - if (!leading_asterisk_or_underscore && !rule->prefix(p, out)) return false; - } + if (rule && rule->prefix && !rule->prefix(p, out)) return false; } if (md_parselineend(p)) break; // Allow block-style tokens to appear literally in prose (e.g. "+" in "minimization + retriangulation"). From 0722676e38ea261753dda7e722af53e7c8c7569b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:04:31 -0500 Subject: [PATCH 277/473] Correctly handle lists --- src/support/help.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 466479471..20edc8aca 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -422,8 +422,8 @@ bool md_parseblock(parser *p, void *out) { } else if (parse_checktoken(p, MD_ASTERISK) || parse_checktoken(p, MD_PLUS) || parse_checktoken(p, MD_DASH)) { - /* CommonMark: list marker must be followed by space or tab; else treat as paragraph (e.g. *Goodbye* italic). */ - char c = lex_peekahead(p->lex, p->current.length); + /* CommonMark: list marker must be followed by space or tab; else treat as paragraph. */ + char c = lex_peek(p->lex); if (c == ' ' || c == '\t') { parse_advance(p); return md_parselist(p, out); From 594b27930b9e507c3d9425be3e35199c95e6dc48 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:09:02 -0500 Subject: [PATCH 278/473] Update matrix.md --- help/matrix.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/help/matrix.md b/help/matrix.md index 6e28fa063..4adc1befd 100644 --- a/help/matrix.md +++ b/help/matrix.md @@ -46,7 +46,7 @@ The division operator is used to solve a linear system, e.g. print b/a -yields the solution to the system a*x = b. +yields the solution to the system `a*x = b`. [showsubtopics]: # (subtopics) @@ -116,7 +116,7 @@ Returns the inverse of a matrix if it is invertible. Raises a var m = Matrix([[1,2],[3,4]]) var mi = m.inverse() -yields the inverse of the matrix `m`, such that mi*m is the identity +yields the inverse of the matrix `m`, such that `mi*m` is the identity matrix. ## Norm From 476fa0d96aeed5ef75bebb6d7731dce470f5d8df Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:15:08 -0500 Subject: [PATCH 279/473] Clean link definition --- src/support/help.c | 101 ++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 20edc8aca..c55a26cb0 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -348,13 +348,49 @@ bool md_parseurl(parser *p, void *out) { return true; /* EOF is valid end of link line */ } -/** Parses a markdown link definition [label]: # (optional) ... - * The lexer often gives one MD_TEXT for "label]: target" (no separate ] : tokens). - * Accept either: TEXT then ] then : then rest, or one TEXT containing "]: " and split it. */ +/** Parses inline link [text](url)... after [ and label and ] are consumed. Consumes ( url ) and rest of line, pushes paragraph. */ +static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { + md_parseout *ctx = (md_parseout *) out; + parse_advance(p); /* consume ( */ + while (!parse_checktoken(p, MD_RIGHTPAREN) && !parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) + parse_advance(p); + if (!parse_checktokenadvance(p, MD_RIGHTPAREN)) { + parse_error(p, false, MD_LINKEXPECTBRACKET); + return false; + } + while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) + parse_advance(p); + if (!md_parselineend(p)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; + } + md_push_paragraph(p, ctx, block_start); + return true; +} + +/** Link definition: label and target in one TEXT token (e.g. "tag]: # (target)"). Returns true if found and sets *target_* out params. */ +static bool md_link_def_in_one_token(const char *base, const char *txt, size_t txt_len, size_t label_start, + size_t *label_len, size_t *target_start, size_t *target_len) { + const char *sep = "]: "; + const size_t sep_len = 3; + if (txt_len < sep_len) return false; + for (size_t i = 0; i + sep_len <= txt_len; i++) { + if (memcmp(txt + i, sep, sep_len) != 0) continue; + *label_len = i; + *target_start = label_start + i + sep_len; + *target_len = (txt_len > i + sep_len) ? (txt_len - i - sep_len) : 0; + while (*target_len > 0 && (base[*target_start + *target_len - 1] == '\n' || base[*target_start + *target_len - 1] == '\r')) + (*target_len)--; + return true; + } + return false; +} + +/** Parses [label]: target (link def) or [text](url) (inline link). Caller has already consumed [. */ bool md_parselink(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; - size_t block_start = (size_t)(p->previous.start - base); /* [ already consumed */ + size_t block_start = (size_t)(p->previous.start - base); if (!parse_checktokenadvance(p, MD_TEXT)) { parse_error(p, false, MD_LINKEXPECTTEXT); @@ -362,43 +398,32 @@ bool md_parselink(parser *p, void *out) { } size_t label_start = (size_t)(p->previous.start - base); size_t label_len = p->previous.length; - size_t target_start; - size_t target_len; + size_t target_start, target_len; - const char *txt = p->previous.start; - size_t txt_len = p->previous.length; - const char *sep = "]: "; - size_t sep_len = 3; - const char *found = NULL; - if (txt_len >= sep_len) { - for (size_t i = 0; i + sep_len <= txt_len; i++) { - if (memcmp(txt + i, sep, sep_len) == 0) { found = txt + i; break; } - } + /* Link def in one token: "label]: target" */ + if (md_link_def_in_one_token(base, p->previous.start, p->previous.length, label_start, &label_len, &target_start, &target_len)) { + md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); + return true; } - if (found != NULL) { - label_len = (size_t)(found - txt); - target_start = label_start + label_len + sep_len; - target_len = (txt_len > label_len + sep_len) ? (txt_len - label_len - sep_len) : 0; - while (target_len > 0 && (base[target_start + target_len - 1] == '\n' || base[target_start + target_len - 1] == '\r')) - target_len--; - /* Rest of line (and newline) was in the TEXT token; next token is next line */ - } else { - if (!parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)) { - parse_error(p, false, MD_LINKEXPECTBRACKET); - return false; - } - if (!parse_checktokenadvance(p, MD_COLON)) { - parse_error(p, false, MD_LINKEXPECTCOLON); - return false; - } - target_start = (size_t)(p->current.start - base); - if (!md_parseurl(p, out)) { - parse_error(p, true, MD_EXPECTLINEEND); - return false; - } - size_t target_end = md_end_previous(p, base); - target_len = (target_end > target_start) ? (target_end - target_start) : 0; + + if (!parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)) { + parse_error(p, false, MD_LINKEXPECTBRACKET); + return false; + } + if (parse_checktoken(p, MD_LEFTPAREN)) + return md_parseinlinelink(p, out, block_start); + + if (!parse_checktokenadvance(p, MD_COLON)) { + parse_error(p, false, MD_LINKEXPECTCOLON); + return false; + } + target_start = (size_t)(p->current.start - base); + if (!md_parseurl(p, out)) { + parse_error(p, true, MD_EXPECTLINEEND); + return false; } + size_t target_end = md_end_previous(p, base); + target_len = target_end > target_start ? (size_t)(target_end - target_start) : 0; md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } From 4d685c327b077fbe09a25fa3fd71450c1262c5ed Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:20:48 -0500 Subject: [PATCH 280/473] Simplify link parsing --- src/support/help.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index c55a26cb0..6d241dba9 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -368,25 +368,7 @@ static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { return true; } -/** Link definition: label and target in one TEXT token (e.g. "tag]: # (target)"). Returns true if found and sets *target_* out params. */ -static bool md_link_def_in_one_token(const char *base, const char *txt, size_t txt_len, size_t label_start, - size_t *label_len, size_t *target_start, size_t *target_len) { - const char *sep = "]: "; - const size_t sep_len = 3; - if (txt_len < sep_len) return false; - for (size_t i = 0; i + sep_len <= txt_len; i++) { - if (memcmp(txt + i, sep, sep_len) != 0) continue; - *label_len = i; - *target_start = label_start + i + sep_len; - *target_len = (txt_len > i + sep_len) ? (txt_len - i - sep_len) : 0; - while (*target_len > 0 && (base[*target_start + *target_len - 1] == '\n' || base[*target_start + *target_len - 1] == '\r')) - (*target_len)--; - return true; - } - return false; -} - -/** Parses [label]: target (link def) or [text](url) (inline link). Caller has already consumed [. */ +/** Parses [label]: target (link def) or [text](url) an inline link. Caller has already consumed [. */ bool md_parselink(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; @@ -398,32 +380,24 @@ bool md_parselink(parser *p, void *out) { } size_t label_start = (size_t)(p->previous.start - base); size_t label_len = p->previous.length; - size_t target_start, target_len; - - /* Link def in one token: "label]: target" */ - if (md_link_def_in_one_token(base, p->previous.start, p->previous.length, label_start, &label_len, &target_start, &target_len)) { - md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); - return true; - } if (!parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)) { parse_error(p, false, MD_LINKEXPECTBRACKET); return false; } - if (parse_checktoken(p, MD_LEFTPAREN)) - return md_parseinlinelink(p, out, block_start); + if (parse_checktoken(p, MD_LEFTPAREN)) return md_parseinlinelink(p, out, block_start); if (!parse_checktokenadvance(p, MD_COLON)) { parse_error(p, false, MD_LINKEXPECTCOLON); return false; } - target_start = (size_t)(p->current.start - base); + size_t target_start = (size_t)(p->current.start - base); if (!md_parseurl(p, out)) { parse_error(p, true, MD_EXPECTLINEEND); return false; } size_t target_end = md_end_previous(p, base); - target_len = target_end > target_start ? (size_t)(target_end - target_start) : 0; + size_t target_len = target_end > target_start ? (size_t)(target_end - target_start) : 0; md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } From e30325c5504091a0cea7d493a2d9f73fdf6e33e2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:22:11 -0500 Subject: [PATCH 281/473] Update functionals.md --- help/functionals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help/functionals.md b/help/functionals.md index e4048b15a..69565106c 100644 --- a/help/functionals.md +++ b/help/functionals.md @@ -282,7 +282,7 @@ See the `Functionals` entry for general information about functionals. The `AreaIntegral` functional computes the area integral of a function. You supply an integrand function that takes a position matrix as an argument. -To compute integral(x*y) over an area element: +To compute `integral(x*y)` over an area element: var la=AreaIntegral(fn (x) x[0]*x[1]) From cbcdf224f8bea5c9499a54b5d1471b389f7e73cf Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:23:52 -0500 Subject: [PATCH 282/473] Update syntax.md --- help/syntax.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/help/syntax.md b/help/syntax.md index b7c185939..69a9ed1d7 100644 --- a/help/syntax.md +++ b/help/syntax.md @@ -38,7 +38,7 @@ enabling the programmer to quickly comment out a section of code. [tagsymbols]: # (symbols) [tagnames]: # (names) -Symbols are used to refer to named entities, including variables, classes, functions etc. Symbols must begin with a letter or underscore _ as the first character and may include letters or numbers as the remainder. Symbols are case sensitive. +Symbols are used to refer to named entities, including variables, classes, functions etc. Symbols must begin with a letter or underscore `_` as the first character and may include letters or numbers as the remainder. Symbols are case sensitive. asymbol _alsoasymbol From 7e99f449c2fb91aafc2cd4d0efbed9eb4eebaa5f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:33:48 -0500 Subject: [PATCH 283/473] Lazy loading of help --- src/support/help.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index 6d241dba9..917fe1d8f 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -964,8 +964,14 @@ void help_findfiles(void) { * Help API * ********************************************************************** */ +static bool s_help_files_loaded = false; + /** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ bool morpho_helpastopic(const char *query, help_topic *out) { + if (!s_help_files_loaded) { // Load help files on first use + help_findfiles(); + s_help_files_loaded = true; + } char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; int nsegs = help_parsequery(query, qbuf, segs); @@ -1124,7 +1130,6 @@ void help_initialize(void) { varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); - help_findfiles(); morpho_addfinalizefn(help_finalize); } From c9b85a7747f6c639495e377c48463cb421cc4c78 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Feb 2026 23:39:03 -0500 Subject: [PATCH 284/473] Simplify file loading --- src/support/help.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 917fe1d8f..3a88e374f 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -913,20 +913,11 @@ bool help_load(char *filename) { return false; } fclose(f); - // Own a copy of the source so each file in s_files has independent storage. + /* Keep contents.data; mdfile will own it (freed in md_file_clear). Do not clear contents. */ size_t len = (contents.count > 0) ? contents.count - 1 : 0; - char *copy = (char *) MORPHO_MALLOC(len + 1); - if (!copy) { - varray_charclear(&contents); - return false; - } - memcpy(copy, contents.data, len + 1); - varray_charclear(&contents); - // Parse appends topics to s_topics with file_index = s_files.count. If parse fails we must - // remove those topics so they don't point at the next file we append. md_file mdfile; md_file_init(&mdfile); - mdfile.source = copy; + mdfile.source = contents.data; mdfile.sourcelen = len; unsigned int n_topics_before = s_topics.count; bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); From 20c76b91819061bd22661c4f358362298cd2489d Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 07:41:11 -0500 Subject: [PATCH 285/473] Fix literal parsing in header --- src/support/help.c | 48 +++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 3a88e374f..eac221b84 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -247,6 +247,24 @@ static bool md_checkliteralintext(parser *p) { return parse_checktokenmulti(p, _nliteralintext, _literalintext); } +/** Consume text content tokens (MD_TEXT and literal tokens like - : etc.). + * If apply_inline_rules is true, applies inline formatting rules (bold/italic/code) to MD_TEXT tokens. + * Returns true if we should continue consuming (more text/literal available), false if we hit non-text/non-literal. */ +static bool md_consumetextcontent(parser *p, bool apply_inline_rules, void *out) { + if (md_checktexttoken(p)) { + parse_advance(p); + if (apply_inline_rules) { + parserule *rule = parse_getrule(p, p->previous.type); + if (rule && rule->prefix && !rule->prefix(p, out)) return false; + } + return true; + } else if (md_checkliteralintext(p)) { + parse_advance(p); + return true; + } + return false; +} + /** Parses text written in markdown; stops at a non-textual token. Line ends with NEWLINE or EOF. */ bool md_parsetext(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; @@ -254,18 +272,8 @@ bool md_parsetext(parser *p, void *out) { size_t block_start = (size_t)(p->current.start - base); for (;;) { - /* Consume text tokens, applying inline rules (bold, italic, code) via prefix handlers. */ - while (md_checktexttoken(p)) { - parse_advance(p); - parserule *rule = parse_getrule(p, p->previous.type); - if (rule && rule->prefix && !rule->prefix(p, out)) return false; - } + while (md_consumetextcontent(p, true, out)); if (md_parselineend(p)) break; - // Allow block-style tokens to appear literally in prose (e.g. "+" in "minimization + retriangulation"). - if (md_checkliteralintext(p)) { - parse_advance(p); - continue; - } parse_error(p, true, MD_EXPECTLINEEND); return false; } @@ -273,7 +281,7 @@ bool md_parsetext(parser *p, void *out) { return true; } -/** Parses a markdown header (title then newline or EOF). Accepts one or more MD_TEXT tokens for the title. */ +/** Parses a markdown header (title then newline or EOF). Accepts MD_TEXT and literal tokens (e.g. - for hyphen) for the title. */ bool md_parseheader(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; @@ -285,7 +293,7 @@ bool md_parseheader(parser *p, void *out) { } size_t title_start = (size_t)(p->previous.start - base); size_t title_len = p->previous.length; - while (parse_checktokenadvance(p, MD_TEXT)) { + while (md_consumetextcontent(p, false, out)) { title_len = (size_t)((p->previous.start - base) + p->previous.length - title_start); } @@ -318,20 +326,8 @@ bool md_parselist(parser *p, void *out) { size_t block_start = (size_t)(p->previous.start - base); /* *, +, or - already consumed */ for (;;) { - // Reuse text parsing (inline rules) but record as list block - while (md_checktexttoken(p)) { - parse_advance(p); - parserule *rule = parse_getrule(p, p->previous.type); - if (rule && rule->prefix) { - if (!rule->prefix(p, out)) return false; - } - } + while (md_consumetextcontent(p, true, out)); if (md_parselineend(p)) break; - // Allow block-style tokens literally in list item (e.g. "+" in "minimization + retriangulation"). - if (md_checkliteralintext(p)) { - parse_advance(p); - continue; - } parse_error(p, true, MD_EXPECTLINEEND); return false; } From 378688d1ebb2b966f615bf3555e02495fbfd315a Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 08:17:21 -0500 Subject: [PATCH 286/473] Escaped literals --- src/support/help.c | 49 +++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index eac221b84..7febe5108 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -117,9 +117,27 @@ tokendefn mdtokens[] = { { "", TOKEN_NONE , NULL } }; +/** Check if a character is ASCII punctuation (CommonMark spec 2.4: escapable with backslash). */ +static bool md_isasciipunct(char c) { + return (unsigned char)c <= 0x7F && ispunct((unsigned char)c); +} + /** Lexer token preprocessor function */ bool md_lexpreprocess(lexer *l, token *tok, error *err) { while (!lex_identifytoken(l, false, NULL) && !lex_isatend(l)) { + char c = lex_peek(l); + if (c == '\\') { + char next = lex_peekahead(l, 1); + if (md_isasciipunct(next)) { + lex_advance(l); // Skip \ and include punctuation as literal + lex_advance(l); + continue; + } else if (next == '\n' || next == '\r' || next == '\0') { + lex_advance(l); // Skip \; newline will be tokenized as MD_NEWLINE in next iteration + continue; + } + // Backslash before non-punctuation: include \ as literal + } lex_advance(l); } if (l->current > l->start) { @@ -165,7 +183,7 @@ bool md_parsebold(parser *p, void *out) { /** Parses italic: called after consuming opening * or _; consumes TEXT then closing delimiter. */ bool md_parseitalic(parser *p, void *out) { - tokentype delim = p->previous.type; /* MD_ASTERISK or MD_UNDERSCORE */ + tokentype delim = p->previous.type; // MD_ASTERISK or MD_UNDERSCORE while (parse_checktokenadvance(p, MD_TEXT)); if (!parse_checktokenadvance(p, delim)) { parse_error(p, false, MD_UNCLOSEDITALIC); @@ -192,7 +210,7 @@ typedef struct { md_file *file; varray_md_topic *topics; int file_index; - int current_header_level; /* 1–3, set before md_parseheader */ + int current_header_level; // 1–3, set before md_parseheader } md_parseout; static void md_push_header(parser *p, md_parseout *out, size_t block_start, size_t title_start, size_t title_len); @@ -285,7 +303,7 @@ bool md_parsetext(parser *p, void *out) { bool md_parseheader(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; - size_t block_start = (size_t)(p->previous.start - base); /* # token already consumed */ + size_t block_start = (size_t)(p->previous.start - base); // # token already consumed if (!parse_checktokenadvance(p, MD_TEXT)) { parse_error(p, false, MD_EXPECTHEADERTEXT); @@ -308,7 +326,7 @@ bool md_parseheader(parser *p, void *out) { /** Parses markdown code block (indented lines until newline or EOF). */ bool md_parsecode(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; - size_t block_start = (size_t)(p->previous.start - ctx->file->source); /* 4 spaces / tab already consumed */ + size_t block_start = (size_t)(p->previous.start - ctx->file->source); // 4 spaces / tab already consumed while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) parse_advance(p); if (!md_parselineend(p)) { @@ -323,7 +341,7 @@ bool md_parsecode(parser *p, void *out) { bool md_parselist(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; const char *base = ctx->file->source; - size_t block_start = (size_t)(p->previous.start - base); /* *, +, or - already consumed */ + size_t block_start = (size_t)(p->previous.start - base); // *, +, or - already consumed for (;;) { while (md_consumetextcontent(p, true, out)); @@ -341,13 +359,13 @@ bool md_parseurl(parser *p, void *out) { parse_advance(p); } if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); - return true; /* EOF is valid end of link line */ + return true; // EOF is valid end of link line } /** Parses inline link [text](url)... after [ and label and ] are consumed. Consumes ( url ) and rest of line, pushes paragraph. */ static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { md_parseout *ctx = (md_parseout *) out; - parse_advance(p); /* consume ( */ + parse_advance(p); // consume ( while (!parse_checktoken(p, MD_RIGHTPAREN) && !parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) parse_advance(p); if (!parse_checktokenadvance(p, MD_RIGHTPAREN)) { @@ -355,7 +373,7 @@ static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { return false; } while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) - parse_advance(p); + parse_advance(p); // consume rest of line (e.g. trailing ".") if (!md_parselineend(p)) { parse_error(p, true, MD_EXPECTLINEEND); return false; @@ -401,7 +419,7 @@ bool md_parselink(parser *p, void *out) { /** Parse a markdown 'block' */ bool md_parseblock(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; - /* Dispatch by first token. Check block-start alternatives first. */ + // Dispatch by first token. Check block-start alternatives first. if (parse_checktokenadvance(p, MD_HASH)) { ctx->current_header_level = 1; return md_parseheader(p, out); @@ -417,7 +435,7 @@ bool md_parseblock(parser *p, void *out) { } else if (parse_checktoken(p, MD_ASTERISK) || parse_checktoken(p, MD_PLUS) || parse_checktoken(p, MD_DASH)) { - /* CommonMark: list marker must be followed by space or tab; else treat as paragraph. */ + // CommonMark: list marker must be followed by space or tab; else treat as paragraph. char c = lex_peek(p->lex); if (c == ' ' || c == '\t') { parse_advance(p); @@ -426,10 +444,10 @@ bool md_parseblock(parser *p, void *out) { return md_parsetext(p, out); } else if (parse_checktokenadvance(p, MD_LEFTSQUAREBRACE)) { return md_parselink(p, out); - } else if (parse_checktokenadvance(p, MD_NEWLINE)) { /* blank line */ + } else if (parse_checktokenadvance(p, MD_NEWLINE)) { // blank line return true; } else if (parse_checktoken(p, MD_EOF)) { - return true; /* let outer loop exit */ + return true; // let outer loop exit } else if (md_checktexttoken(p)) { return md_parsetext(p, out); } else { @@ -909,8 +927,7 @@ bool help_load(char *filename) { return false; } fclose(f); - /* Keep contents.data; mdfile will own it (freed in md_file_clear). Do not clear contents. */ - size_t len = (contents.count > 0) ? contents.count - 1 : 0; + size_t len = (contents.count > 0) ? contents.count - 1 : 0; // Keep contents.data; mdfile will own it (freed in md_file_clear). Do not clear contents. md_file mdfile; md_file_init(&mdfile); mdfile.source = contents.data; @@ -922,7 +939,7 @@ bool help_load(char *filename) { } else { fprintf(stderr, "Help file failed to parse: %s\n", filename); md_file_clear(&mdfile); - /* Remove topics added during the failed parse; they have file_index = s_files.count */ + // Remove topics added during the failed parse; they have file_index = s_files.count while (s_topics.count > n_topics_before) { md_topic *t = &s_topics.data[s_topics.count - 1]; if (t->name) MORPHO_FREE(t->name); @@ -1105,7 +1122,7 @@ bool morpho_helpasmd(char *query, varray_char *result) { /** @brief Initialize help system */ void help_initialize(void) { - /* Markdown parser errors */ + // Markdown parser errors morpho_defineerror(MD_UNCLOSEDITALIC, ERROR_PARSE, MD_UNCLOSEDITALIC_MSG); morpho_defineerror(MD_UNCLOSEDINLINECODE, ERROR_PARSE, MD_UNCLOSEDINLINECODE_MSG); morpho_defineerror(MD_EXPECTLINEEND, ERROR_PARSE, MD_EXPECTLINEEND_MSG); From bdab3c75a3bf6dd6c7082e6789bc827204bc0bcb Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 08:28:13 -0500 Subject: [PATCH 287/473] Rearrange file --- src/support/help.c | 125 ++++++++++++++++++++------------------------- src/support/help.h | 30 +++++++++++ 2 files changed, 86 insertions(+), 69 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 7febe5108..0208f44cb 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -68,24 +68,6 @@ enum { MD_EOF }; -/* Markdown parser error codes (registered in help_initialize) */ -#define MD_UNCLOSEDITALIC "MDUnclItal" -#define MD_UNCLOSEDITALIC_MSG "Unclosed italic (missing closing * or _)." -#define MD_UNCLOSEDINLINECODE "MDUnclCode" -#define MD_UNCLOSEDINLINECODE_MSG "Unclosed inline code (missing closing `)." -#define MD_EXPECTLINEEND "MDExpLnEnd" -#define MD_EXPECTLINEEND_MSG "Expected end of line." -#define MD_EXPECTHEADERTEXT "MDExpHdrTxt" -#define MD_EXPECTHEADERTEXT_MSG "Expected header text after #." -#define MD_LINKEXPECTTEXT "MDLnkExpTxt" -#define MD_LINKEXPECTTEXT_MSG "Link definition expects label text after [." -#define MD_LINKEXPECTBRACKET "MDLnkExpBr" -#define MD_LINKEXPECTBRACKET_MSG "Link definition expects ] after label." -#define MD_LINKEXPECTCOLON "MDLnkExpCol" -#define MD_LINKEXPECTCOLON_MSG "Link definition expects : after ]." -#define MD_UNEXPECTEDTOKEN "MDUnexpTok" -#define MD_UNEXPECTEDTOKEN_MSG "Unexpected markdown token." - bool md_lexnewline(lexer *l, token *tok, error *err) { lex_newline(l); return true; @@ -256,6 +238,7 @@ tokentype _literalintext[] = { }; int _nliteralintext = sizeof(_literalintext)/sizeof(tokentype); +/** True if current token can be consumed as text (MD_TEXT or inline formatting tokens). */ bool md_checktexttoken(parser *p) { return parse_checktokenmulti(p, _ninlinetokens, _inlinetokens); } @@ -388,25 +371,25 @@ bool md_parselink(parser *p, void *out) { const char *base = ctx->file->source; size_t block_start = (size_t)(p->previous.start - base); - if (!parse_checktokenadvance(p, MD_TEXT)) { + if (!parse_checktokenadvance(p, MD_TEXT)) { // Parse label text parse_error(p, false, MD_LINKEXPECTTEXT); return false; } size_t label_start = (size_t)(p->previous.start - base); size_t label_len = p->previous.length; - if (!parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)) { + if (!parse_checktokenadvance(p, MD_RIGHTSQUAREBRACE)) { // Parse closing ] parse_error(p, false, MD_LINKEXPECTBRACKET); return false; } - if (parse_checktoken(p, MD_LEFTPAREN)) return md_parseinlinelink(p, out, block_start); + if (parse_checktoken(p, MD_LEFTPAREN)) return md_parseinlinelink(p, out, block_start); // Inline link [text](url) - if (!parse_checktokenadvance(p, MD_COLON)) { + if (!parse_checktokenadvance(p, MD_COLON)) { // Parse : for link definition parse_error(p, false, MD_LINKEXPECTCOLON); return false; } size_t target_start = (size_t)(p->current.start - base); - if (!md_parseurl(p, out)) { + if (!md_parseurl(p, out)) { // Parse target URL until newline/EOF parse_error(p, true, MD_EXPECTLINEEND); return false; } @@ -965,54 +948,9 @@ void help_findfiles(void) { } /* ********************************************************************** - * Help API + * Hints for failed queries * ********************************************************************** */ -static bool s_help_files_loaded = false; - -/** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ -bool morpho_helpastopic(const char *query, help_topic *out) { - if (!s_help_files_loaded) { // Load help files on first use - help_findfiles(); - s_help_files_loaded = true; - } - char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; - const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; - int nsegs = help_parsequery(query, qbuf, segs); - if (nsegs <= 0) return false; - - // Single segment: resolve by name; fail if 0 or multiple matches (caller shows hint) - int idx; - if (nsegs == 1) { - int multi[MORPHO_HELP_MAX_MULTIMATCH]; - int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); - if (n == 1) { - idx = multi[0]; - } else if (n == 0) { - idx = help_findtopic(&s_topics, segs[0]); /* fallback: bsearch by name */ - if (idx < 0) return false; - } else { - return false; /* multiple matches: caller will show hint */ - } - } else { - idx = help_findtopic(&s_topics, segs[0]); - if (idx < 0) return false; - } - - // Resolve remaining segments as subtopics - for (int i = 1; i < nsegs; i++) { - idx = help_findsubtopic(idx, segs[i]); - if (idx < 0) return false; - } - - const md_topic *topic = &s_topics.data[idx]; - if (topic->file_index < 0 || (unsigned int) topic->file_index >= s_files.count) return false; - const md_file *file = &s_files.data[topic->file_index]; - if (topic->block_index >= file->blocks.count) return false; - help_topicfill(out, topic, file); - return true; -} - /** Append "Topic 'query' not found [. Did you mean 'suggest'?]." to result. suggest is full path or NULL. */ static void help_hintappend(varray_char *result, const char *query, const char *suggest) { char buf[MORPHO_HELP_HINTBUFSIZE]; @@ -1102,6 +1040,55 @@ static void help_queryhint(const char *query, varray_char *result) { varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); } +/* ********************************************************************** + * Help API + * ********************************************************************** */ + +static bool s_help_files_loaded = false; + +/** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ +bool morpho_helpastopic(const char *query, help_topic *out) { + if (!s_help_files_loaded) { // Load help files on first use + help_findfiles(); + s_help_files_loaded = true; + } + char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; + const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; + int nsegs = help_parsequery(query, qbuf, segs); + if (nsegs <= 0) return false; + + // Single segment: resolve by name; fail if 0 or multiple matches (caller shows hint) + int idx; + if (nsegs == 1) { + int multi[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); + if (n == 1) { + idx = multi[0]; + } else if (n == 0) { + idx = help_findtopic(&s_topics, segs[0]); /* fallback: bsearch by name */ + if (idx < 0) return false; + } else { + return false; /* multiple matches: caller will show hint */ + } + } else { + idx = help_findtopic(&s_topics, segs[0]); + if (idx < 0) return false; + } + + // Resolve remaining segments as subtopics + for (int i = 1; i < nsegs; i++) { + idx = help_findsubtopic(idx, segs[i]); + if (idx < 0) return false; + } + + const md_topic *topic = &s_topics.data[idx]; + if (topic->file_index < 0 || (unsigned int) topic->file_index >= s_files.count) return false; + const md_file *file = &s_files.data[topic->file_index]; + if (topic->block_index >= file->blocks.count) return false; + help_topicfill(out, topic, file); + return true; +} + bool morpho_helpastext(char *query, varray_char *result) { help_topic t; if (morpho_helpastopic(query, &t)) return help_topictotext(&t, result); diff --git a/src/support/help.h b/src/support/help.h index 0c74b2b9c..3e116a1b8 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -12,8 +12,10 @@ /** Maximum length of a help query string (used for lookup buffer). */ #define MORPHO_MAX_HELPQUERY_LENGTH 512 + /** Maximum length of a single string for edit-distance (suggestion). */ #define MORPHO_HELP_EDITMAXLEN 128 + /** Buffer size for "not found" hint message. */ #define MORPHO_HELP_HINTBUFSIZE 256 @@ -106,6 +108,34 @@ bool help_topictotext(const help_topic *t, varray_char *result); /** Append a help topic's raw markdown from source into result. Returns true on success. */ bool help_topicrawmd(const help_topic *t, varray_char *result); +/* ------------------------------------------------------- + * Markdown parser error codes + * ------------------------------------------------------- */ + +#define MD_UNCLOSEDITALIC "MDUnclItal" +#define MD_UNCLOSEDITALIC_MSG "Unclosed italic (missing closing * or _)." + +#define MD_UNCLOSEDINLINECODE "MDUnclCode" +#define MD_UNCLOSEDINLINECODE_MSG "Unclosed inline code (missing closing `)." + +#define MD_EXPECTLINEEND "MDExpLnEnd" +#define MD_EXPECTLINEEND_MSG "Expected end of line." + +#define MD_EXPECTHEADERTEXT "MDExpHdrTxt" +#define MD_EXPECTHEADERTEXT_MSG "Expected header text after #." + +#define MD_LINKEXPECTTEXT "MDLnkExpTxt" +#define MD_LINKEXPECTTEXT_MSG "Link definition expects label text after [." + +#define MD_LINKEXPECTBRACKET "MDLnkExpBr" +#define MD_LINKEXPECTBRACKET_MSG "Link definition expects ] after label." + +#define MD_LINKEXPECTCOLON "MDLnkExpCol" +#define MD_LINKEXPECTCOLON_MSG "Link definition expects : after ]." + +#define MD_UNEXPECTEDTOKEN "MDUnexpTok" +#define MD_UNEXPECTEDTOKEN_MSG "Unexpected markdown token." + /* ------------------------------------------------------- * Help API * ------------------------------------------------------- */ From 59dba15bb291ada678527f2700253d72a0464f1b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:19:58 -0500 Subject: [PATCH 288/473] Improve clarity --- src/support/help.c | 107 +++++++++++++++++++++++++++------------------ 1 file changed, 64 insertions(+), 43 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 0208f44cb..1922f0106 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -214,6 +214,13 @@ static size_t md_end_previous(parser *p, const char *base) { return (size_t)(p->previous.start - base) + p->previous.length; } +/** Clamp span length to fit within source length. Returns clamped length. */ +static size_t md_clamp_span(size_t start, size_t len, size_t src_len) { + if (start >= src_len) return 0; + if (start + len > src_len) return src_len - start; + return len; +} + /* ------------------------------------------------------- * Markdown parse rules * ------------------------------------------------------- */ @@ -655,9 +662,16 @@ static int help_findparent(int idx) { /** Write full display path for topic (e.g. "System.clock") into buf. */ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { - if (!bufsize || idx < 0 || (unsigned int) idx >= s_topics.count) { if (bufsize) buf[0] = '\0'; return; } + if (!bufsize) return; + if (idx < 0 || (unsigned int) idx >= s_topics.count) { + buf[0] = '\0'; + return; + } const md_topic *t = &s_topics.data[idx]; - if (!t->name) { buf[0] = '\0'; return; } + if (!t->name) { + buf[0] = '\0'; + return; + } int p = (t->level > 1) ? help_findparent(idx) : -1; if (p >= 0) { // Recurse for parent path, then append ".name" @@ -717,22 +731,28 @@ static int help_findsubtopic(int parent_idx, const char *name) { for (unsigned int i = parent->block_index + 1; i < file->blocks.count; i++) { const md_block *b = &file->blocks.data[i]; if (b->type != MD_BLOCK_HEADER) continue; - if (b->as.header.level <= parent->level) return -1; // left section + if (b->as.header.level <= parent->level) return -1; // left section size_t start = b->as.header.title.start; - size_t len = b->as.header.title.length; - if (start + len > base_len) len = base_len - start; + size_t len = md_clamp_span(start, b->as.header.title.length, base_len); if (help_headertitleeq(base, start, len, name)) return help_findtopicbyblock(parent->file_index, i); } return -1; } -/** Levenshtein distance between two strings (for "did you mean"). */ -static unsigned int help_editdistance(const char *a, const char *b) { +/** Levenshtein distance between two strings (for "did you mean"). + * If max_dist is provided (> 0), returns early if distance exceeds it (returns max_dist + 1). + * This allows early exit when we only care about distances within a threshold. */ +static unsigned int help_editdistance(const char *a, const char *b, unsigned int max_dist) { size_t na = strlen(a), nb = strlen(b); if (na == 0) return (unsigned int) nb; if (nb == 0) return (unsigned int) na; if (na > MORPHO_HELP_EDITMAXLEN || nb > MORPHO_HELP_EDITMAXLEN) return MORPHO_HELP_EDIT_NOMATCH; + + // Early exit: if length difference exceeds max_dist, distance must be at least that + size_t len_diff = (na > nb) ? na - nb : nb - na; + if (max_dist > 0 && len_diff > max_dist) return max_dist + 1; + // Two-row DP: prev row and current row, swap each iteration unsigned int row0[MORPHO_HELP_EDITMAXLEN + 1], row1[MORPHO_HELP_EDITMAXLEN + 1]; unsigned int *prev = row0, *curr = row1; @@ -742,8 +762,11 @@ static unsigned int help_editdistance(const char *a, const char *b) { for (size_t j = 1; j <= nb; j++) { unsigned int cost = (a[i - 1] == b[j - 1]) ? 0 : 1; unsigned int del = prev[j] + 1, ins = curr[j - 1] + 1, sub = prev[j - 1] + cost; - curr[j] = (del < ins) ? (del < sub ? del : sub) : (ins < sub ? ins : sub); + unsigned int min = (del < ins) ? del : ins; + curr[j] = (min < sub) ? min : sub; } + // Early exit: if the final column (curr[nb]) exceeds max_dist, we can stop + if (max_dist > 0 && curr[nb] > max_dist) return max_dist + 1; { unsigned int *t = prev; prev = curr; curr = t; } } return prev[nb]; @@ -757,7 +780,7 @@ static const char *help_findclosesttopic(const char *name) { unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; for (unsigned int i = 0; i < s_topics.count; i++) { if (s_topics.data[i].level != 1 || !s_topics.data[i].name) continue; - unsigned int d = help_editdistance(name, s_topics.data[i].name); + unsigned int d = help_editdistance(name, s_topics.data[i].name, best_d - 1); if (d < best_d) { best_d = d; best = s_topics.data[i].name; } } return best; @@ -777,7 +800,7 @@ static const char *help_findclosestsubtopic(int parent_idx, const char *name) { if (b->as.header.level <= parent->level) break; int ti = help_findtopicbyblock(parent->file_index, i); if (ti < 0 || !s_topics.data[ti].name) continue; - unsigned int d = help_editdistance(name, s_topics.data[ti].name); + unsigned int d = help_editdistance(name, s_topics.data[ti].name, best_d - 1); if (d < best_d) { best_d = d; best = s_topics.data[ti].name; } } return best; @@ -819,17 +842,15 @@ bool help_topictotext(const help_topic *t, varray_char *result) { if (!help_topicsrc(t, result, &src, &src_len)) return false; for (unsigned int i = 0; i < t->nblocks; i++) { const md_block *b = &t->content_blocks[i]; - if (b->span.start >= src_len) continue; - size_t len = b->span.length; - if (b->span.start + len > src_len) len = src_len - b->span.start; + size_t len = md_clamp_span(b->span.start, b->span.length, src_len); + if (len == 0) continue; // Per-block: header (title only, no #), paragraph/list/code (span), link/blank skip switch (b->type) { case MD_BLOCK_HEADER: { + size_t tlen = md_clamp_span(b->as.header.title.start, b->as.header.title.length, src_len); const char *p = src + b->as.header.title.start; - size_t tlen = b->as.header.title.length; - if (b->as.header.title.start + tlen > src_len) tlen = src_len - b->as.header.title.start; - while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } // strip leading # and space + while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } // strip leading # and space if (tlen > 0) varray_charadd(result, p, (int) tlen); varray_charadd(result, "\n\n", 2); break; @@ -842,7 +863,7 @@ bool help_topictotext(const help_topic *t, varray_char *result) { break; case MD_BLOCK_LINK_DEF: case MD_BLOCK_BLANK: - break; // omit from plain text + break; // omit from plain text } } return true; @@ -854,9 +875,7 @@ bool help_topicrawmd(const help_topic *t, varray_char *result) { if (!help_topicsrc(t, result, &src, &src_len)) return false; for (unsigned int i = 0; i < t->nblocks; i++) { const md_block *b = &t->content_blocks[i]; - if (b->span.start >= src_len) continue; - size_t len = b->span.length; - if (b->span.start + len > src_len) len = src_len - b->span.start; + size_t len = md_clamp_span(b->span.start, b->span.length, src_len); if (len == 0) continue; varray_charadd(result, src + b->span.start, (int) len); if (src[b->span.start + len - 1] != '\n') varray_charadd(result, "\n", 1); @@ -882,11 +901,12 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { lex_clear(&l); if (!ok && morpho_checkerror(&err)) { fprintf(stderr, "Help parse error [%s]: %s", err.id ? err.id : "?", err.msg); - if (err.line != ERROR_POSNUNIDENTIFIABLE || err.posn != ERROR_POSNUNIDENTIFIABLE) { + bool has_line = (err.line != ERROR_POSNUNIDENTIFIABLE); + bool has_posn = (err.posn != ERROR_POSNUNIDENTIFIABLE); + if (has_line || has_posn) { fprintf(stderr, " ("); - if (err.line != ERROR_POSNUNIDENTIFIABLE) fprintf(stderr, "line %d", err.line + 1); - if (err.posn != ERROR_POSNUNIDENTIFIABLE) - fprintf(stderr, "%sposition %d", err.line != ERROR_POSNUNIDENTIFIABLE ? ", " : "", err.posn + 1); + if (has_line) fprintf(stderr, "line %d", err.line + 1); + if (has_posn) fprintf(stderr, "%sposition %d", has_line ? ", " : "", err.posn + 1); fprintf(stderr, ")"); } fprintf(stderr, "\n"); @@ -968,12 +988,9 @@ static void help_hintappend_multi(varray_char *result, const char *query, int in // First: "'A'"; middle: ", 'B'"; last: " or 'C'?" for (int i = 0; i < count && n < (int) sizeof(buf) - 4; i++) { help_topic_displaypath(indices[i], path, sizeof(path)); - if (i == 0) - n += snprintf(buf + n, sizeof(buf) - (size_t) n, "'%s'", path); - else if (i == count - 1) - n += snprintf(buf + n, sizeof(buf) - (size_t) n, " or '%s'?", path); - else - n += snprintf(buf + n, sizeof(buf) - (size_t) n, ", '%s'", path); + if (i == 0) n += snprintf(buf + n, sizeof(buf) - (size_t) n, "'%s'", path); + else if (i == count - 1) n += snprintf(buf + n, sizeof(buf) - (size_t) n, " or '%s'?", path); + else n += snprintf(buf + n, sizeof(buf) - (size_t) n, ", '%s'", path); } if (n > 0 && (size_t) n < sizeof(buf)) varray_charadd(result, buf, n); } @@ -1019,23 +1036,27 @@ static void help_queryhint(const char *query, varray_char *result) { int next = help_findsubtopic(idx, segs[i]); if (next < 0) { const char *closest = help_findclosestsubtopic(idx, segs[i]); - char suggest[MORPHO_MAX_HELPQUERY_LENGTH]; - if (closest && path_len + 1 + (int) strlen(closest) < (int) sizeof(suggest)) - snprintf(suggest, sizeof(suggest), "%s.%s", path, closest); - else - suggest[0] = '\0'; + char suggest[MORPHO_MAX_HELPQUERY_LENGTH] = {0}; + if (closest) { + int needed = path_len + 1 + (int) strlen(closest); + if (needed < (int) sizeof(suggest)) + snprintf(suggest, sizeof(suggest), "%s.%s", path, closest); + } help_hintappend(result, query, suggest[0] ? suggest : NULL); return; } idx = next; // Append "." + segs[i] to path for next level - if (path_len > 0 && path_len < (int) sizeof(path) - 1) { - path[path_len++] = '.'; - int seglen = (int) strlen(segs[i]); - if (path_len + seglen >= (int) sizeof(path)) seglen = (int) sizeof(path) - 1 - path_len; - if (seglen > 0) { memcpy(path + path_len, segs[i], (size_t) seglen); path_len += seglen; } - path[path_len] = '\0'; + if (path_len >= (int) sizeof(path) - 1) continue; // No room + path[path_len++] = '.'; + int seglen = (int) strlen(segs[i]); + int avail = (int) sizeof(path) - path_len; + if (seglen >= avail) seglen = avail - 1; + if (seglen > 0) { + memcpy(path + path_len, segs[i], (size_t) seglen); + path_len += seglen; } + path[path_len] = '\0'; } varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); } @@ -1065,10 +1086,10 @@ bool morpho_helpastopic(const char *query, help_topic *out) { if (n == 1) { idx = multi[0]; } else if (n == 0) { - idx = help_findtopic(&s_topics, segs[0]); /* fallback: bsearch by name */ + idx = help_findtopic(&s_topics, segs[0]); // fallback: bsearch by name if (idx < 0) return false; } else { - return false; /* multiple matches: caller will show hint */ + return false; // multiple matches: caller will show hint } } else { idx = help_findtopic(&s_topics, segs[0]); From c45a1ba92c144209a37333d33bc6f7996e0b4f4c Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 09:44:12 -0500 Subject: [PATCH 289/473] Thematic breaks --- src/support/help.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- src/support/help.h | 1 + src/support/lex.h | 1 + 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index 1922f0106..39f2fae42 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -62,6 +62,7 @@ enum { MD_UNDERSCORE2, MD_ASTERISK3, MD_UNDERSCORE3, + MD_THEMATIC_BREAK, MD_FOURSPACES, MD_TAB, MD_NEWLINE, @@ -73,6 +74,7 @@ bool md_lexnewline(lexer *l, token *tok, error *err) { return true; } + tokendefn mdtokens[] = { { "#", MD_HASH , NULL }, { "##", MD_HASH2 , NULL }, @@ -104,8 +106,38 @@ static bool md_isasciipunct(char c) { return (unsigned char)c <= 0x7F && ispunct((unsigned char)c); } +/** Check if current position is a thematic break and record it as MD_THEMATIC_BREAK token. + * Returns true if a thematic break token was recorded, false otherwise. */ +static bool md_lexthematicbreak(lexer *l, token *tok) { + char c = lex_peek(l); + if (c != '-' && c != '*' && c != '_') return false; + + int count = 0; // Count consecutive matching characters using peekahead (must be 3+) + while (lex_peekahead(l, count) == c && count < 100) count++; // reasonable limit + if (count < 3) return false; + + int spaces = 0; // Check for optional spaces after break characters + while (lex_peekahead(l, count + spaces) == ' ') spaces++; + + char next = lex_peekahead(l, count + spaces); // Must be followed by newline or EOF + if (next != '\n' && next != '\r' && next != '\0') return false; + + size_t total_len = (size_t)count + (size_t)spaces; // Calculate total length to advance + if (next == '\r' && lex_peekahead(l, count + spaces + 1) == '\n') { + total_len += 2; // \r\n + } else if (next == '\n' || next == '\r') { + total_len += 1; // \n or \r + } + + lex_advanceby(l, total_len); // Advance by total length and record token + lex_recordtoken(l, MD_THEMATIC_BREAK, tok); + return true; +} + /** Lexer token preprocessor function */ bool md_lexpreprocess(lexer *l, token *tok, error *err) { + if (md_lexthematicbreak(l, tok)) return true; // Check for thematic break before processing other tokens + while (!lex_identifytoken(l, false, NULL) && !lex_isatend(l)) { char c = lex_peek(l); if (c == '\\') { @@ -327,6 +359,15 @@ bool md_parsecode(parser *p, void *out) { return true; } +/** Parses a thematic break (---, ***, or ___). Token already consumed by lexer (includes newline). */ +static bool md_parsethematicbreak(parser *p, void *out) { + md_parseout *ctx = (md_parseout *) out; + const char *base = ctx->file->source; + size_t block_start = (size_t)(p->previous.start - base); + md_push_simpleblock(p, ctx, block_start, MD_BLOCK_THEMATIC_BREAK); + return true; +} + /** Parses a markdown list (list item line; records as list block). */ bool md_parselist(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; @@ -422,6 +463,8 @@ bool md_parseblock(parser *p, void *out) { } else if (parse_checktokenadvance(p, MD_FOURSPACES) || parse_checktokenadvance(p, MD_TAB)) { return md_parsecode(p, out); + } else if (parse_checktokenadvance(p, MD_THEMATIC_BREAK)) { + return md_parsethematicbreak(p, out); } else if (parse_checktoken(p, MD_ASTERISK) || parse_checktoken(p, MD_PLUS) || parse_checktoken(p, MD_DASH)) { @@ -863,7 +906,8 @@ bool help_topictotext(const help_topic *t, varray_char *result) { break; case MD_BLOCK_LINK_DEF: case MD_BLOCK_BLANK: - break; // omit from plain text + case MD_BLOCK_THEMATIC_BREAK: + break; // omit from plain text (thematic breaks render as blank lines) } } return true; diff --git a/src/support/help.h b/src/support/help.h index 3e116a1b8..0a4285fa0 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -36,6 +36,7 @@ typedef enum { MD_BLOCK_CODE, MD_BLOCK_LIST, MD_BLOCK_LINK_DEF, + MD_BLOCK_THEMATIC_BREAK, MD_BLOCK_BLANK } md_blocktype; diff --git a/src/support/lex.h b/src/support/lex.h index 808f2b860..9b74ea12d 100644 --- a/src/support/lex.h +++ b/src/support/lex.h @@ -171,6 +171,7 @@ bool lex_matchtoken(lexer *l, tokendefn **defn); bool lex_identifytoken(lexer *l, bool advance, tokendefn **defn); void lex_recordtoken(lexer *l, tokentype type, token *tok); char lex_advance(lexer *l); +char lex_advanceby(lexer *l, size_t n); bool lex_back(lexer *l); bool lex_isatend(lexer *l); bool lex_isalpha(char c); From a0e585191a305bb019787666d4ff94f808fd6f99 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 12:23:43 -0500 Subject: [PATCH 290/473] Report filename on error reporting --- src/support/help.c | 10 +++++++++- src/support/help.h | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index 39f2fae42..8a08acfc0 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -14,6 +14,7 @@ #include "classes.h" #include "help.h" #include "resources.h" +#include "common.h" #include "error.h" #include "lex.h" @@ -227,6 +228,9 @@ typedef struct { int current_header_level; // 1–3, set before md_parseheader } md_parseout; +/* Forward declarations */ +static void md_push_simpleblock(parser *p, md_parseout *out, size_t block_start, md_blocktype type); + static void md_push_header(parser *p, md_parseout *out, size_t block_start, size_t title_start, size_t title_len); static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start); static void md_push_code(parser *p, md_parseout *out, size_t block_start); @@ -525,6 +529,7 @@ void md_block_clear(md_block *b) { void md_file_init(md_file *f) { f->source = NULL; f->sourcelen = 0; + f->filename = NULL; varray_md_blockinit(&f->blocks); } @@ -532,6 +537,8 @@ void md_file_clear(md_file *f) { if (f->source) MORPHO_FREE(f->source); f->source = NULL; f->sourcelen = 0; + if (f->filename) MORPHO_FREE(f->filename); + f->filename = NULL; for (unsigned int i = 0; i < f->blocks.count; i++) md_block_clear(&f->blocks.data[i]); varray_md_blockclear(&f->blocks); } @@ -953,6 +960,7 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { if (has_posn) fprintf(stderr, "%sposition %d", has_line ? ", " : "", err.posn + 1); fprintf(stderr, ")"); } + if (file->filename) fprintf(stderr, " in %s", file->filename); fprintf(stderr, "\n"); } return ok; @@ -979,12 +987,12 @@ bool help_load(char *filename) { md_file_init(&mdfile); mdfile.source = contents.data; mdfile.sourcelen = len; + mdfile.filename = morpho_strdup(filename); unsigned int n_topics_before = s_topics.count; bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); if (ok) { varray_md_filewrite(&s_files, mdfile); } else { - fprintf(stderr, "Help file failed to parse: %s\n", filename); md_file_clear(&mdfile); // Remove topics added during the failed parse; they have file_index = s_files.count while (s_topics.count > n_topics_before) { diff --git a/src/support/help.h b/src/support/help.h index 0a4285fa0..fcf3fc019 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -59,6 +59,7 @@ DECLARE_VARRAY(md_block, md_block); typedef struct { char *source; size_t sourcelen; + char *filename; /* Owned filename/path for error reporting */ varray_md_block blocks; } md_file; From 1b30492f854b297e48bcfcb196c9cc9d5c6dba3e Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 19:09:42 -0500 Subject: [PATCH 291/473] Fixes to help system --- src/datastructures/varray.h | 4 ++-- src/support/help.c | 30 ++++++++---------------------- src/support/help.h | 4 +++- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/src/datastructures/varray.h b/src/datastructures/varray.h index 2c87b105f..dbf836db6 100644 --- a/src/datastructures/varray.h +++ b/src/datastructures/varray.h @@ -41,7 +41,7 @@ } varray_##name; \ \ void varray_##name##init(varray_##name *v); \ - bool varray_##name##add(varray_##name *v, const type *data, int count); \ + bool varray_##name##add(varray_##name *v, type *data, int count); \ bool varray_##name##resize(varray_##name *v, int count); \ int varray_##name##write(varray_##name *v, type data); \ void varray_##name##clear(varray_##name *v); @@ -53,7 +53,7 @@ void varray_##name##init(varray_##name *v) { \ v->data=NULL; \ } \ \ -bool varray_##name##add(varray_##name *v, const type *data, int count) { \ +bool varray_##name##add(varray_##name *v, type *data, int count) { \ if (v->capacitycount + count) { \ unsigned int capacity = varray_powerof2ceiling(v->count + count); \ v->data = (type *) morpho_allocate(v->data, v->capacity * sizeof(type), \ diff --git a/src/support/help.c b/src/support/help.c index 8a08acfc0..bef7388ae 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -730,10 +730,7 @@ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { if (len + 1 < bufsize) snprintf(buf + len, bufsize - len, ".%s", t->name); } else { // Top-level or no parent: just the topic name - size_t n = strlen(t->name); - if (n >= bufsize) n = bufsize - 1; - memcpy(buf, t->name, n); - buf[n] = '\0'; + snprintf(buf, bufsize, "%s", t->name); } } @@ -822,8 +819,6 @@ static unsigned int help_editdistance(const char *a, const char *b, unsigned int return prev[nb]; } -static const char MORPHO_HELP_NOTFOUND[] = "Topic not found."; - /** Find top-level topic name closest to name; NULL if none within distance. */ static const char *help_findclosesttopic(const char *name) { const char *best = NULL; @@ -901,14 +896,14 @@ bool help_topictotext(const help_topic *t, varray_char *result) { size_t tlen = md_clamp_span(b->as.header.title.start, b->as.header.title.length, src_len); const char *p = src + b->as.header.title.start; while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } // strip leading # and space - if (tlen > 0) varray_charadd(result, p, (int) tlen); + if (tlen > 0) varray_charadd(result, (char *) p, (int) tlen); varray_charadd(result, "\n\n", 2); break; } case MD_BLOCK_PARAGRAPH: case MD_BLOCK_LIST: case MD_BLOCK_CODE: - varray_charadd(result, src + b->span.start, (int) len); + varray_charadd(result, (char *) src + b->span.start, (int) len); if (len > 0 && src[b->span.start + len - 1] != '\n') varray_charadd(result, "\n", 1); break; case MD_BLOCK_LINK_DEF: @@ -928,7 +923,7 @@ bool help_topicrawmd(const help_topic *t, varray_char *result) { const md_block *b = &t->content_blocks[i]; size_t len = md_clamp_span(b->span.start, b->span.length, src_len); if (len == 0) continue; - varray_charadd(result, src + b->span.start, (int) len); + varray_charadd(result, (char *) src + b->span.start, (int) len); if (src[b->span.start + len - 1] != '\n') varray_charadd(result, "\n", 1); } return true; @@ -1079,10 +1074,8 @@ static void help_queryhint(const char *query, varray_char *result) { return; } char path[MORPHO_MAX_HELPQUERY_LENGTH]; - int path_len = (int) strlen(segs[0]); - if (path_len >= (int) sizeof(path)) path_len = (int) sizeof(path) - 1; - memcpy(path, segs[0], (size_t) path_len); - path[path_len] = '\0'; + int path_len = snprintf(path, sizeof(path), "%s", segs[0]); + if (path_len < 0 || path_len >= (int) sizeof(path)) path_len = (int) sizeof(path) - 1; for (int i = 1; i < nsegs; i++) { int next = help_findsubtopic(idx, segs[i]); @@ -1100,15 +1093,8 @@ static void help_queryhint(const char *query, varray_char *result) { idx = next; // Append "." + segs[i] to path for next level if (path_len >= (int) sizeof(path) - 1) continue; // No room - path[path_len++] = '.'; - int seglen = (int) strlen(segs[i]); - int avail = (int) sizeof(path) - path_len; - if (seglen >= avail) seglen = avail - 1; - if (seglen > 0) { - memcpy(path + path_len, segs[i], (size_t) seglen); - path_len += seglen; - } - path[path_len] = '\0'; + int n = snprintf(path + path_len, (size_t)(sizeof(path) - path_len), ".%s", segs[i]); + if (n > 0) path_len += (n < (int) sizeof(path) - path_len) ? n : (int) sizeof(path) - 1 - path_len; } varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); } diff --git a/src/support/help.h b/src/support/help.h index fcf3fc019..a269c91eb 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -138,12 +138,14 @@ bool help_topicrawmd(const help_topic *t, varray_char *result); #define MD_UNEXPECTEDTOKEN "MDUnexpTok" #define MD_UNEXPECTEDTOKEN_MSG "Unexpected markdown token." +#define MORPHO_HELP_NOTFOUND "Topic not found." + /* ------------------------------------------------------- * Help API * ------------------------------------------------------- */ /** Resolve a query to a help topic. Fills *out and returns true if found; otherwise returns false and *out is unchanged. */ - bool morpho_helpastopic(const char *query, help_topic *out); +bool morpho_helpastopic(const char *query, help_topic *out); /** Look up help for query and write plain-text result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topictotext.) */ bool morpho_helpastext(char *query, varray_char *result); From cff2a32f61a7785621a6255566823fa724257d92 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 19:20:03 -0500 Subject: [PATCH 292/473] Indicate presence of help --- src/build.h | 9 ++++++--- src/support/help.c | 4 ++++ src/support/help.h | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/build.h b/src/build.h index 9c8e12c7a..3a659c7c7 100644 --- a/src/build.h +++ b/src/build.h @@ -123,15 +123,18 @@ * Core library [options set in CMake] * ********************************************************************** */ -/** Build with Matrix class using BLAS/LAPACK */ +/** @brief Build with Matrix class using BLAS/LAPACK */ //#define MORPHO_INCLUDE_LINALG -/** Build with Sparse class */ +/** @brief Build with Sparse class */ //#define MORPHO_INCLUDE_SPARSE -/** Build with geometry classes */ +/** @brief Build with geometry classes */ //#define MORPHO_INCLUDE_GEOMETRY +/** @brief Build with new help system */ +#define MORPHO_INCLUDE_HELP + /* ********************************************************************** * Libraries * ********************************************************************** */ diff --git a/src/support/help.c b/src/support/help.c index bef7388ae..fdbc3a257 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -22,6 +22,8 @@ #include "file.h" #include "memory.h" +#ifdef MORPHO_INCLUDE_HELP + /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all * valid Markdown, although only a subset is used, and the help system interprets @@ -1193,3 +1195,5 @@ void help_finalize(void) { } varray_md_topicclear(&s_topics); } + +#endif diff --git a/src/support/help.h b/src/support/help.h index a269c91eb..d65489859 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -7,6 +7,8 @@ #ifndef help_h #define help_h +#ifdef MORPHO_INCLUDE_HELP + #include #include "varray.h" @@ -156,4 +158,6 @@ bool morpho_helpasmd(char *query, varray_char *result); void help_initialize(void); void help_finalize(void); +#endif + #endif /* help_h */ From c123d3e9f6b2b6c4fd6803b7b591dfd02daf9027 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:23:52 -0500 Subject: [PATCH 293/473] Expose help_queryhint --- src/support/help.c | 2 +- src/support/help.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index fdbc3a257..699bf00f2 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -1045,7 +1045,7 @@ static void help_hintappend_multi(varray_char *result, const char *query, int in } /** Build a hint for a failed query and append to result (caller may clear result first). */ -static void help_queryhint(const char *query, varray_char *result) { +void help_queryhint(const char *query, varray_char *result) { if (!result) return; char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; diff --git a/src/support/help.h b/src/support/help.h index d65489859..1bb393c52 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -155,6 +155,9 @@ bool morpho_helpastext(char *query, varray_char *result); /** Look up help for query and write raw markdown into result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topicrawmd.) */ bool morpho_helpasmd(char *query, varray_char *result); +/** Build a hint for a failed query */ +void help_queryhint(const char *query, varray_char *result); + void help_initialize(void); void help_finalize(void); From 135c2ef0cb93cbee93367e985b56848959077250 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 21:47:40 -0500 Subject: [PATCH 294/473] Fix help_topictotext to avoid redundant checks --- src/support/help.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 699bf00f2..3e0b33f5b 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -232,6 +232,7 @@ typedef struct { /* Forward declarations */ static void md_push_simpleblock(parser *p, md_parseout *out, size_t block_start, md_blocktype type); +static void md_push_blank(parser *p, md_parseout *out); static void md_push_header(parser *p, md_parseout *out, size_t block_start, size_t title_start, size_t title_len); static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start); @@ -484,6 +485,7 @@ bool md_parseblock(parser *p, void *out) { } else if (parse_checktokenadvance(p, MD_LEFTSQUAREBRACE)) { return md_parselink(p, out); } else if (parse_checktokenadvance(p, MD_NEWLINE)) { // blank line + md_push_blank(p, ctx); return true; } else if (parse_checktoken(p, MD_EOF)) { return true; // let outer loop exit @@ -646,6 +648,13 @@ static void md_push_list(parser *p, md_parseout *out, size_t block_start) { md_push_simpleblock(p, out, block_start, MD_BLOCK_LIST); } +/** Push a blank line as MD_BLOCK_BLANK. Call after consuming the newline token. */ +static void md_push_blank(parser *p, md_parseout *out) { + const char *base = out->file->source; + size_t block_start = (size_t)(p->previous.start - base); + md_push_simpleblock(p, out, block_start, MD_BLOCK_BLANK); +} + static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t label_start, size_t label_len, size_t target_start, size_t target_len) { const char *base = out->file->source; size_t block_end = md_block_end(p, base); @@ -898,8 +907,10 @@ bool help_topictotext(const help_topic *t, varray_char *result) { size_t tlen = md_clamp_span(b->as.header.title.start, b->as.header.title.length, src_len); const char *p = src + b->as.header.title.start; while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } // strip leading # and space - if (tlen > 0) varray_charadd(result, (char *) p, (int) tlen); - varray_charadd(result, "\n\n", 2); + if (tlen > 0) { + varray_charadd(result, (char *) p, (int) tlen); + varray_charadd(result, "\n", 1); + } break; } case MD_BLOCK_PARAGRAPH: @@ -909,9 +920,11 @@ bool help_topictotext(const help_topic *t, varray_char *result) { if (len > 0 && src[b->span.start + len - 1] != '\n') varray_charadd(result, "\n", 1); break; case MD_BLOCK_LINK_DEF: - case MD_BLOCK_BLANK: case MD_BLOCK_THEMATIC_BREAK: break; // omit from plain text (thematic breaks render as blank lines) + case MD_BLOCK_BLANK: + varray_charadd(result, "\n", 1); + break; } } return true; From 29f8e0c6e38d7bab70d1a84ce512165611a50aa0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 16 Feb 2026 22:14:00 -0500 Subject: [PATCH 295/473] Add null terminators --- src/support/help.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 3e0b33f5b..421b46aaa 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -909,7 +909,7 @@ bool help_topictotext(const help_topic *t, varray_char *result) { while (tlen && (*p == '#' || (unsigned char)*p <= ' ')) { p++; tlen--; } // strip leading # and space if (tlen > 0) { varray_charadd(result, (char *) p, (int) tlen); - varray_charadd(result, "\n", 1); + varray_charwrite(result, '\n'); } break; } @@ -923,10 +923,11 @@ bool help_topictotext(const help_topic *t, varray_char *result) { case MD_BLOCK_THEMATIC_BREAK: break; // omit from plain text (thematic breaks render as blank lines) case MD_BLOCK_BLANK: - varray_charadd(result, "\n", 1); + varray_charwrite(result, '\n'); break; } } + varray_charwrite(result, '\0'); return true; } @@ -1064,7 +1065,8 @@ void help_queryhint(const char *query, varray_char *result) { const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; int nsegs = help_parsequery(query, qbuf, segs); if (nsegs == 0) { - varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); + varray_charadd(result, MORPHO_HELP_NOTFOUND, strlen(MORPHO_HELP_NOTFOUND)); + varray_charwrite(result, '\0'); return; } // Single segment: multi-match hint, or "not found" + closest, or NOTFOUND @@ -1073,19 +1075,23 @@ void help_queryhint(const char *query, varray_char *result) { int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); if (n >= 2) { help_hintappend_multi(result, query, multi, n); + varray_charwrite(result, '\0'); return; } if (n == 0) { help_hintappend(result, query, help_findclosesttopic(segs[0])); + varray_charwrite(result, '\0'); return; } - varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); + varray_charadd(result, MORPHO_HELP_NOTFOUND, strlen(MORPHO_HELP_NOTFOUND)); + varray_charwrite(result, '\0'); return; } // Multi-segment: resolve first, then walk subtopics; on first failure suggest path.closest int idx = help_findtopic(&s_topics, segs[0]); if (idx < 0) { help_hintappend(result, query, help_findclosesttopic(segs[0])); + varray_charwrite(result, '\0'); return; } char path[MORPHO_MAX_HELPQUERY_LENGTH]; @@ -1103,6 +1109,7 @@ void help_queryhint(const char *query, varray_char *result) { snprintf(suggest, sizeof(suggest), "%s.%s", path, closest); } help_hintappend(result, query, suggest[0] ? suggest : NULL); + varray_charwrite(result, '\0'); return; } idx = next; @@ -1111,7 +1118,8 @@ void help_queryhint(const char *query, varray_char *result) { int n = snprintf(path + path_len, (size_t)(sizeof(path) - path_len), ".%s", segs[i]); if (n > 0) path_len += (n < (int) sizeof(path) - path_len) ? n : (int) sizeof(path) - 1 - path_len; } - varray_charadd(result, MORPHO_HELP_NOTFOUND, (int) (sizeof(MORPHO_HELP_NOTFOUND) - 1)); + varray_charadd(result, MORPHO_HELP_NOTFOUND, strlen(MORPHO_HELP_NOTFOUND)); + varray_charwrite(result, '\0'); } /* ********************************************************************** From 8266eadb497d24812230a2052af30937df89dfe6 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 06:33:24 -0500 Subject: [PATCH 296/473] Alias table --- src/support/help.c | 111 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 2 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 421b46aaa..d1a177118 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -553,16 +553,33 @@ int md_topic_compare(const void *a, const void *b) { return strcmp(ta->name, tb->name); } +int md_alias_compare(const void *a, const void *b) { + const md_alias *aa = (const md_alias *) a; + const md_alias *ab = (const md_alias *) b; + return strcmp(aa->name, ab->name); +} + void help_sorttopics(varray_md_topic *topics) { if (topics->data && topics->count > 0) qsort(topics->data, topics->count, sizeof(md_topic), md_topic_compare); } +void help_sortaliases(varray_md_alias *aliases) { + if (aliases->data && aliases->count > 0) + qsort(aliases->data, aliases->count, sizeof(md_alias), md_alias_compare); +} + int help_findtopic(varray_md_topic *topics, const char *name) { - if (!topics->data || topics->count == 0) return -1; + if (!topics->data || topics->count == 0) { + // If no topics, check aliases + return help_findalias(name); + } md_topic key = { .name = (char *) name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; md_topic *found = (md_topic *) bsearch(&key, topics->data, topics->count, sizeof(md_topic), md_topic_compare); - return found ? (int) (found - topics->data) : -1; + if (found) return (int) (found - topics->data); + + // Not found in topics, check aliases + return help_findalias(name); } /** End offset of the block from the last consumed token. */ @@ -664,6 +681,81 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t varray_md_blockwrite(&out->file->blocks, b); } +/* ********************************************************************** + * Help topic aliases + * ********************************************************************** */ + +/** Alias entry: maps an alias name to a topic index. */ +typedef struct { + char *name; /* lowercase, owned */ + int topic_index; +} md_alias; + +DECLARE_VARRAY(md_alias, md_alias); + +static varray_md_alias s_aliases; + +/** Process link definitions in a file to create aliases from [tag...]: # (alias) entries. */ +static void help_processlinkdefs(int file_index) { + if (file_index < 0 || (unsigned int) file_index >= s_files.count) return; + const md_file *file = &s_files.data[file_index]; + const char *base = file->source; + + for (unsigned int i = 0; i < file->blocks.count; i++) { + const md_block *b = &file->blocks.data[i]; + if (b->type != MD_BLOCK_LINK_DEF) continue; + + // Check if label starts with "tag" + size_t label_len = md_clamp_span(b->as.link_def.label.start, b->as.link_def.label.length, file->sourcelen); + if (label_len < 3) continue; + const char *label = base + b->as.link_def.label.start; + if (tolower((unsigned char) label[0]) != 't' || tolower((unsigned char) label[1]) != 'a' || tolower((unsigned char) label[2]) != 'g') continue; + + // Extract alias name from target (find text in parentheses) + size_t target_start = b->as.link_def.target.start; + size_t target_len = md_clamp_span(target_start, b->as.link_def.target.length, file->sourcelen); + const char *target = base + target_start, *open = NULL, *close = NULL; + for (const char *p = target; p < target + target_len && !close; p++) { + if (!open && *p == '(') open = p + 1; + else if (open && *p == ')') { close = p; break; } + } + if (!open || !close || close == open) continue; + + // Allocate and lowercase alias name + size_t len = (size_t)(close - open); + char *alias_name = (char *) MORPHO_MALLOC(len + 1); + if (!alias_name) continue; + for (size_t j = 0; j < len; j++) alias_name[j] = (char) tolower((unsigned char) open[j]); + alias_name[len] = '\0'; + + // Check for duplicates (topics and existing aliases) + bool duplicate = false; + if (s_topics.data && s_topics.count > 0) { + md_topic key = { .name = alias_name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; + if (bsearch(&key, s_topics.data, s_topics.count, sizeof(md_topic), md_topic_compare)) duplicate = true; + } + if (!duplicate) { + for (unsigned int j = 0; j < s_aliases.count; j++) { + if (s_aliases.data[j].name && strcmp(s_aliases.data[j].name, alias_name) == 0) { duplicate = true; break; } + } + } + if (duplicate) { MORPHO_FREE(alias_name); continue; } + + // Find topic (most recent header before this block) + int topic_idx = -1; + for (int j = (int) i - 1; j >= 0; j--) { + if (file->blocks.data[j].type == MD_BLOCK_HEADER) { + topic_idx = help_findtopicbyblock(file_index, (unsigned int) j); + break; + } + } + if (topic_idx < 0) { MORPHO_FREE(alias_name); continue; } + + // Create alias + varray_md_aliaswrite(&s_aliases, (md_alias) { .name = alias_name, .topic_index = topic_idx }); + } +} + /* ********************************************************************** * Help topic lookup and content range * ********************************************************************** */ @@ -765,6 +857,14 @@ static int help_findtopicbyblock(int file_index, unsigned int block_index) { return -1; } +/** Find topic index by alias name. Returns -1 if not found. */ +static int help_findalias(const char *name) { + if (!s_aliases.data || s_aliases.count == 0) return -1; + md_alias key = { .name = (char *) name, .topic_index = 0 }; + md_alias *found = (md_alias *) bsearch(&key, s_aliases.data, s_aliases.count, sizeof(md_alias), md_alias_compare); + return found ? found->topic_index : -1; +} + /** True if header title span (trimmed, lowercased) equals name. */ static bool help_headertitleeq(const char *base, size_t start, size_t len, const char *name) { md_trimspan(base, &start, &len); @@ -1003,6 +1103,7 @@ bool help_load(char *filename) { bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); if (ok) { varray_md_filewrite(&s_files, mdfile); + help_processlinkdefs((int) s_files.count - 1); } else { md_file_clear(&mdfile); // Remove topics added during the failed parse; they have file_index = s_files.count @@ -1028,6 +1129,7 @@ void help_findfiles(void) { } varray_valueclear(&files); help_sorttopics(&s_topics); + help_sortaliases(&s_aliases); } /* ********************************************************************** @@ -1203,6 +1305,7 @@ void help_initialize(void) { varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); + varray_md_aliasinit(&s_aliases); morpho_addfinalizefn(help_finalize); } @@ -1215,6 +1318,10 @@ void help_finalize(void) { if (s_topics.data[i].name) MORPHO_FREE(s_topics.data[i].name); } varray_md_topicclear(&s_topics); + for (unsigned int i = 0; i < s_aliases.count; i++) { + if (s_aliases.data[i].name) MORPHO_FREE(s_aliases.data[i].name); + } + varray_md_aliasclear(&s_aliases); } #endif From 472e7cab165cbe9c8e3cb2ec03be565002671f81 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 15:55:05 -0500 Subject: [PATCH 297/473] Move aliases into more coherent place --- src/support/help.c | 153 +++++++++++++++++++++------------------------ src/support/help.h | 8 +++ 2 files changed, 78 insertions(+), 83 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index d1a177118..ecea5a128 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -24,6 +24,16 @@ #ifdef MORPHO_INCLUDE_HELP +/** Static data structures */ +DEFINE_VARRAY(md_block, md_block); +DEFINE_VARRAY(md_file, md_file); +DEFINE_VARRAY(md_topic, md_topic); +DEFINE_VARRAY(md_alias, md_alias); + +static varray_md_file s_files; // List of help files +static varray_md_topic s_topics; // List of topics +static varray_md_alias s_aliases; // List of aliases + /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all * valid Markdown, although only a subset is used, and the help system interprets @@ -228,6 +238,7 @@ typedef struct { varray_md_topic *topics; int file_index; int current_header_level; // 1–3, set before md_parseheader + int current_topic_index; // Index of most recently created topic, or -1 } md_parseout; /* Forward declarations */ @@ -420,6 +431,8 @@ static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { return true; } +static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index); + /** Parses [label]: target (link def) or [text](url) an inline link. Caller has already consumed [. */ bool md_parselink(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; @@ -450,6 +463,10 @@ bool md_parselink(parser *p, void *out) { } size_t target_end = md_end_previous(p, base); size_t target_len = target_end > target_start ? (size_t)(target_end - target_start) : 0; + + // Check if this is a tag link definition and create alias if so + help_createalias(base, label_start, label_len, target_start, target_len, ctx->current_topic_index); + md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } @@ -522,10 +539,6 @@ void help_initializemdparser(parser *p, lexer *l, error *err, void *out) { * Markdown AST: definitions and topic list helpers * ********************************************************************** */ -DEFINE_VARRAY(md_block, md_block); -DEFINE_VARRAY(md_file, md_file); -DEFINE_VARRAY(md_topic, md_topic); - void md_block_clear(md_block *b) { varray_intclear(&b->children); } @@ -569,6 +582,8 @@ void help_sortaliases(varray_md_alias *aliases) { qsort(aliases->data, aliases->count, sizeof(md_alias), md_alias_compare); } +static int help_findalias(const char *name); + int help_findtopic(varray_md_topic *topics, const char *name) { if (!topics->data || topics->count == 0) { // If no topics, check aliases @@ -578,8 +593,7 @@ int help_findtopic(varray_md_topic *topics, const char *name) { md_topic *found = (md_topic *) bsearch(&key, topics->data, topics->count, sizeof(md_topic), md_topic_compare); if (found) return (int) (found - topics->data); - // Not found in topics, check aliases - return help_findalias(name); + return help_findalias(name); // Not found in topics, check aliases } /** End offset of the block from the last consumed token. */ @@ -652,6 +666,9 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size .parent_topic = -1 }; varray_md_topicwrite(out->topics, topic); + out->current_topic_index = (int) out->topics->count - 1; + } else { + out->current_topic_index = -1; } } @@ -685,84 +702,62 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t * Help topic aliases * ********************************************************************** */ -/** Alias entry: maps an alias name to a topic index. */ -typedef struct { - char *name; /* lowercase, owned */ - int topic_index; -} md_alias; - -DECLARE_VARRAY(md_alias, md_alias); - -static varray_md_alias s_aliases; +/** Find topic index by alias name. Returns -1 if not found. */ +static int help_findalias(const char *name) { + if (!s_aliases.data || s_aliases.count == 0) return -1; + md_alias key = { .name = (char *) name, .topic_index = 0 }; + md_alias *found = (md_alias *) bsearch(&key, s_aliases.data, s_aliases.count, sizeof(md_alias), md_alias_compare); + return found ? found->topic_index : -1; +} -/** Process link definitions in a file to create aliases from [tag...]: # (alias) entries. */ -static void help_processlinkdefs(int file_index) { - if (file_index < 0 || (unsigned int) file_index >= s_files.count) return; - const md_file *file = &s_files.data[file_index]; - const char *base = file->source; +/** Create an alias from a tag link definition. Returns true if alias was created. */ +static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index) { + if (topic_index < 0) return false; - for (unsigned int i = 0; i < file->blocks.count; i++) { - const md_block *b = &file->blocks.data[i]; - if (b->type != MD_BLOCK_LINK_DEF) continue; - - // Check if label starts with "tag" - size_t label_len = md_clamp_span(b->as.link_def.label.start, b->as.link_def.label.length, file->sourcelen); - if (label_len < 3) continue; - const char *label = base + b->as.link_def.label.start; - if (tolower((unsigned char) label[0]) != 't' || tolower((unsigned char) label[1]) != 'a' || tolower((unsigned char) label[2]) != 'g') continue; - - // Extract alias name from target (find text in parentheses) - size_t target_start = b->as.link_def.target.start; - size_t target_len = md_clamp_span(target_start, b->as.link_def.target.length, file->sourcelen); - const char *target = base + target_start, *open = NULL, *close = NULL; - for (const char *p = target; p < target + target_len && !close; p++) { - if (!open && *p == '(') open = p + 1; - else if (open && *p == ')') { close = p; break; } - } - if (!open || !close || close == open) continue; - - // Allocate and lowercase alias name - size_t len = (size_t)(close - open); - char *alias_name = (char *) MORPHO_MALLOC(len + 1); - if (!alias_name) continue; - for (size_t j = 0; j < len; j++) alias_name[j] = (char) tolower((unsigned char) open[j]); - alias_name[len] = '\0'; - - // Check for duplicates (topics and existing aliases) - bool duplicate = false; - if (s_topics.data && s_topics.count > 0) { - md_topic key = { .name = alias_name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; - if (bsearch(&key, s_topics.data, s_topics.count, sizeof(md_topic), md_topic_compare)) duplicate = true; - } - if (!duplicate) { - for (unsigned int j = 0; j < s_aliases.count; j++) { - if (s_aliases.data[j].name && strcmp(s_aliases.data[j].name, alias_name) == 0) { duplicate = true; break; } - } + // Check if label starts with "tag" + if (label_len < 3) return false; + const char *label = base + label_start; + if (tolower((unsigned char) label[0]) != 't' || tolower((unsigned char) label[1]) != 'a' || tolower((unsigned char) label[2]) != 'g') return false; + + // Extract alias name from target (find text in parentheses) + const char *target = base + target_start, *open = NULL, *close = NULL; + for (const char *p = target; p < target + target_len && !close; p++) { + if (!open && *p == '(') open = p + 1; + else if (open && *p == ')') { close = p; break; } + } + if (!open || !close || close == open) return false; + + // Allocate and lowercase alias name + size_t len = (size_t)(close - open); + char *alias_name = (char *) MORPHO_MALLOC(len + 1); + if (!alias_name) return false; + for (size_t j = 0; j < len; j++) alias_name[j] = (char) tolower((unsigned char) open[j]); + alias_name[len] = '\0'; + + // Check for duplicates (topics and existing aliases) + if (s_topics.data && s_topics.count > 0) { + md_topic key = { .name = alias_name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; + if (bsearch(&key, s_topics.data, s_topics.count, sizeof(md_topic), md_topic_compare)) { + MORPHO_FREE(alias_name); + return false; } - if (duplicate) { MORPHO_FREE(alias_name); continue; } - - // Find topic (most recent header before this block) - int topic_idx = -1; - for (int j = (int) i - 1; j >= 0; j--) { - if (file->blocks.data[j].type == MD_BLOCK_HEADER) { - topic_idx = help_findtopicbyblock(file_index, (unsigned int) j); - break; - } + } + for (unsigned int j = 0; j < s_aliases.count; j++) { + if (s_aliases.data[j].name && strcmp(s_aliases.data[j].name, alias_name) == 0) { + MORPHO_FREE(alias_name); + return false; } - if (topic_idx < 0) { MORPHO_FREE(alias_name); continue; } - - // Create alias - varray_md_aliaswrite(&s_aliases, (md_alias) { .name = alias_name, .topic_index = topic_idx }); } + + // Create alias + varray_md_aliaswrite(&s_aliases, (md_alias) { .name = alias_name, .topic_index = topic_index }); + return true; } /* ********************************************************************** * Help topic lookup and content range * ********************************************************************** */ -static varray_md_file s_files; -static varray_md_topic s_topics; - /** Maximum number of query segments (e.g. "System respondsto" -> 2). */ #define MORPHO_HELP_QUERY_MAXSEGMENTS 8 /** Max edit distance to suggest a topic (only suggest if close enough). */ @@ -857,14 +852,6 @@ static int help_findtopicbyblock(int file_index, unsigned int block_index) { return -1; } -/** Find topic index by alias name. Returns -1 if not found. */ -static int help_findalias(const char *name) { - if (!s_aliases.data || s_aliases.count == 0) return -1; - md_alias key = { .name = (char *) name, .topic_index = 0 }; - md_alias *found = (md_alias *) bsearch(&key, s_aliases.data, s_aliases.count, sizeof(md_alias), md_alias_compare); - return found ? found->topic_index : -1; -} - /** True if header title span (trimmed, lowercased) equals name. */ static bool help_headertitleeq(const char *base, size_t start, size_t len, const char *name) { md_trimspan(base, &start, &len); @@ -1052,7 +1039,8 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { .file = file, .topics = topics, .file_index = file_index, - .current_header_level = 1 + .current_header_level = 1, + .current_topic_index = -1 }; lexer l; help_initializemdlexer(&l, file->source); @@ -1103,7 +1091,6 @@ bool help_load(char *filename) { bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); if (ok) { varray_md_filewrite(&s_files, mdfile); - help_processlinkdefs((int) s_files.count - 1); } else { md_file_clear(&mdfile); // Remove topics added during the failed parse; they have file_index = s_files.count diff --git a/src/support/help.h b/src/support/help.h index 1bb393c52..e9ec7bc03 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -78,6 +78,14 @@ typedef struct { DECLARE_VARRAY(md_topic, md_topic); +/** Alias entry: maps an alias name to a topic index. */ +typedef struct { + char *name; /* lowercase, owned */ + int topic_index; +} md_alias; + +DECLARE_VARRAY(md_alias, md_alias); + /** Initialize / clear a block (clears children). */ void md_block_clear(md_block *b); From a18c4696a387f5a7118fad47713bfea9afa0aea3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 16:03:22 -0500 Subject: [PATCH 298/473] Clean up help.c and reorganize --- src/support/help.c | 54 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index ecea5a128..23c65484d 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -24,15 +24,18 @@ #ifdef MORPHO_INCLUDE_HELP -/** Static data structures */ +/* ********************************************************************** + * Data structures and static data + * ********************************************************************** */ + DEFINE_VARRAY(md_block, md_block); DEFINE_VARRAY(md_file, md_file); DEFINE_VARRAY(md_topic, md_topic); DEFINE_VARRAY(md_alias, md_alias); -static varray_md_file s_files; // List of help files -static varray_md_topic s_topics; // List of topics -static varray_md_alias s_aliases; // List of aliases +static varray_md_file s_files; +static varray_md_topic s_topics; +static varray_md_alias s_aliases; /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all @@ -175,7 +178,7 @@ bool md_lexpreprocess(lexer *l, token *tok, error *err) { } /* ------------------------------------------------------- - * Initialize a Markdown lexer + * Lexer initialization * ------------------------------------------------------- */ void help_initializemdlexer(lexer *l, const char *src) { @@ -536,7 +539,7 @@ void help_initializemdparser(parser *p, lexer *l, error *err, void *out) { } /* ********************************************************************** - * Markdown AST: definitions and topic list helpers + * Markdown AST: block and file life cycle * ********************************************************************** */ void md_block_clear(md_block *b) { @@ -560,6 +563,10 @@ void md_file_clear(md_file *f) { varray_md_blockclear(&f->blocks); } +/* ------------------------------------------------------- + * Topic and alias comparison and sorting + * ------------------------------------------------------- */ + int md_topic_compare(const void *a, const void *b) { const md_topic *ta = (const md_topic *) a; const md_topic *tb = (const md_topic *) b; @@ -596,6 +603,10 @@ int help_findtopic(varray_md_topic *topics, const char *name) { return help_findalias(name); // Not found in topics, check aliases } +/* ------------------------------------------------------- + * Block construction (spans, init, push) + * ------------------------------------------------------- */ + /** End offset of the block from the last consumed token. */ static size_t md_block_end(parser *p, const char *base) { return md_end_previous(p, base); @@ -760,11 +771,16 @@ static bool help_createalias(const char *base, size_t label_start, size_t label_ /** Maximum number of query segments (e.g. "System respondsto" -> 2). */ #define MORPHO_HELP_QUERY_MAXSEGMENTS 8 +#define MORPHO_HELP_MAX_MULTIMATCH 8 /** Max edit distance to suggest a topic (only suggest if close enough). */ #define MORPHO_HELP_SUGGEST_MAXDIST 3 /** Edit distance return when string too long (no match). */ #define MORPHO_HELP_EDIT_NOMATCH 255 +/* ------------------------------------------------------- + * Query parsing + * ------------------------------------------------------- */ + /** Parse query into lowercased segments in qbuf; segs[] points into qbuf. Returns nsegs (0 if none). */ static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { // Copy query, lowercase, replace '.' and ' ' with nul @@ -787,6 +803,10 @@ static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { return nsegs; } +/* ------------------------------------------------------- + * Topic hierarchy (parent, display path, subtopic) + * ------------------------------------------------------- */ + /** Find parent topic index (same file, level < current, block_index < current, largest block_index). */ static int help_findparent(int idx) { if (idx < 0 || (unsigned int) idx >= s_topics.count) return -1; @@ -832,8 +852,11 @@ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { } } +/* ------------------------------------------------------- + * Topic lookup by name or block + * ------------------------------------------------------- */ + /** Find all topic indices with given name. Fills indices[] up to max, returns count. */ -#define MORPHO_HELP_MAX_MULTIMATCH 8 static int help_findallbyname(const char *name, int indices[], int max) { int n = 0; for (unsigned int i = 0; i < s_topics.count && n < max; i++) { @@ -885,6 +908,10 @@ static int help_findsubtopic(int parent_idx, const char *name) { return -1; } +/* ------------------------------------------------------- + * Edit distance and suggestions + * ------------------------------------------------------- */ + /** Levenshtein distance between two strings (for "did you mean"). * If max_dist is provided (> 0), returns early if distance exceeds it (returns max_dist + 1). * This allows early exit when we only care about distances within a threshold. */ @@ -949,6 +976,10 @@ static const char *help_findclosestsubtopic(int parent_idx, const char *name) { return best; } +/* ------------------------------------------------------- + * Topic content and rendering + * ------------------------------------------------------- */ + /** Number of blocks that form this topic's content (header + following until next header of any level). */ static unsigned int help_topiccontentnblocks(const md_topic *topic, const md_file *file) { unsigned int i = topic->block_index; @@ -1032,6 +1063,11 @@ bool help_topicrawmd(const help_topic *t, varray_char *result) { return true; } +/* ********************************************************************** + * Morpho help files (load and parse) + * ********************************************************************** */ + +/** Parse a markdown file and append blocks/topics to the given arrays. */ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { error err; error_init(&err); @@ -1065,10 +1101,6 @@ bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { return ok; } -/* ********************************************************************** - * Morpho help files - * ********************************************************************** */ - /** Loads a help file into the AST (appends to s_files and s_topics). */ bool help_load(char *filename) { FILE *f = fopen(filename, "r"); From 1fde68fc0b7c98c91a33c7a1e34686341bca2d65 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:12:04 -0500 Subject: [PATCH 299/473] Fix aliases --- src/support/help.c | 29 ++++++++++------------------- src/support/help.h | 6 +++--- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 23c65484d..8665f1c58 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -592,10 +592,6 @@ void help_sortaliases(varray_md_alias *aliases) { static int help_findalias(const char *name); int help_findtopic(varray_md_topic *topics, const char *name) { - if (!topics->data || topics->count == 0) { - // If no topics, check aliases - return help_findalias(name); - } md_topic key = { .name = (char *) name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; md_topic *found = (md_topic *) bsearch(&key, topics->data, topics->count, sizeof(md_topic), md_topic_compare); if (found) return (int) (found - topics->data); @@ -713,17 +709,18 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t * Help topic aliases * ********************************************************************** */ -/** Find topic index by alias name. Returns -1 if not found. */ +/** Find topic index by alias name. Returns -1 if not found. Resolves topic by name so index is correct after sorting. */ static int help_findalias(const char *name) { if (!s_aliases.data || s_aliases.count == 0) return -1; - md_alias key = { .name = (char *) name, .topic_index = 0 }; + md_alias key = { .name = (char *) name, .topic_name = NULL }; md_alias *found = (md_alias *) bsearch(&key, s_aliases.data, s_aliases.count, sizeof(md_alias), md_alias_compare); - return found ? found->topic_index : -1; + if (!found || !found->topic_name) return -1; + return help_findtopic(&s_topics, found->topic_name); } -/** Create an alias from a tag link definition. Returns true if alias was created. */ +/** Create an alias from a tag link definition. Returns true if alias was created. Stores a pointer to the topic's name so resolution stays valid after topics are sorted. */ static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index) { - if (topic_index < 0) return false; + if (topic_index < 0 || (unsigned int) topic_index >= s_topics.count) return false; // Check if label starts with "tag" if (label_len < 3) return false; @@ -745,14 +742,7 @@ static bool help_createalias(const char *base, size_t label_start, size_t label_ for (size_t j = 0; j < len; j++) alias_name[j] = (char) tolower((unsigned char) open[j]); alias_name[len] = '\0'; - // Check for duplicates (topics and existing aliases) - if (s_topics.data && s_topics.count > 0) { - md_topic key = { .name = alias_name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; - if (bsearch(&key, s_topics.data, s_topics.count, sizeof(md_topic), md_topic_compare)) { - MORPHO_FREE(alias_name); - return false; - } - } + // Check for duplicate alias name for (unsigned int j = 0; j < s_aliases.count; j++) { if (s_aliases.data[j].name && strcmp(s_aliases.data[j].name, alias_name) == 0) { MORPHO_FREE(alias_name); @@ -760,8 +750,9 @@ static bool help_createalias(const char *base, size_t label_start, size_t label_ } } - // Create alias - varray_md_aliaswrite(&s_aliases, (md_alias) { .name = alias_name, .topic_index = topic_index }); + // Store pointer to topic's name + const char *topic_name = s_topics.data[topic_index].name; + varray_md_aliaswrite(&s_aliases, (md_alias) { .name = alias_name, .topic_name = topic_name }); return true; } diff --git a/src/support/help.h b/src/support/help.h index e9ec7bc03..5a4c8cbf3 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -78,10 +78,10 @@ typedef struct { DECLARE_VARRAY(md_topic, md_topic); -/** Alias entry: maps an alias name to a topic index. */ +/** Alias entry: maps an alias name to a topic by the topic's name. topic_name is a pointer to the topic's name (not owned); lookup resolves it by bsearch so it remains valid after topics are sorted. */ typedef struct { - char *name; /* lowercase, owned */ - int topic_index; + char *name; /* alias name, lowercase, owned */ + const char *topic_name; /* topic name to resolve (points into topic, not owned) */ } md_alias; DECLARE_VARRAY(md_alias, md_alias); From b1dd1947aabb8fd69e160bab67c6ee80ea724dfd Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 20:31:23 -0500 Subject: [PATCH 300/473] Simplify help implementation --- src/classes/strng.h | 8 +- src/support/help.c | 332 ++++++++++++++++++++------------------------ src/support/help.h | 28 ++-- 3 files changed, 162 insertions(+), 206 deletions(-) diff --git a/src/classes/strng.h b/src/classes/strng.h index ab96dd662..d8cf16ffc 100644 --- a/src/classes/strng.h +++ b/src/classes/strng.h @@ -37,11 +37,11 @@ typedef struct { /** Extracts the string length from a value */ #define MORPHO_GETSTRINGLENGTH(val) (((objectstring *) MORPHO_GETOBJECT(val))->length) -/** Use to create static strings on the C stack */ -#define MORPHO_STATICSTRING(cstring) { .obj.type=OBJECT_STRING, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .string=cstring, .length=strlen(cstring) } +/** Use to create static strings on the C stack (cstring may be const char *). */ +#define MORPHO_STATICSTRING(cstring) { .obj.type=OBJECT_STRING, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .string=(char *)(cstring), .length=strlen(cstring) } -/** Use to create static strings on the C stack */ -#define MORPHO_STATICSTRINGWITHLENGTH(cstring, len) { .obj.type=OBJECT_STRING, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .string=cstring, .length=len } +/** Use to create static strings on the C stack (cstring may be const char *). */ +#define MORPHO_STATICSTRINGWITHLENGTH(cstring, len) { .obj.type=OBJECT_STRING, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .string=(char *)(cstring), .length=len } #define OBJECT_STRINGLABEL "string" // These are only used by the parser... Should be moved? diff --git a/src/support/help.c b/src/support/help.c index 8665f1c58..2abfec326 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -15,6 +15,8 @@ #include "help.h" #include "resources.h" #include "common.h" +#include "dictionary.h" +#include "list.h" #include "error.h" #include "lex.h" @@ -31,11 +33,10 @@ DEFINE_VARRAY(md_block, md_block); DEFINE_VARRAY(md_file, md_file); DEFINE_VARRAY(md_topic, md_topic); -DEFINE_VARRAY(md_alias, md_alias); static varray_md_file s_files; static varray_md_topic s_topics; -static varray_md_alias s_aliases; +static dictionary s_names; // Map names or aliases to topic index or list of indices /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all @@ -564,39 +565,88 @@ void md_file_clear(md_file *f) { } /* ------------------------------------------------------- - * Topic and alias comparison and sorting + * Name index (single dict: name/alias -> index or List of indices) * ------------------------------------------------------- */ -int md_topic_compare(const void *a, const void *b) { - const md_topic *ta = (const md_topic *) a; - const md_topic *tb = (const md_topic *) b; - return strcmp(ta->name, tb->name); +/** Build s_names from topic names (value = index or List). Call once after all files loaded and parent_topic set. Aliases may already be in dict from parse. */ +static void help_buildnameindex(void) { + for (unsigned int i = 0; i < s_topics.count; i++) { + if (!MORPHO_ISSTRING(s_topics.data[i].name)) continue; + value key = s_topics.data[i].name; + value v; + if (!dictionary_get(&s_names, key, &v)) { + dictionary_insert(&s_names, key, MORPHO_INTEGER((int) i)); + continue; + } + if (MORPHO_ISINTEGER(v) && MORPHO_GETINTEGERVALUE(v) == (int) i) continue; // already points to this topic + objectlist *list; + if (MORPHO_ISINTEGER(v)) { + list = object_newlist(0, NULL); + if (!list) continue; + list_append(list, v); + dictionary_insert(&s_names, key, MORPHO_OBJECT(list)); + } else list = MORPHO_GETLIST(v); + list_append(list, MORPHO_INTEGER((int) i)); + } } -int md_alias_compare(const void *a, const void *b) { - const md_alias *aa = (const md_alias *) a; - const md_alias *ab = (const md_alias *) b; - return strcmp(aa->name, ab->name); +/** Get first topic index from dict value (integer or first element of list). Returns -1 if not found or invalid. */ +static int help_indexvalue_first(value v) { + if (MORPHO_ISINTEGER(v)) return MORPHO_GETINTEGERVALUE(v); + if (MORPHO_ISLIST(v)) { + objectlist *list = MORPHO_GETLIST(v); + if (list_length(list) == 0) return -1; + value first; + if (list_getelement(list, 0, &first) && MORPHO_ISINTEGER(first)) + return MORPHO_GETINTEGERVALUE(first); + } + return -1; } -void help_sorttopics(varray_md_topic *topics) { - if (topics->data && topics->count > 0) - qsort(topics->data, topics->count, sizeof(md_topic), md_topic_compare); +/** Fill indices[] from dict value (integer or list). Returns count. */ +static int help_indexvalue_collect(value v, int indices[], int max) { + if (MORPHO_ISINTEGER(v)) { + if (max > 0) indices[0] = MORPHO_GETINTEGERVALUE(v); + return 1; + } else if (MORPHO_ISLIST(v)) { + objectlist *list = MORPHO_GETLIST(v); + unsigned int n = list_length(list); + if ((int) n > max) n = (unsigned int) max; + for (unsigned int i = 0; i < n; i++) { + value el; + if (list_getelement(list, (int) i, &el) && MORPHO_ISINTEGER(el)) + indices[i] = MORPHO_GETINTEGERVALUE(el); + } + return (int) list_length(list); + } + return 0; } -void help_sortaliases(varray_md_alias *aliases) { - if (aliases->data && aliases->count > 0) - qsort(aliases->data, aliases->count, sizeof(md_alias), md_alias_compare); +int help_findtopic(const char *name) { + objectstring key_str = MORPHO_STATICSTRING(name); + value key = MORPHO_OBJECT(&key_str); + value v; + if (!dictionary_get(&s_names, key, &v)) return -1; + return help_indexvalue_first(v); } -static int help_findalias(const char *name); +int help_findallbyname(const char *name, int indices[], int max) { + objectstring key_str = MORPHO_STATICSTRING(name); + value key = MORPHO_OBJECT(&key_str); + value v; + if (!dictionary_get(&s_names, key, &v)) return 0; + return help_indexvalue_collect(v, indices, max); +} -int help_findtopic(varray_md_topic *topics, const char *name) { - md_topic key = { .name = (char *) name, .file_index = 0, .block_index = 0, .level = 0, .parent_topic = -1 }; - md_topic *found = (md_topic *) bsearch(&key, topics->data, topics->count, sizeof(md_topic), md_topic_compare); - if (found) return (int) (found - topics->data); - - return help_findalias(name); // Not found in topics, check aliases +/** Find child of parent topic with given name. Returns topic index or -1. */ +static int help_findchild(int parent_idx, const char *name) { + objectstring key_str = MORPHO_STATICSTRING(name); + value key = MORPHO_OBJECT(&key_str); + for (unsigned int j = 0; j < s_topics.count; j++) { + if (s_topics.data[j].parent_topic != parent_idx) continue; + if (MORPHO_ISEQUAL(s_topics.data[j].name, key)) return (int) j; + } + return -1; } /* ------------------------------------------------------- @@ -620,6 +670,12 @@ static void md_trimspan(const char *base, size_t *start, size_t *len) { while (*len && (unsigned char) base[*start + *len - 1] <= ' ') (*len)--; } +/** Lowercase len bytes from src into buf and null-terminate. Caller must provide buf of size at least len + 1. */ +static void help_lowercase_into(const char *src, size_t len, char *buf) { + for (size_t i = 0; i < len; i++) buf[i] = (char) tolower((unsigned char) src[i]); + buf[len] = '\0'; +} + /** Initialize common block fields (type, span, parent, children). */ static void md_block_init(md_block *b, md_blocktype type, size_t block_start, size_t block_end) { b->type = type; @@ -657,26 +713,29 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size md_block_set_header(&b, out->current_header_level, title_start, title_len); varray_md_blockwrite(&out->file->blocks, b); - // Topic: trimmed title span, lowercased, for index lookup + // Topic: trimmed title span, lowercased Morpho string (stack buffer) size_t ns = title_start, nl = title_len; md_trimspan(base, &ns, &nl); - char *name = (char *) MORPHO_MALLOC(nl + 1); - if (name) { - for (size_t i = 0; i < nl; i++) - name[i] = (char) tolower((unsigned char) base[ns + i]); - name[nl] = '\0'; - md_topic topic = { - .name = name, - .file_index = out->file_index, - .block_index = out->file->blocks.count - 1, - .level = out->current_header_level, - .parent_topic = -1 - }; - varray_md_topicwrite(out->topics, topic); - out->current_topic_index = (int) out->topics->count - 1; - } else { + if (nl > MORPHO_MAX_HELPQUERY_LENGTH) { out->current_topic_index = -1; + return; + } + char buf[nl + 1]; + help_lowercase_into(base + ns, nl, buf); + value name_val = object_stringfromcstring(buf, nl); + if (!MORPHO_ISSTRING(name_val)) { + out->current_topic_index = -1; + return; } + md_topic topic = { + .name = name_val, + .file_index = out->file_index, + .block_index = out->file->blocks.count - 1, + .level = out->current_header_level, + .parent_topic = -1 + }; + varray_md_topicwrite(out->topics, topic); + out->current_topic_index = (int) out->topics->count - 1; } static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start) { @@ -709,50 +768,25 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t * Help topic aliases * ********************************************************************** */ -/** Find topic index by alias name. Returns -1 if not found. Resolves topic by name so index is correct after sorting. */ -static int help_findalias(const char *name) { - if (!s_aliases.data || s_aliases.count == 0) return -1; - md_alias key = { .name = (char *) name, .topic_name = NULL }; - md_alias *found = (md_alias *) bsearch(&key, s_aliases.data, s_aliases.count, sizeof(md_alias), md_alias_compare); - if (!found || !found->topic_name) return -1; - return help_findtopic(&s_topics, found->topic_name); -} - -/** Create an alias from a tag link definition. Returns true if alias was created. Stores a pointer to the topic's name so resolution stays valid after topics are sorted. */ +/** Create an alias from a tag link definition. Inserts alias -> topic index into s_names. */ static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index) { if (topic_index < 0 || (unsigned int) topic_index >= s_topics.count) return false; - - // Check if label starts with "tag" if (label_len < 3) return false; const char *label = base + label_start; if (tolower((unsigned char) label[0]) != 't' || tolower((unsigned char) label[1]) != 'a' || tolower((unsigned char) label[2]) != 'g') return false; - - // Extract alias name from target (find text in parentheses) const char *target = base + target_start, *open = NULL, *close = NULL; for (const char *p = target; p < target + target_len && !close; p++) { if (!open && *p == '(') open = p + 1; else if (open && *p == ')') { close = p; break; } } if (!open || !close || close == open) return false; - - // Allocate and lowercase alias name size_t len = (size_t)(close - open); - char *alias_name = (char *) MORPHO_MALLOC(len + 1); - if (!alias_name) return false; - for (size_t j = 0; j < len; j++) alias_name[j] = (char) tolower((unsigned char) open[j]); - alias_name[len] = '\0'; - - // Check for duplicate alias name - for (unsigned int j = 0; j < s_aliases.count; j++) { - if (s_aliases.data[j].name && strcmp(s_aliases.data[j].name, alias_name) == 0) { - MORPHO_FREE(alias_name); - return false; - } - } - - // Store pointer to topic's name - const char *topic_name = s_topics.data[topic_index].name; - varray_md_aliaswrite(&s_aliases, (md_alias) { .name = alias_name, .topic_name = topic_name }); + if (len > MORPHO_MAX_HELPQUERY_LENGTH) return false; + char alias_buf[len + 1]; + help_lowercase_into(open, len, alias_buf); + value alias_val = object_stringfromcstring(alias_buf, len); + if (!MORPHO_ISSTRING(alias_val)) return false; + dictionary_insert(&s_names, alias_val, MORPHO_INTEGER(topic_index)); return true; } @@ -827,78 +861,21 @@ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { return; } const md_topic *t = &s_topics.data[idx]; - if (!t->name) { + const char *name = MORPHO_ISSTRING(t->name) ? MORPHO_GETCSTRING(t->name) : NULL; + if (!name) { buf[0] = '\0'; return; } int p = (t->level > 1) ? help_findparent(idx) : -1; if (p >= 0) { - // Recurse for parent path, then append ".name" help_topic_displaypath(p, buf, bufsize); size_t len = strlen(buf); - if (len + 1 < bufsize) snprintf(buf + len, bufsize - len, ".%s", t->name); + if (len + 1 < bufsize) snprintf(buf + len, bufsize - len, ".%s", name); } else { - // Top-level or no parent: just the topic name - snprintf(buf, bufsize, "%s", t->name); + snprintf(buf, bufsize, "%s", name); } } -/* ------------------------------------------------------- - * Topic lookup by name or block - * ------------------------------------------------------- */ - -/** Find all topic indices with given name. Fills indices[] up to max, returns count. */ -static int help_findallbyname(const char *name, int indices[], int max) { - int n = 0; - for (unsigned int i = 0; i < s_topics.count && n < max; i++) { - if (s_topics.data[i].name && strcmp(s_topics.data[i].name, name) == 0) - indices[n++] = (int) i; - } - return n; -} - -/** Find topic index by file and block index. Returns -1 if not found. */ -static int help_findtopicbyblock(int file_index, unsigned int block_index) { - for (unsigned int i = 0; i < s_topics.count; i++) { - if (s_topics.data[i].file_index == file_index && s_topics.data[i].block_index == block_index) - return (int) i; - } - return -1; -} - -/** True if header title span (trimmed, lowercased) equals name. */ -static bool help_headertitleeq(const char *base, size_t start, size_t len, const char *name) { - md_trimspan(base, &start, &len); - while (len && *name && (char) tolower((unsigned char) base[start]) == *name) { - start++; - len--; - name++; - } - return len == 0 && *name == '\0'; -} - -/** Find first subtopic of parent with given name (same file, block after parent, level > parent). Returns topic index or -1. */ -static int help_findsubtopic(int parent_idx, const char *name) { - if (parent_idx < 0 || (unsigned int) parent_idx >= s_topics.count) return -1; - const md_topic *parent = &s_topics.data[parent_idx]; - if (parent->file_index < 0 || (unsigned int) parent->file_index >= s_files.count) return -1; - const md_file *file = &s_files.data[parent->file_index]; - const char *base = file->source; - size_t base_len = file->sourcelen; - - // Scan blocks after parent; stop when we hit same-or-higher level (left section) - for (unsigned int i = parent->block_index + 1; i < file->blocks.count; i++) { - const md_block *b = &file->blocks.data[i]; - if (b->type != MD_BLOCK_HEADER) continue; - if (b->as.header.level <= parent->level) return -1; // left section - size_t start = b->as.header.title.start; - size_t len = md_clamp_span(start, b->as.header.title.length, base_len); - if (help_headertitleeq(base, start, len, name)) - return help_findtopicbyblock(parent->file_index, i); - } - return -1; -} - /* ------------------------------------------------------- * Edit distance and suggestions * ------------------------------------------------------- */ @@ -940,9 +917,10 @@ static const char *help_findclosesttopic(const char *name) { const char *best = NULL; unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; for (unsigned int i = 0; i < s_topics.count; i++) { - if (s_topics.data[i].level != 1 || !s_topics.data[i].name) continue; - unsigned int d = help_editdistance(name, s_topics.data[i].name, best_d - 1); - if (d < best_d) { best_d = d; best = s_topics.data[i].name; } + if (s_topics.data[i].level != 1 || !MORPHO_ISSTRING(s_topics.data[i].name)) continue; + const char *tn = MORPHO_GETCSTRING(s_topics.data[i].name); + unsigned int d = help_editdistance(name, tn, best_d - 1); + if (d < best_d) { best_d = d; best = tn; } } return best; } @@ -950,19 +928,14 @@ static const char *help_findclosesttopic(const char *name) { /** Find subtopic name under parent closest to name; NULL if none within distance. */ static const char *help_findclosestsubtopic(int parent_idx, const char *name) { if (parent_idx < 0 || (unsigned int) parent_idx >= s_topics.count) return NULL; - const md_topic *parent = &s_topics.data[parent_idx]; - if (parent->file_index < 0 || (unsigned int) parent->file_index >= s_files.count) return NULL; - const md_file *file = &s_files.data[parent->file_index]; const char *best = NULL; unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; - for (unsigned int i = parent->block_index + 1; i < file->blocks.count; i++) { - const md_block *b = &file->blocks.data[i]; - if (b->type != MD_BLOCK_HEADER) continue; - if (b->as.header.level <= parent->level) break; - int ti = help_findtopicbyblock(parent->file_index, i); - if (ti < 0 || !s_topics.data[ti].name) continue; - unsigned int d = help_editdistance(name, s_topics.data[ti].name, best_d - 1); - if (d < best_d) { best_d = d; best = s_topics.data[ti].name; } + for (unsigned int j = 0; j < s_topics.count; j++) { + if (s_topics.data[j].parent_topic != parent_idx) continue; + if (!MORPHO_ISSTRING(s_topics.data[j].name)) continue; + const char *tn = MORPHO_GETCSTRING(s_topics.data[j].name); + unsigned int d = help_editdistance(name, tn, best_d - 1); + if (d < best_d) { best_d = d; best = tn; } } return best; } @@ -994,17 +967,18 @@ static void help_topicfill(help_topic *out, const md_topic *topic, const md_file } /** Validate topic and get source pointer/length; return false if invalid. */ -static bool help_topicsrc(const help_topic *t, varray_char *result, const char **src, size_t *src_len) { - if (!t || !t->file || !t->file->source || !result) return false; +static bool help_topicsrc(const help_topic *t, const char **src, size_t *src_len) { + if (!t || !t->file || !t->file->source) return false; *src = t->file->source; *src_len = t->file->sourcelen; return true; } bool help_topictotext(const help_topic *t, varray_char *result) { + if (!result) return false; const char *src; size_t src_len; - if (!help_topicsrc(t, result, &src, &src_len)) return false; + if (!help_topicsrc(t, &src, &src_len)) return false; for (unsigned int i = 0; i < t->nblocks; i++) { const md_block *b = &t->content_blocks[i]; size_t len = md_clamp_span(b->span.start, b->span.length, src_len); @@ -1041,9 +1015,10 @@ bool help_topictotext(const help_topic *t, varray_char *result) { } bool help_topicrawmd(const help_topic *t, varray_char *result) { + if (!result) return false; const char *src; size_t src_len; - if (!help_topicsrc(t, result, &src, &src_len)) return false; + if (!help_topicsrc(t, &src, &src_len)) return false; for (unsigned int i = 0; i < t->nblocks; i++) { const md_block *b = &t->content_blocks[i]; size_t len = md_clamp_span(b->span.start, b->span.length, src_len); @@ -1058,13 +1033,13 @@ bool help_topicrawmd(const help_topic *t, varray_char *result) { * Morpho help files (load and parse) * ********************************************************************** */ -/** Parse a markdown file and append blocks/topics to the given arrays. */ -bool help_parse(md_file *file, varray_md_topic *topics, int file_index) { +/** Parse a markdown file and append blocks/topics to s_topics. */ +bool help_parse(md_file *file, int file_index) { error err; error_init(&err); md_parseout parseout = { .file = file, - .topics = topics, + .topics = &s_topics, .file_index = file_index, .current_header_level = 1, .current_topic_index = -1 @@ -1111,23 +1086,19 @@ bool help_load(char *filename) { mdfile.sourcelen = len; mdfile.filename = morpho_strdup(filename); unsigned int n_topics_before = s_topics.count; - bool ok = help_parse(&mdfile, &s_topics, (int) s_files.count); + bool ok = help_parse(&mdfile, (int) s_files.count); if (ok) { varray_md_filewrite(&s_files, mdfile); } else { md_file_clear(&mdfile); // Remove topics added during the failed parse; they have file_index = s_files.count - while (s_topics.count > n_topics_before) { - md_topic *t = &s_topics.data[s_topics.count - 1]; - if (t->name) MORPHO_FREE(t->name); - t->name = NULL; + while (s_topics.count > n_topics_before) s_topics.count--; - } } return ok; } -/** Finds and loads all help files; populates s_files and s_topics, then sorts topics. */ +/** Finds and loads all help files; sets parent_topic for each topic, then builds name index. */ void help_findfiles(void) { varray_value files; varray_valueinit(&files); @@ -1138,8 +1109,9 @@ void help_findfiles(void) { for (unsigned int i = 0; i < files.count; i++) morpho_freeobject(files.data[i]); } varray_valueclear(&files); - help_sorttopics(&s_topics); - help_sortaliases(&s_aliases); + for (unsigned int i = 0; i < s_topics.count; i++) + s_topics.data[i].parent_topic = help_findparent(i); + help_buildnameindex(); } /* ********************************************************************** @@ -1200,7 +1172,7 @@ void help_queryhint(const char *query, varray_char *result) { return; } // Multi-segment: resolve first, then walk subtopics; on first failure suggest path.closest - int idx = help_findtopic(&s_topics, segs[0]); + int idx = help_findtopic(segs[0]); if (idx < 0) { help_hintappend(result, query, help_findclosesttopic(segs[0])); varray_charwrite(result, '\0'); @@ -1211,7 +1183,7 @@ void help_queryhint(const char *query, varray_char *result) { if (path_len < 0 || path_len >= (int) sizeof(path)) path_len = (int) sizeof(path) - 1; for (int i = 1; i < nsegs; i++) { - int next = help_findsubtopic(idx, segs[i]); + int next = help_findchild(idx, segs[i]); if (next < 0) { const char *closest = help_findclosestsubtopic(idx, segs[i]); char suggest[MORPHO_MAX_HELPQUERY_LENGTH] = {0}; @@ -1251,7 +1223,7 @@ bool morpho_helpastopic(const char *query, help_topic *out) { int nsegs = help_parsequery(query, qbuf, segs); if (nsegs <= 0) return false; - // Single segment: resolve by name; fail if 0 or multiple matches (caller shows hint) + // Single segment: dict gives 0, 1, or many; if many caller shows "did you mean?" int idx; if (nsegs == 1) { int multi[MORPHO_HELP_MAX_MULTIMATCH]; @@ -1259,19 +1231,18 @@ bool morpho_helpastopic(const char *query, help_topic *out) { if (n == 1) { idx = multi[0]; } else if (n == 0) { - idx = help_findtopic(&s_topics, segs[0]); // fallback: bsearch by name - if (idx < 0) return false; + return false; } else { - return false; // multiple matches: caller will show hint + return false; // multiple matches: caller shows hint } } else { - idx = help_findtopic(&s_topics, segs[0]); + idx = help_findtopic(segs[0]); // first match if (idx < 0) return false; } - // Resolve remaining segments as subtopics + // Resolve remaining segments by walking children for (int i = 1; i < nsegs; i++) { - idx = help_findsubtopic(idx, segs[i]); + idx = help_findchild(idx, segs[i]); if (idx < 0) return false; } @@ -1283,14 +1254,14 @@ bool morpho_helpastopic(const char *query, help_topic *out) { return true; } -bool morpho_helpastext(char *query, varray_char *result) { +bool morpho_helpastext(const char *query, varray_char *result) { help_topic t; if (morpho_helpastopic(query, &t)) return help_topictotext(&t, result); help_queryhint(query, result); return false; } -bool morpho_helpasmd(char *query, varray_char *result) { +bool morpho_helpasmd(const char *query, varray_char *result) { help_topic t; if (morpho_helpastopic(query, &t)) return help_topicrawmd(&t, result); help_queryhint(query, result); @@ -1315,23 +1286,18 @@ void help_initialize(void) { varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); - varray_md_aliasinit(&s_aliases); + dictionary_init(&s_names); morpho_addfinalizefn(help_finalize); } -/** @brief Finalization: free all files and topics. */ +/** @brief Finalization: free all files and topics. Name keys not owned; free List values then clear dict. */ void help_finalize(void) { for (unsigned int i = 0; i < s_files.count; i++) md_file_clear(&s_files.data[i]); varray_md_fileclear(&s_files); - for (unsigned int i = 0; i < s_topics.count; i++) { - if (s_topics.data[i].name) MORPHO_FREE(s_topics.data[i].name); - } varray_md_topicclear(&s_topics); - for (unsigned int i = 0; i < s_aliases.count; i++) { - if (s_aliases.data[i].name) MORPHO_FREE(s_aliases.data[i].name); - } - varray_md_aliasclear(&s_aliases); + dictionary_freecontents(&s_names, false, true); /* free List values; keys (names) are VM-owned */ + dictionary_clear(&s_names); } #endif diff --git a/src/support/help.h b/src/support/help.h index 5a4c8cbf3..4f1062c51 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -11,6 +11,7 @@ #include #include "varray.h" +#include "value.h" /** Maximum length of a help query string (used for lookup buffer). */ #define MORPHO_MAX_HELPQUERY_LENGTH 512 @@ -67,9 +68,9 @@ typedef struct { DECLARE_VARRAY(md_file, md_file); -/** Topic entry: header in the master list, sorted by name for O(log n) lookup. */ +/** Topic entry: header in the master list (load order). Hierarchy by parent_topic; lookup by name/alias via single dictionary (value = index or List of indices). */ typedef struct { - char *name; /* lowercase, owned */ + value name; /* Morpho string (lowercase); not owned */ int file_index; unsigned int block_index; int level; /* header level 1–3 */ @@ -78,14 +79,6 @@ typedef struct { DECLARE_VARRAY(md_topic, md_topic); -/** Alias entry: maps an alias name to a topic by the topic's name. topic_name is a pointer to the topic's name (not owned); lookup resolves it by bsearch so it remains valid after topics are sorted. */ -typedef struct { - char *name; /* alias name, lowercase, owned */ - const char *topic_name; /* topic name to resolve (points into topic, not owned) */ -} md_alias; - -DECLARE_VARRAY(md_alias, md_alias); - /** Initialize / clear a block (clears children). */ void md_block_clear(md_block *b); @@ -93,14 +86,11 @@ void md_block_clear(md_block *b); void md_file_init(md_file *f); void md_file_clear(md_file *f); -/** Topic list: compare by name for bsearch. */ -int md_topic_compare(const void *a, const void *b); - -/** Sort topic list by name (call after loading so lookup is O(log n)). */ -void help_sorttopics(varray_md_topic *topics); +/** Find one topic index by name or alias (first match if multiple). Returns -1 if not found. */ +int help_findtopic(const char *name); -/** Find topic index by name (binary search). Returns -1 if not found. */ -int help_findtopic(varray_md_topic *topics, const char *name); +/** Find all topic indices with given name. Fills indices[] up to max, returns count. */ +int help_findallbyname(const char *name, int indices[], int max); /* ------------------------------------------------------- * Help topic view (for flexible rendering) @@ -158,10 +148,10 @@ bool help_topicrawmd(const help_topic *t, varray_char *result); bool morpho_helpastopic(const char *query, help_topic *out); /** Look up help for query and write plain-text result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topictotext.) */ -bool morpho_helpastext(char *query, varray_char *result); +bool morpho_helpastext(const char *query, varray_char *result); /** Look up help for query and write raw markdown into result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topicrawmd.) */ -bool morpho_helpasmd(char *query, varray_char *result); +bool morpho_helpasmd(const char *query, varray_char *result); /** Build a hint for a failed query */ void help_queryhint(const char *query, varray_char *result); From 0cc849a2bb3da489279500fd581ee837493f88d9 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 20:51:36 -0500 Subject: [PATCH 301/473] Ensure topic names are correctly freed --- src/support/help.c | 52 ++++++++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 2abfec326..4bf819644 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -36,7 +36,7 @@ DEFINE_VARRAY(md_topic, md_topic); static varray_md_file s_files; static varray_md_topic s_topics; -static dictionary s_names; // Map names or aliases to topic index or list of indices +static dictionary s_names; /* name (interned on build) -> topic index or list of indices */ /** The interactive help system uses a collection of Markdown files, located in * MORPHO_HELPFOLDER, that define available topics. Help files are all @@ -568,23 +568,35 @@ void md_file_clear(md_file *f) { * Name index (single dict: name/alias -> index or List of indices) * ------------------------------------------------------- */ -/** Build s_names from topic names (value = index or List). Call once after all files loaded and parent_topic set. Aliases may already be in dict from parse. */ +/** Build s_names from topic names; intern names into s_names (one string per distinct name). Call once after all files loaded and parent_topic set. Aliases may already be in dict from parse. */ static void help_buildnameindex(void) { for (unsigned int i = 0; i < s_topics.count; i++) { if (!MORPHO_ISSTRING(s_topics.data[i].name)) continue; value key = s_topics.data[i].name; - value v; - if (!dictionary_get(&s_names, key, &v)) { + value interned = dictionary_intern(&s_names, key); + if (MORPHO_ISNIL(interned)) { dictionary_insert(&s_names, key, MORPHO_INTEGER((int) i)); + s_topics.data[i].name = key; continue; } - if (MORPHO_ISINTEGER(v) && MORPHO_GETINTEGERVALUE(v) == (int) i) continue; // already points to this topic + if (!MORPHO_ISSAME(interned, key)) morpho_freeobject(key); + s_topics.data[i].name = interned; + value v; + if (!dictionary_get(&s_names, interned, &v)) continue; + if (MORPHO_ISNIL(v)) { + dictionary_insert(&s_names, interned, MORPHO_INTEGER((int) i)); + continue; + } + if (MORPHO_ISINTEGER(v) && MORPHO_GETINTEGERVALUE(v) == (int) i) continue; /* already this topic */ objectlist *list; if (MORPHO_ISINTEGER(v)) { list = object_newlist(0, NULL); if (!list) continue; list_append(list, v); - dictionary_insert(&s_names, key, MORPHO_OBJECT(list)); + if (!dictionary_insert(&s_names, interned, MORPHO_OBJECT(list))) { + morpho_freeobject(MORPHO_OBJECT(list)); + continue; + } } else list = MORPHO_GETLIST(v); list_append(list, MORPHO_INTEGER((int) i)); } @@ -603,21 +615,22 @@ static int help_indexvalue_first(value v) { return -1; } -/** Fill indices[] from dict value (integer or list). Returns count. */ +/** Fill indices[] from dict value (integer or list). Returns number of indices written (at most max). */ static int help_indexvalue_collect(value v, int indices[], int max) { if (MORPHO_ISINTEGER(v)) { if (max > 0) indices[0] = MORPHO_GETINTEGERVALUE(v); return 1; } else if (MORPHO_ISLIST(v)) { objectlist *list = MORPHO_GETLIST(v); - unsigned int n = list_length(list); - if ((int) n > max) n = (unsigned int) max; - for (unsigned int i = 0; i < n; i++) { + unsigned int list_len = list_length(list); + int written = 0; + for (unsigned int i = 0; i < list_len && written < max; i++) { value el; - if (list_getelement(list, (int) i, &el) && MORPHO_ISINTEGER(el)) - indices[i] = MORPHO_GETINTEGERVALUE(el); + if (list_getelement(list, (int) i, &el) && MORPHO_ISINTEGER(el)) { + indices[written++] = MORPHO_GETINTEGERVALUE(el); + } } - return (int) list_length(list); + return written; } return 0; } @@ -1091,9 +1104,12 @@ bool help_load(char *filename) { varray_md_filewrite(&s_files, mdfile); } else { md_file_clear(&mdfile); - // Remove topics added during the failed parse; they have file_index = s_files.count - while (s_topics.count > n_topics_before) + // Remove topics added during the failed parse; free their names (never interned). + while (s_topics.count > n_topics_before) { + unsigned int i = s_topics.count - 1; + if (MORPHO_ISOBJECT(s_topics.data[i].name)) morpho_freeobject(s_topics.data[i].name); s_topics.count--; + } } return ok; } @@ -1290,14 +1306,14 @@ void help_initialize(void) { morpho_addfinalizefn(help_finalize); } -/** @brief Finalization: free all files and topics. Name keys not owned; free List values then clear dict. */ +/** @brief Finalization: free all files, topics, and name index. */ void help_finalize(void) { for (unsigned int i = 0; i < s_files.count; i++) md_file_clear(&s_files.data[i]); varray_md_fileclear(&s_files); - varray_md_topicclear(&s_topics); - dictionary_freecontents(&s_names, false, true); /* free List values; keys (names) are VM-owned */ + dictionary_freecontents(&s_names, true, true); dictionary_clear(&s_names); + varray_md_topicclear(&s_topics); } #endif From f56be92fd4a6c7b0df710b6f97247b3846164404 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:01:07 -0500 Subject: [PATCH 302/473] Build name dictionary incrementally --- src/classes/list.h | 1 + src/datastructures/dictionary.c | 10 ++++ src/datastructures/dictionary.h | 1 + src/support/help.c | 101 +++++++++++++++++++------------- 4 files changed, 72 insertions(+), 41 deletions(-) diff --git a/src/classes/list.h b/src/classes/list.h index ba7feb88d..5d37c2a4b 100644 --- a/src/classes/list.h +++ b/src/classes/list.h @@ -75,6 +75,7 @@ value List_getindex(vm *v, int nargs, value *args); bool list_resize(objectlist *list, int size); void list_append(objectlist *list, value v); +bool list_remove(objectlist *list, value val); unsigned int list_length(objectlist *list); bool list_getelement(objectlist *list, int i, value *out); void list_sort(objectlist *list); diff --git a/src/datastructures/dictionary.c b/src/datastructures/dictionary.c index 975f83483..bd12ee7c6 100644 --- a/src/datastructures/dictionary.c +++ b/src/datastructures/dictionary.c @@ -385,6 +385,16 @@ static inline bool _dictionary_get(dictionary *dict, value key, bool intern, val return false; } +/** @brief If a key equal to key is present, returns that stored key and (if val) its value; otherwise returns MORPHO_NIL. */ +value dictionary_getkey(dictionary *dict, value key, value *val) { + dictionaryentry *entry = NULL; + if (dictionary_find(dict, key, false, &entry)) { + if (val) *val = entry->val; + return entry->key; + } + return MORPHO_NIL; +} + /** @brief Retrieves a value from a dictionary given a key * @param[in] dict the dictionary to get * @param[in] key key to locate diff --git a/src/datastructures/dictionary.h b/src/datastructures/dictionary.h index 43b4c3158..efcb6d863 100644 --- a/src/datastructures/dictionary.h +++ b/src/datastructures/dictionary.h @@ -58,6 +58,7 @@ void dictionary_freecontents(dictionary *dict, bool freekeys, bool freevals); bool dictionary_insert(dictionary *dict, value key, value val); bool dictionary_insertintern(dictionary *dict, value key, value val); value dictionary_intern(dictionary *dict, value key); +value dictionary_getkey(dictionary *dict, value key, value *val); bool dictionary_get(dictionary *dict, value key, value *val); bool dictionary_getintern(dictionary *dict, value key, value *val); bool dictionary_remove(dictionary *dict, value key); diff --git a/src/support/help.c b/src/support/help.c index 4bf819644..cac931200 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -568,38 +568,62 @@ void md_file_clear(md_file *f) { * Name index (single dict: name/alias -> index or List of indices) * ------------------------------------------------------- */ -/** Build s_names from topic names; intern names into s_names (one string per distinct name). Call once after all files loaded and parent_topic set. Aliases may already be in dict from parse. */ -static void help_buildnameindex(void) { - for (unsigned int i = 0; i < s_topics.count; i++) { - if (!MORPHO_ISSTRING(s_topics.data[i].name)) continue; - value key = s_topics.data[i].name; - value interned = dictionary_intern(&s_names, key); - if (MORPHO_ISNIL(interned)) { - dictionary_insert(&s_names, key, MORPHO_INTEGER((int) i)); - s_topics.data[i].name = key; - continue; - } - if (!MORPHO_ISSAME(interned, key)) morpho_freeobject(key); - s_topics.data[i].name = interned; - value v; - if (!dictionary_get(&s_names, interned, &v)) continue; +static bool help_name_referenced_by(value name, unsigned int keep_count) { + for (unsigned int j = 0; j < keep_count; j++) + if (MORPHO_ISSAME(s_topics.data[j].name, name)) return true; + return false; +} + +/** Remove topic_index from s_names (rollback). Frees the name key only if the entry is removed and no topic in [0, keep_count) has that name. */ +static void help_nameindex_remove(int topic_index, unsigned int keep_count) { + if (topic_index < 0 || (unsigned int) topic_index >= s_topics.count) return; + value name = s_topics.data[topic_index].name; + if (!MORPHO_ISOBJECT(name)) return; + value v; + if (!dictionary_get(&s_names, name, &v)) return; + bool remove_entry = false; + if (MORPHO_ISINTEGER(v)) { + if (MORPHO_GETINTEGERVALUE(v) != topic_index) return; + remove_entry = true; + } else if (MORPHO_ISLIST(v)) { + list_remove(MORPHO_GETLIST(v), MORPHO_INTEGER(topic_index)); + remove_entry = (list_length(MORPHO_GETLIST(v)) == 0); + } + if (remove_entry) { + if (MORPHO_ISLIST(v)) morpho_freeobject(v); + dictionary_remove(&s_names, name); + if (!help_name_referenced_by(name, keep_count)) morpho_freeobject(name); + } +} + +/** Add topic_index under name (buf, len). Look up with static key; if present use existing key and update value, else allocate and insert. Returns canonical name value. */ +static value help_nameindex_add(const char *buf, size_t len, int topic_index) { + objectstring key_obj = MORPHO_STATICSTRINGWITHLENGTH(buf, len); + value key = MORPHO_OBJECT(&key_obj); + value v; + value existing = dictionary_getkey(&s_names, key, &v); + if (!MORPHO_ISNIL(existing)) { if (MORPHO_ISNIL(v)) { - dictionary_insert(&s_names, interned, MORPHO_INTEGER((int) i)); - continue; - } - if (MORPHO_ISINTEGER(v) && MORPHO_GETINTEGERVALUE(v) == (int) i) continue; /* already this topic */ - objectlist *list; - if (MORPHO_ISINTEGER(v)) { - list = object_newlist(0, NULL); - if (!list) continue; - list_append(list, v); - if (!dictionary_insert(&s_names, interned, MORPHO_OBJECT(list))) { + dictionary_insert(&s_names, existing, MORPHO_INTEGER(topic_index)); + } else if (MORPHO_ISINTEGER(v)) { + if (MORPHO_GETINTEGERVALUE(v) == topic_index) return existing; + objectlist *list = object_newlist(0, NULL); + if (list) { + list_append(list, v); + list_append(list, MORPHO_INTEGER(topic_index)); + if (dictionary_insert(&s_names, existing, MORPHO_OBJECT(list))) + return existing; morpho_freeobject(MORPHO_OBJECT(list)); - continue; } - } else list = MORPHO_GETLIST(v); - list_append(list, MORPHO_INTEGER((int) i)); + } else { + list_append(MORPHO_GETLIST(v), MORPHO_INTEGER(topic_index)); + } + return existing; } + value name_val = object_stringfromcstring(buf, len); + if (!MORPHO_ISSTRING(name_val)) return MORPHO_NIL; + dictionary_insert(&s_names, name_val, MORPHO_INTEGER(topic_index)); + return name_val; } /** Get first topic index from dict value (integer or first element of list). Returns -1 if not found or invalid. */ @@ -735,20 +759,21 @@ static void md_push_header(parser *p, md_parseout *out, size_t block_start, size } char buf[nl + 1]; help_lowercase_into(base + ns, nl, buf); - value name_val = object_stringfromcstring(buf, nl); - if (!MORPHO_ISSTRING(name_val)) { + int topic_index = (int) out->topics->count; + value name = help_nameindex_add(buf, nl, topic_index); + if (MORPHO_ISNIL(name)) { out->current_topic_index = -1; return; } md_topic topic = { - .name = name_val, + .name = name, .file_index = out->file_index, .block_index = out->file->blocks.count - 1, .level = out->current_header_level, .parent_topic = -1 }; varray_md_topicwrite(out->topics, topic); - out->current_topic_index = (int) out->topics->count - 1; + out->current_topic_index = topic_index; } static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start) { @@ -797,10 +822,7 @@ static bool help_createalias(const char *base, size_t label_start, size_t label_ if (len > MORPHO_MAX_HELPQUERY_LENGTH) return false; char alias_buf[len + 1]; help_lowercase_into(open, len, alias_buf); - value alias_val = object_stringfromcstring(alias_buf, len); - if (!MORPHO_ISSTRING(alias_val)) return false; - dictionary_insert(&s_names, alias_val, MORPHO_INTEGER(topic_index)); - return true; + return !MORPHO_ISNIL(help_nameindex_add(alias_buf, len, topic_index)); } /* ********************************************************************** @@ -1104,17 +1126,15 @@ bool help_load(char *filename) { varray_md_filewrite(&s_files, mdfile); } else { md_file_clear(&mdfile); - // Remove topics added during the failed parse; free their names (never interned). while (s_topics.count > n_topics_before) { - unsigned int i = s_topics.count - 1; - if (MORPHO_ISOBJECT(s_topics.data[i].name)) morpho_freeobject(s_topics.data[i].name); + help_nameindex_remove((int) s_topics.count - 1, n_topics_before); s_topics.count--; } } return ok; } -/** Finds and loads all help files; sets parent_topic for each topic, then builds name index. */ +/** Finds and loads all help files; sets parent_topic for each topic. Name index is built incrementally during parse. */ void help_findfiles(void) { varray_value files; varray_valueinit(&files); @@ -1127,7 +1147,6 @@ void help_findfiles(void) { varray_valueclear(&files); for (unsigned int i = 0; i < s_topics.count; i++) s_topics.data[i].parent_topic = help_findparent(i); - help_buildnameindex(); } /* ********************************************************************** From 02af82eed44dd15c78acc3cbd9258684de8174a8 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:05:46 -0500 Subject: [PATCH 303/473] Fix potential leak --- src/support/help.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/support/help.c b/src/support/help.c index cac931200..2ec396a20 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -622,7 +622,10 @@ static value help_nameindex_add(const char *buf, size_t len, int topic_index) { } value name_val = object_stringfromcstring(buf, len); if (!MORPHO_ISSTRING(name_val)) return MORPHO_NIL; - dictionary_insert(&s_names, name_val, MORPHO_INTEGER(topic_index)); + if (!dictionary_insert(&s_names, name_val, MORPHO_INTEGER(topic_index))) { + morpho_freeobject(name_val); + return MORPHO_NIL; + } return name_val; } From 3af67fcf27eb84e28bb8ee7cd002496c95500d57 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:13:26 -0500 Subject: [PATCH 304/473] Simplify help_nameindex_add --- src/support/help.c | 43 +++++++++++++++++++------------------------ 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 2ec396a20..9aa369341 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -599,34 +599,29 @@ static void help_nameindex_remove(int topic_index, unsigned int keep_count) { /** Add topic_index under name (buf, len). Look up with static key; if present use existing key and update value, else allocate and insert. Returns canonical name value. */ static value help_nameindex_add(const char *buf, size_t len, int topic_index) { objectstring key_obj = MORPHO_STATICSTRINGWITHLENGTH(buf, len); - value key = MORPHO_OBJECT(&key_obj); - value v; - value existing = dictionary_getkey(&s_names, key, &v); - if (!MORPHO_ISNIL(existing)) { + value name = MORPHO_OBJECT(&key_obj), v; + value key = dictionary_getkey(&s_names, name, &v); + if (MORPHO_ISNIL(key)) { + key = object_stringfromcstring(buf, len); + if (!MORPHO_ISSTRING(key)) return MORPHO_NIL; + if (!dictionary_insert(&s_names, key, MORPHO_INTEGER(topic_index))) { + morpho_freeobject(key); + return MORPHO_NIL; + } + } else { if (MORPHO_ISNIL(v)) { - dictionary_insert(&s_names, existing, MORPHO_INTEGER(topic_index)); + dictionary_insert(&s_names, key, MORPHO_INTEGER(topic_index)); } else if (MORPHO_ISINTEGER(v)) { - if (MORPHO_GETINTEGERVALUE(v) == topic_index) return existing; - objectlist *list = object_newlist(0, NULL); + if (MORPHO_GETINTEGERVALUE(v) == topic_index) return key; + value new[2] = { v, MORPHO_INTEGER(topic_index) }; + objectlist *list = object_newlist(2, new); if (list) { - list_append(list, v); - list_append(list, MORPHO_INTEGER(topic_index)); - if (dictionary_insert(&s_names, existing, MORPHO_OBJECT(list))) - return existing; - morpho_freeobject(MORPHO_OBJECT(list)); + if (!dictionary_insert(&s_names, key, MORPHO_OBJECT(list))) + morpho_freeobject(MORPHO_OBJECT(list)); } - } else { - list_append(MORPHO_GETLIST(v), MORPHO_INTEGER(topic_index)); - } - return existing; - } - value name_val = object_stringfromcstring(buf, len); - if (!MORPHO_ISSTRING(name_val)) return MORPHO_NIL; - if (!dictionary_insert(&s_names, name_val, MORPHO_INTEGER(topic_index))) { - morpho_freeobject(name_val); - return MORPHO_NIL; - } - return name_val; + } else if (MORPHO_ISLIST(v)) list_append(MORPHO_GETLIST(v), MORPHO_INTEGER(topic_index)); + } + return key; } /** Get first topic index from dict value (integer or first element of list). Returns -1 if not found or invalid. */ From 60564d14484c8d1fbf6b5f3a0a728fb1c35093a9 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 21:27:46 -0500 Subject: [PATCH 305/473] morpho_helptopics API function --- src/support/help.c | 23 ++++++++++++++++++++--- src/support/help.h | 3 +++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 9aa369341..b1a8ccbc3 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -1245,12 +1245,16 @@ void help_queryhint(const char *query, varray_char *result) { static bool s_help_files_loaded = false; -/** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ -bool morpho_helpastopic(const char *query, help_topic *out) { - if (!s_help_files_loaded) { // Load help files on first use +static void help_ensureloaded(void) { + if (!s_help_files_loaded) { help_findfiles(); s_help_files_loaded = true; } +} + +/** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ +bool morpho_helpastopic(const char *query, help_topic *out) { + help_ensureloaded(); char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; int nsegs = help_parsequery(query, qbuf, segs); @@ -1301,6 +1305,19 @@ bool morpho_helpasmd(const char *query, varray_char *result) { return false; } +/** Fill out with top-level topic names (level == 1); each name added once (by identity). */ +void morpho_helptopics(varray_value *out) { + if (!out) return; + help_ensureloaded(); + for (unsigned int i = 0; i < s_topics.count; i++) { + if (s_topics.data[i].level != 1 || !MORPHO_ISSTRING(s_topics.data[i].name)) continue; + value name = s_topics.data[i].name; + unsigned int idx; + if (varray_valuefindsame(out, name, &idx)) continue; + varray_valuewrite(out, name); + } +} + /* ********************************************************************** * Initialization/finalization * ********************************************************************** */ diff --git a/src/support/help.h b/src/support/help.h index 4f1062c51..358ac33ef 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -153,6 +153,9 @@ bool morpho_helpastext(const char *query, varray_char *result); /** Look up help for query and write raw markdown into result. Returns true if topic found. (Convenience wrapper for morpho_helpastopic + help_topicrawmd.) */ bool morpho_helpasmd(const char *query, varray_char *result); +/** Fill a varray_value with top-level topic names (Morpho string values). Loads help on first use. Caller must initialize/clear the varray. */ +void morpho_helptopics(varray_value *out); + /** Build a hint for a failed query */ void help_queryhint(const char *query, varray_char *result); From 7f9bd28e88f25bb208a3eaaf026774c7e15bf458 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 17 Feb 2026 22:04:16 -0500 Subject: [PATCH 306/473] toplevel forces topics into the top level --- src/support/help.c | 27 +++++++++++++++++++-------- src/support/help.h | 1 + 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index b1a8ccbc3..a9b8c374d 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -437,6 +437,14 @@ static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index); +/** Case-insensitive comparison of substring (s, n) with literal (lit, lit_len). */ +static bool help_casencmp(const char *s, size_t n, const char *lit, size_t lit_len) { + if (n != lit_len) return false; + for (size_t i = 0; i < n; i++) + if (tolower((unsigned char) s[i]) != (unsigned char) lit[i]) return false; + return true; +} + /** Parses [label]: target (link def) or [text](url) an inline link. Caller has already consumed [. */ bool md_parselink(parser *p, void *out) { md_parseout *ctx = (md_parseout *) out; @@ -468,9 +476,8 @@ bool md_parselink(parser *p, void *out) { size_t target_end = md_end_previous(p, base); size_t target_len = target_end > target_start ? (size_t)(target_end - target_start) : 0; - // Check if this is a tag link definition and create alias if so + if (help_casencmp(base + label_start, label_len, "toplevel", 8)) ctx->file->promote_subtopics = true; help_createalias(base, label_start, label_len, target_start, target_len, ctx->current_topic_index); - md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } @@ -551,6 +558,7 @@ void md_file_init(md_file *f) { f->source = NULL; f->sourcelen = 0; f->filename = NULL; + f->promote_subtopics = false; varray_md_blockinit(&f->blocks); } @@ -807,9 +815,7 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t /** Create an alias from a tag link definition. Inserts alias -> topic index into s_names. */ static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index) { if (topic_index < 0 || (unsigned int) topic_index >= s_topics.count) return false; - if (label_len < 3) return false; - const char *label = base + label_start; - if (tolower((unsigned char) label[0]) != 't' || tolower((unsigned char) label[1]) != 'a' || tolower((unsigned char) label[2]) != 'g') return false; + if (label_len < 3 || !help_casencmp(base + label_start, 3, "tag", 3)) return false; const char *target = base + target_start, *open = NULL, *close = NULL; for (const char *p = target; p < target + target_len && !close; p++) { if (!open && *p == '(') open = p + 1; @@ -1305,13 +1311,18 @@ bool morpho_helpasmd(const char *query, varray_char *result) { return false; } -/** Fill out with top-level topic names (level == 1); each name added once (by identity). */ +/** Fill out with top-level topic names (level == 1, or level == 2 when file has [toplevel] tag); each name added once (by identity). */ void morpho_helptopics(varray_value *out) { if (!out) return; help_ensureloaded(); for (unsigned int i = 0; i < s_topics.count; i++) { - if (s_topics.data[i].level != 1 || !MORPHO_ISSTRING(s_topics.data[i].name)) continue; - value name = s_topics.data[i].name; + const md_topic *t = &s_topics.data[i]; + if (!MORPHO_ISSTRING(t->name)) continue; + bool include = (t->level == 1); + if (!include && t->file_index >= 0 && (unsigned int) t->file_index < s_files.count) + include = s_files.data[t->file_index].promote_subtopics; + if (!include) continue; + value name = t->name; unsigned int idx; if (varray_valuefindsame(out, name, &idx)) continue; varray_valuewrite(out, name); diff --git a/src/support/help.h b/src/support/help.h index 358ac33ef..57587d41a 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -63,6 +63,7 @@ typedef struct { char *source; size_t sourcelen; char *filename; /* Owned filename/path for error reporting */ + bool promote_subtopics; /* [toplevel]: # directive: include ## from this file in top-level topic list */ varray_md_block blocks; } md_file; From 5a7f9a8ab17e5fb609a1d1926afa4037388de065 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 08:55:11 -0500 Subject: [PATCH 307/473] md_parseurl to extract show->subtopics --- src/support/help.c | 68 ++++++++++++++++++++++++++++++++++++++-------- src/support/help.h | 6 +++- 2 files changed, 61 insertions(+), 13 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index a9b8c374d..6db81c8d7 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -406,13 +406,39 @@ bool md_parselist(parser *p, void *out) { return true; } -/** Parses the rest of a link definition after ]: (e.g. " # (target)" or " # (subtopics)"). Consumes until newline or EOF. */ -bool md_parseurl(parser *p, void *out) { - while (!parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) { +/** Parses the rest of a link definition after ]: (e.g. " # (target)" or " # (subtopics)"). Consumes until newline or EOF. + * Extracts target URL and any parenthesized content. Returns target_start, target_len, paren_start, paren_len via pointers. + * paren_start/len are set to 0 if no parentheses found. */ +static void md_parseurl(parser *p, void *out, size_t *target_start, size_t *target_len, size_t *paren_start, size_t *paren_len) { + md_parseout *ctx = (md_parseout *) out; + const char *base = ctx->file->source; + *target_start = (size_t)(p->current.start - base); + *paren_start = 0; + *paren_len = 0; + + // Parse tokens until we hit MD_LEFTPAREN (for parenthesized content) or MD_NEWLINE/EOF + size_t target_end = *target_start; + while (!parse_checktoken(p, MD_LEFTPAREN) && !parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) { parse_advance(p); + target_end = md_end_previous(p, base); } - if (parse_checktoken(p, MD_NEWLINE)) return parse_advance(p); - return true; // EOF is valid end of link line + // target_end is now the end of the last token before MD_LEFTPAREN (or MD_NEWLINE/EOF) + *target_len = target_end > *target_start ? (size_t)(target_end - *target_start) : 0; + + // If we found a left parenthesis, extract parenthesized content + if (parse_checktokenadvance(p, MD_LEFTPAREN)) { + *paren_start = (size_t)(p->current.start - base); + // Parse content until right parenthesis + while (!parse_checktoken(p, MD_RIGHTPAREN) && !parse_checktoken(p, MD_NEWLINE) && !parse_checktoken(p, MD_EOF)) parse_advance(p); + if (parse_checktokenadvance(p, MD_RIGHTPAREN)) { // paren_len is content between ( and ), excluding the closing ) + *paren_len = (size_t)(p->previous.start - base - *paren_start); + } else { // Unmatched parenthesis, ignore + *paren_start = 0; *paren_len = 0; + } + } + + // Consume newline if present + parse_checktokenadvance(p, MD_NEWLINE); } /** Parses inline link [text](url)... after [ and label and ] are consumed. Consumes ( url ) and rest of line, pushes paragraph. */ @@ -468,15 +494,20 @@ bool md_parselink(parser *p, void *out) { parse_error(p, false, MD_LINKEXPECTCOLON); return false; } - size_t target_start = (size_t)(p->current.start - base); - if (!md_parseurl(p, out)) { // Parse target URL until newline/EOF - parse_error(p, true, MD_EXPECTLINEEND); - return false; + size_t target_start, target_len, paren_start, paren_len; + md_parseurl(p, out, &target_start, &target_len, &paren_start, &paren_len); + + // Check for special directives: [show]: # (subtopics) or [toplevel]: # + // Accept both [show] and [showsubtopics] (case-insensitive prefix match) + if (label_len >= 4 && help_casencmp(base + label_start, 4, "show", 4) && paren_len > 0 && help_casencmp(base + paren_start, paren_len, "subtopics", 9)) { + md_push_simpleblock(p, ctx, block_start, MD_SHOW_SUBTOPICS); + return true; + } else if (help_casencmp(base + label_start, label_len, "toplevel", 8)) { + ctx->file->promote_subtopics = true; + return true; } - size_t target_end = md_end_previous(p, base); - size_t target_len = target_end > target_start ? (size_t)(target_end - target_start) : 0; - if (help_casencmp(base + label_start, label_len, "toplevel", 8)) ctx->file->promote_subtopics = true; + // Normal reference link: create alias/link block help_createalias(base, label_start, label_len, target_start, target_len, ctx->current_topic_index); md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; @@ -1043,6 +1074,7 @@ bool help_topictotext(const help_topic *t, varray_char *result) { break; case MD_BLOCK_LINK_DEF: case MD_BLOCK_THEMATIC_BREAK: + case MD_SHOW_SUBTOPICS: break; // omit from plain text (thematic breaks render as blank lines) case MD_BLOCK_BLANK: varray_charwrite(result, '\n'); @@ -1329,6 +1361,18 @@ void morpho_helptopics(varray_value *out) { } } +/** Fills a varray_value with subtopic names for the given topic. */ +void morpho_helpsubtopics(const help_topic *topic, varray_value *out) { + if (!topic || !topic->topic || !out) return; + int topic_index = (int)(topic->topic - s_topics.data); + if (topic_index < 0 || (unsigned int) topic_index >= s_topics.count) return; + for (unsigned int i = 0; i < s_topics.count; i++) { + const md_topic *t = &s_topics.data[i]; + if (t->parent_topic != topic_index || !MORPHO_ISSTRING(t->name)) continue; + varray_valuewrite(out, t->name); + } +} + /* ********************************************************************** * Initialization/finalization * ********************************************************************** */ diff --git a/src/support/help.h b/src/support/help.h index 57587d41a..811ea8141 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -40,7 +40,8 @@ typedef enum { MD_BLOCK_LIST, MD_BLOCK_LINK_DEF, MD_BLOCK_THEMATIC_BREAK, - MD_BLOCK_BLANK + MD_BLOCK_BLANK, + MD_SHOW_SUBTOPICS } md_blocktype; /** A single block: maps to a span in source; type-specific data; optional hierarchy. */ @@ -157,6 +158,9 @@ bool morpho_helpasmd(const char *query, varray_char *result); /** Fill a varray_value with top-level topic names (Morpho string values). Loads help on first use. Caller must initialize/clear the varray. */ void morpho_helptopics(varray_value *out); +/** Fill a varray_value with subtopic names (Morpho string values) for the given topic. Each name is added once (by identity). Loads help on first use. Caller must initialize/clear the varray. */ +void morpho_helpsubtopics(const help_topic *topic, varray_value *out); + /** Build a hint for a failed query */ void help_queryhint(const char *query, varray_char *result); From 9bcf41df572d5ef631de8801ab8186161a506aad Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 09:34:43 -0500 Subject: [PATCH 308/473] Case indep edit distance --- src/support/help.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 6db81c8d7..f7e18b6cf 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -970,7 +970,7 @@ static unsigned int help_editdistance(const char *a, const char *b, unsigned int for (size_t i = 1; i <= na; i++) { curr[0] = (unsigned int) i; for (size_t j = 1; j <= nb; j++) { - unsigned int cost = (a[i - 1] == b[j - 1]) ? 0 : 1; + unsigned int cost = (tolower((unsigned char) a[i - 1]) == tolower((unsigned char) b[j - 1])) ? 0 : 1; unsigned int del = prev[j] + 1, ins = curr[j - 1] + 1, sub = prev[j - 1] + cost; unsigned int min = (del < ins) ? del : ins; curr[j] = (min < sub) ? min : sub; @@ -982,12 +982,12 @@ static unsigned int help_editdistance(const char *a, const char *b, unsigned int return prev[nb]; } -/** Find top-level topic name closest to name; NULL if none within distance. */ +/** Find topic name closest to name (searches all topics); NULL if none within distance. */ static const char *help_findclosesttopic(const char *name) { const char *best = NULL; unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; for (unsigned int i = 0; i < s_topics.count; i++) { - if (s_topics.data[i].level != 1 || !MORPHO_ISSTRING(s_topics.data[i].name)) continue; + if (!MORPHO_ISSTRING(s_topics.data[i].name)) continue; const char *tn = MORPHO_GETCSTRING(s_topics.data[i].name); unsigned int d = help_editdistance(name, tn, best_d - 1); if (d < best_d) { best_d = d; best = tn; } From 603db5a9d876b5a75a6c22a5879f5c8a6df36293 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 20:46:07 -0500 Subject: [PATCH 309/473] Disable help --- src/support/help.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index f7e18b6cf..060163a77 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -1389,20 +1389,20 @@ void help_initialize(void) { morpho_defineerror(MD_LINKEXPECTCOLON, ERROR_PARSE, MD_LINKEXPECTCOLON_MSG); morpho_defineerror(MD_UNEXPECTEDTOKEN, ERROR_PARSE, MD_UNEXPECTEDTOKEN_MSG); - varray_md_fileinit(&s_files); + /*varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); dictionary_init(&s_names); - morpho_addfinalizefn(help_finalize); + morpho_addfinalizefn(help_finalize);*/ } /** @brief Finalization: free all files, topics, and name index. */ void help_finalize(void) { - for (unsigned int i = 0; i < s_files.count; i++) + /*for (unsigned int i = 0; i < s_files.count; i++) md_file_clear(&s_files.data[i]); varray_md_fileclear(&s_files); dictionary_freecontents(&s_names, true, true); dictionary_clear(&s_names); - varray_md_topicclear(&s_topics); + varray_md_topicclear(&s_topics);*/ } #endif From 2f2d188aca62f550a51aac7236269659f7053639 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 20:51:56 -0500 Subject: [PATCH 310/473] Restore help --- src/support/help.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 060163a77..f7e18b6cf 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -1389,20 +1389,20 @@ void help_initialize(void) { morpho_defineerror(MD_LINKEXPECTCOLON, ERROR_PARSE, MD_LINKEXPECTCOLON_MSG); morpho_defineerror(MD_UNEXPECTEDTOKEN, ERROR_PARSE, MD_UNEXPECTEDTOKEN_MSG); - /*varray_md_fileinit(&s_files); + varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); dictionary_init(&s_names); - morpho_addfinalizefn(help_finalize);*/ + morpho_addfinalizefn(help_finalize); } /** @brief Finalization: free all files, topics, and name index. */ void help_finalize(void) { - /*for (unsigned int i = 0; i < s_files.count; i++) + for (unsigned int i = 0; i < s_files.count; i++) md_file_clear(&s_files.data[i]); varray_md_fileclear(&s_files); dictionary_freecontents(&s_names, true, true); dictionary_clear(&s_names); - varray_md_topicclear(&s_topics);*/ + varray_md_topicclear(&s_topics); } #endif From 99b87637ceb974ed8ab4c9175b51d4dadb5a380a Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:15:59 -0500 Subject: [PATCH 311/473] Disable nanboxing --- src/build.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.h b/src/build.h index 3a659c7c7..318ad23dd 100644 --- a/src/build.h +++ b/src/build.h @@ -92,7 +92,7 @@ /** @brief Build Morpho VM with small but hacky value type [NaN boxing] */ #ifndef _NO_NAN_BOXING -#define MORPHO_NAN_BOXING +//#define MORPHO_NAN_BOXING #endif /** @brief Number of bytes to bind before GC first runs */ #define MORPHO_GCINITIAL 1024 From 58200732ab9f17a26f5dde29111506c711a98ec5 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 21:39:01 -0500 Subject: [PATCH 312/473] Restore MORPHO_NAN_BOXING --- src/build.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/build.h b/src/build.h index 318ad23dd..3a659c7c7 100644 --- a/src/build.h +++ b/src/build.h @@ -92,7 +92,7 @@ /** @brief Build Morpho VM with small but hacky value type [NaN boxing] */ #ifndef _NO_NAN_BOXING -//#define MORPHO_NAN_BOXING +#define MORPHO_NAN_BOXING #endif /** @brief Number of bytes to bind before GC first runs */ #define MORPHO_GCINITIAL 1024 From 325dd9fa80b9bade48ea6948fd4f757f5ebdf7a0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:05:02 -0500 Subject: [PATCH 313/473] Add GitHub Actions workflow for NoNANBoxing-2 --- .github/workflows/nonanboxing2.yml | 41 ++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/nonanboxing2.yml diff --git a/.github/workflows/nonanboxing2.yml b/.github/workflows/nonanboxing2.yml new file mode 100644 index 000000000..7e325011f --- /dev/null +++ b/.github/workflows/nonanboxing2.yml @@ -0,0 +1,41 @@ +name: NoNANBoxing-2 + +on: + push: + branches: [ "dev" ] + pull_request: + branches: [ "dev" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: configure + run: | + sudo apt update + sudo apt install libsuitesparse-dev + sudo apt install liblapacke-dev + sudo apt install libunistring-dev + python -m pip install --upgrade pip + python -m pip install regex colored + - name: make + run: | + mkdir build + cd build + cmake -DMORPHO_DISABLENANBOXING=ON .. + sudo make install + sudo mkdir /usr/local/lib/morpho + - name: getcli + run: | + git clone https://github.com/Morpho-lang/morpho-cli.git + cd morpho-cli + mkdir build + cd build + sudo make install + - name: test + run: | + cd test + morpho6 for_in/forin.morpho From 6b607fad067dae4f72264e144a7dc9af56b02cab Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:07:27 -0500 Subject: [PATCH 314/473] Add cmake command to build process --- .github/workflows/nonanboxing2.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/nonanboxing2.yml b/.github/workflows/nonanboxing2.yml index 7e325011f..1b5ec100f 100644 --- a/.github/workflows/nonanboxing2.yml +++ b/.github/workflows/nonanboxing2.yml @@ -34,6 +34,7 @@ jobs: cd morpho-cli mkdir build cd build + cmake .. sudo make install - name: test run: | From 6463802fc6275b1425c3b2c1659cbac2293758c1 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:10:16 -0500 Subject: [PATCH 315/473] Replace morpho6 command with Python test script --- .github/workflows/nonanboxing2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nonanboxing2.yml b/.github/workflows/nonanboxing2.yml index 1b5ec100f..28ca7486f 100644 --- a/.github/workflows/nonanboxing2.yml +++ b/.github/workflows/nonanboxing2.yml @@ -39,4 +39,4 @@ jobs: - name: test run: | cd test - morpho6 for_in/forin.morpho + python3 test.py From 291349fadfb0f8ad809b406df0cb56fe0bfa2ffd Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:15:41 -0500 Subject: [PATCH 316/473] Add 'help' branch to workflow triggers --- .github/workflows/nonanboxing2.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nonanboxing2.yml b/.github/workflows/nonanboxing2.yml index 28ca7486f..057b26cfc 100644 --- a/.github/workflows/nonanboxing2.yml +++ b/.github/workflows/nonanboxing2.yml @@ -2,9 +2,9 @@ name: NoNANBoxing-2 on: push: - branches: [ "dev" ] + branches: [ "dev", "help" ] pull_request: - branches: [ "dev" ] + branches: [ "dev", "help" ] jobs: build: From 2f9d87b6b40a6a2935224ab90c0501965bcccbd2 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 18 Feb 2026 22:17:21 -0500 Subject: [PATCH 317/473] Update help.c --- src/support/help.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/support/help.c b/src/support/help.c index f7e18b6cf..5da0465db 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -1389,6 +1389,7 @@ void help_initialize(void) { morpho_defineerror(MD_LINKEXPECTCOLON, ERROR_PARSE, MD_LINKEXPECTCOLON_MSG); morpho_defineerror(MD_UNEXPECTEDTOKEN, ERROR_PARSE, MD_UNEXPECTEDTOKEN_MSG); + varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); dictionary_init(&s_names); From 817c3dd2564727e22787cd9b25b5565ac8535cc4 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:18:22 -0500 Subject: [PATCH 318/473] Disable nanboxing in Morpho CLI build --- .github/workflows/nonanboxing2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nonanboxing2.yml b/.github/workflows/nonanboxing2.yml index 057b26cfc..cd3df6cce 100644 --- a/.github/workflows/nonanboxing2.yml +++ b/.github/workflows/nonanboxing2.yml @@ -34,7 +34,7 @@ jobs: cd morpho-cli mkdir build cd build - cmake .. + cmake -DMORPHO_DISABLENANBOXING=ON .. sudo make install - name: test run: | From 61bd2ac5a0a9ff52d16bfd2dda20e24d3d1aefec Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:21:25 -0500 Subject: [PATCH 319/473] Update build.h --- src/build.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/build.h b/src/build.h index 3a659c7c7..bb7b31a89 100644 --- a/src/build.h +++ b/src/build.h @@ -90,6 +90,7 @@ /** @brief Build Morpho VM with computed gotos */ #define MORPHO_COMPUTED_GOTO + /** @brief Build Morpho VM with small but hacky value type [NaN boxing] */ #ifndef _NO_NAN_BOXING #define MORPHO_NAN_BOXING From d2253250d0e3bc896a33d3854ef7e5a5f75773d0 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 19 Feb 2026 13:32:16 -0500 Subject: [PATCH 320/473] Update build.h --- src/build.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/build.h b/src/build.h index bb7b31a89..3a659c7c7 100644 --- a/src/build.h +++ b/src/build.h @@ -90,7 +90,6 @@ /** @brief Build Morpho VM with computed gotos */ #define MORPHO_COMPUTED_GOTO - /** @brief Build Morpho VM with small but hacky value type [NaN boxing] */ #ifndef _NO_NAN_BOXING #define MORPHO_NAN_BOXING From 1cab74f002cab5dd1478e456c7b3ea7373fa27f8 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:09:52 -0500 Subject: [PATCH 321/473] Fix help_findclosesttopic --- src/support/help.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 5da0465db..42e7c83ea 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -982,30 +982,17 @@ static unsigned int help_editdistance(const char *a, const char *b, unsigned int return prev[nb]; } -/** Find topic name closest to name (searches all topics); NULL if none within distance. */ -static const char *help_findclosesttopic(const char *name) { - const char *best = NULL; - unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; - for (unsigned int i = 0; i < s_topics.count; i++) { - if (!MORPHO_ISSTRING(s_topics.data[i].name)) continue; - const char *tn = MORPHO_GETCSTRING(s_topics.data[i].name); - unsigned int d = help_editdistance(name, tn, best_d - 1); - if (d < best_d) { best_d = d; best = tn; } - } - return best; -} - /** Find subtopic name under parent closest to name; NULL if none within distance. */ -static const char *help_findclosestsubtopic(int parent_idx, const char *name) { - if (parent_idx < 0 || (unsigned int) parent_idx >= s_topics.count) return NULL; +static const char *help_findclosesttopic(const char *name, int parent_idx) { const char *best = NULL; - unsigned int best_d = MORPHO_HELP_SUGGEST_MAXDIST + 1; + unsigned int best_d = -1; + size_t len = strlen(name); for (unsigned int j = 0; j < s_topics.count; j++) { - if (s_topics.data[j].parent_topic != parent_idx) continue; + if (parent_idx >=0 && s_topics.data[j].parent_topic != parent_idx) continue; if (!MORPHO_ISSTRING(s_topics.data[j].name)) continue; const char *tn = MORPHO_GETCSTRING(s_topics.data[j].name); - unsigned int d = help_editdistance(name, tn, best_d - 1); - if (d < best_d) { best_d = d; best = tn; } + unsigned int d = help_editdistance(name, tn, (unsigned int) len); + if (d < best_d || best_d<0) { best_d = d; best = tn; } } return best; } @@ -1234,7 +1221,7 @@ void help_queryhint(const char *query, varray_char *result) { return; } if (n == 0) { - help_hintappend(result, query, help_findclosesttopic(segs[0])); + help_hintappend(result, query, help_findclosesttopic(segs[0], -1)); varray_charwrite(result, '\0'); return; } @@ -1245,7 +1232,7 @@ void help_queryhint(const char *query, varray_char *result) { // Multi-segment: resolve first, then walk subtopics; on first failure suggest path.closest int idx = help_findtopic(segs[0]); if (idx < 0) { - help_hintappend(result, query, help_findclosesttopic(segs[0])); + help_hintappend(result, query, help_findclosesttopic(segs[0], -1)); varray_charwrite(result, '\0'); return; } @@ -1256,7 +1243,7 @@ void help_queryhint(const char *query, varray_char *result) { for (int i = 1; i < nsegs; i++) { int next = help_findchild(idx, segs[i]); if (next < 0) { - const char *closest = help_findclosestsubtopic(idx, segs[i]); + const char *closest = help_findclosesttopic(segs[i], idx); char suggest[MORPHO_MAX_HELPQUERY_LENGTH] = {0}; if (closest) { int needed = path_len + 1 + (int) strlen(closest); @@ -1388,7 +1375,6 @@ void help_initialize(void) { morpho_defineerror(MD_LINKEXPECTBRACKET, ERROR_PARSE, MD_LINKEXPECTBRACKET_MSG); morpho_defineerror(MD_LINKEXPECTCOLON, ERROR_PARSE, MD_LINKEXPECTCOLON_MSG); morpho_defineerror(MD_UNEXPECTEDTOKEN, ERROR_PARSE, MD_UNEXPECTEDTOKEN_MSG); - varray_md_fileinit(&s_files); varray_md_topicinit(&s_topics); From 5c581789298c49a78007b8a057be8026f946333c Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 23 Feb 2026 21:58:03 -0500 Subject: [PATCH 322/473] Correct type --- src/support/help.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 42e7c83ea..ec0a455e5 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -982,17 +982,17 @@ static unsigned int help_editdistance(const char *a, const char *b, unsigned int return prev[nb]; } -/** Find subtopic name under parent closest to name; NULL if none within distance. */ +/** Find topic name closest to name. If parent_idx >= 0, only consider subtopics of that parent; otherwise search all topics. Returns NULL if no topics to compare. */ static const char *help_findclosesttopic(const char *name, int parent_idx) { const char *best = NULL; - unsigned int best_d = -1; + int best_d = -1; /* no candidate yet */ size_t len = strlen(name); for (unsigned int j = 0; j < s_topics.count; j++) { - if (parent_idx >=0 && s_topics.data[j].parent_topic != parent_idx) continue; + if (parent_idx >= 0 && s_topics.data[j].parent_topic != parent_idx) continue; if (!MORPHO_ISSTRING(s_topics.data[j].name)) continue; const char *tn = MORPHO_GETCSTRING(s_topics.data[j].name); - unsigned int d = help_editdistance(name, tn, (unsigned int) len); - if (d < best_d || best_d<0) { best_d = d; best = tn; } + int d = help_editdistance(name, tn, (unsigned int) len); + if (d < best_d || best_d < 0) { best_d = d; best = tn; } } return best; } From ca5d35efead9a49a2ab455422eecf90511f1c52b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:33:20 -0500 Subject: [PATCH 323/473] Fix help_createalias --- src/support/help.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index ec0a455e5..609769114 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -461,7 +461,7 @@ static bool md_parseinlinelink(parser *p, void *out, size_t block_start) { return true; } -static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index); +static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t paren_start, size_t paren_len, int topic_index); /** Case-insensitive comparison of substring (s, n) with literal (lit, lit_len). */ static bool help_casencmp(const char *s, size_t n, const char *lit, size_t lit_len) { @@ -508,7 +508,7 @@ bool md_parselink(parser *p, void *out) { } // Normal reference link: create alias/link block - help_createalias(base, label_start, label_len, target_start, target_len, ctx->current_topic_index); + help_createalias(base, label_start, label_len, paren_start, paren_len, ctx->current_topic_index); md_push_link(p, ctx, block_start, label_start, label_len, target_start, target_len); return true; } @@ -843,21 +843,15 @@ static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t * Help topic aliases * ********************************************************************** */ -/** Create an alias from a tag link definition. Inserts alias -> topic index into s_names. */ -static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t target_start, size_t target_len, int topic_index) { +/** Create an alias from a tag link definition. Inserts alias -> topic index into s_names. + * Alias text is the parenthesized part from the URL (e.g. [tagvar]: # (var) -> "var"). Requires paren_len > 0. */ +static bool help_createalias(const char *base, size_t label_start, size_t label_len, size_t paren_start, size_t paren_len, int topic_index) { if (topic_index < 0 || (unsigned int) topic_index >= s_topics.count) return false; if (label_len < 3 || !help_casencmp(base + label_start, 3, "tag", 3)) return false; - const char *target = base + target_start, *open = NULL, *close = NULL; - for (const char *p = target; p < target + target_len && !close; p++) { - if (!open && *p == '(') open = p + 1; - else if (open && *p == ')') { close = p; break; } - } - if (!open || !close || close == open) return false; - size_t len = (size_t)(close - open); - if (len > MORPHO_MAX_HELPQUERY_LENGTH) return false; - char alias_buf[len + 1]; - help_lowercase_into(open, len, alias_buf); - return !MORPHO_ISNIL(help_nameindex_add(alias_buf, len, topic_index)); + if (paren_len == 0 || paren_len > MORPHO_MAX_HELPQUERY_LENGTH) return false; + char alias_buf[paren_len + 1]; + help_lowercase_into(base + paren_start, paren_len, alias_buf); + return !MORPHO_ISNIL(help_nameindex_add(alias_buf, paren_len, topic_index)); } /* ********************************************************************** From 98d4141809ae700df73bc254e3e6a966721311e3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 23 Feb 2026 22:44:39 -0500 Subject: [PATCH 324/473] Simplify morpho_helptopics --- src/support/help.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 609769114..57f57132e 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -1325,20 +1325,27 @@ bool morpho_helpasmd(const char *query, varray_char *result) { } /** Fill out with top-level topic names (level == 1, or level == 2 when file has [toplevel] tag); each name added once (by identity). */ +/** True if topic at index i is top-level (level 1 or promoted level 2). */ +static bool help_topic_is_toplevel(unsigned int i) { + if (i >= s_topics.count) return false; + const md_topic *t = &s_topics.data[i]; + bool include = (t->level == 1); + if (!include && t->file_index >= 0 && (unsigned int) t->file_index < s_files.count) + include = s_files.data[t->file_index].promote_subtopics; + return include; +} + +/** Fill a varray_value with top-level topic names. */ void morpho_helptopics(varray_value *out) { if (!out) return; help_ensureloaded(); - for (unsigned int i = 0; i < s_topics.count; i++) { - const md_topic *t = &s_topics.data[i]; - if (!MORPHO_ISSTRING(t->name)) continue; - bool include = (t->level == 1); - if (!include && t->file_index >= 0 && (unsigned int) t->file_index < s_files.count) - include = s_files.data[t->file_index].promote_subtopics; - if (!include) continue; - value name = t->name; - unsigned int idx; - if (varray_valuefindsame(out, name, &idx)) continue; - varray_valuewrite(out, name); + if (!s_names.contents) return; + for (unsigned int i = 0; i < s_names.capacity; i++) { + const dictionaryentry *e = &s_names.contents[i]; + if (MORPHO_ISNIL(e->key) || !MORPHO_ISSTRING(e->key)) continue; + int ti = help_indexvalue_first(e->val); + if (ti < 0 || !help_topic_is_toplevel((unsigned int) ti)) continue; + varray_valuewrite(out, e->key); } } From 2980ba1f702cd0a43ee5347317d61c9cc93054ce Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 24 Feb 2026 07:32:23 -0500 Subject: [PATCH 325/473] Simplify implementation --- src/support/help.c | 40 ++++++++++------------------------------ src/support/help.h | 5 +++++ 2 files changed, 15 insertions(+), 30 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 57f57132e..4f406ca42 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -712,14 +712,12 @@ int help_findallbyname(const char *name, int indices[], int max) { return help_indexvalue_collect(v, indices, max); } -/** Find child of parent topic with given name. Returns topic index or -1. */ +/** Find child of parent topic with given name. Returns topic index or -1. Uses s_names then filters by parent. */ static int help_findchild(int parent_idx, const char *name) { - objectstring key_str = MORPHO_STATICSTRING(name); - value key = MORPHO_OBJECT(&key_str); - for (unsigned int j = 0; j < s_topics.count; j++) { - if (s_topics.data[j].parent_topic != parent_idx) continue; - if (MORPHO_ISEQUAL(s_topics.data[j].name, key)) return (int) j; - } + int cand[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(name, cand, MORPHO_HELP_MAX_MULTIMATCH); + for (int i = 0; i < n; i++) + if (s_topics.data[cand[i]].parent_topic == parent_idx) return cand[i]; return -1; } @@ -858,11 +856,6 @@ static bool help_createalias(const char *base, size_t label_start, size_t label_ * Help topic lookup and content range * ********************************************************************** */ -/** Maximum number of query segments (e.g. "System respondsto" -> 2). */ -#define MORPHO_HELP_QUERY_MAXSEGMENTS 8 -#define MORPHO_HELP_MAX_MULTIMATCH 8 -/** Max edit distance to suggest a topic (only suggest if close enough). */ -#define MORPHO_HELP_SUGGEST_MAXDIST 3 /** Edit distance return when string too long (no match). */ #define MORPHO_HELP_EDIT_NOMATCH 255 @@ -1279,24 +1272,12 @@ bool morpho_helpastopic(const char *query, help_topic *out) { int nsegs = help_parsequery(query, qbuf, segs); if (nsegs <= 0) return false; - // Single segment: dict gives 0, 1, or many; if many caller shows "did you mean?" - int idx; - if (nsegs == 1) { - int multi[MORPHO_HELP_MAX_MULTIMATCH]; - int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); - if (n == 1) { - idx = multi[0]; - } else if (n == 0) { - return false; - } else { - return false; // multiple matches: caller shows hint - } - } else { - idx = help_findtopic(segs[0]); // first match - if (idx < 0) return false; - } + int multi[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); + if (n == 0) return false; + if (nsegs == 1 && n != 1) return false; /* single segment needs unique match; multiple -> caller shows hint */ + int idx = multi[0]; - // Resolve remaining segments by walking children for (int i = 1; i < nsegs; i++) { idx = help_findchild(idx, segs[i]); if (idx < 0) return false; @@ -1324,7 +1305,6 @@ bool morpho_helpasmd(const char *query, varray_char *result) { return false; } -/** Fill out with top-level topic names (level == 1, or level == 2 when file has [toplevel] tag); each name added once (by identity). */ /** True if topic at index i is top-level (level 1 or promoted level 2). */ static bool help_topic_is_toplevel(unsigned int i) { if (i >= s_topics.count) return false; diff --git a/src/support/help.h b/src/support/help.h index 811ea8141..666f853a3 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -19,6 +19,11 @@ /** Maximum length of a single string for edit-distance (suggestion). */ #define MORPHO_HELP_EDITMAXLEN 128 +/** Maximum number of query segments (e.g. "System.clock" -> 2). */ +#define MORPHO_HELP_QUERY_MAXSEGMENTS 8 +/** Maximum number of topic indices returned for a single name (multi-match). */ +#define MORPHO_HELP_MAX_MULTIMATCH 8 + /** Buffer size for "not found" hint message. */ #define MORPHO_HELP_HINTBUFSIZE 256 From 765bc9ef64ebd9d5827c46e49c7ee43d81e8ffa3 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sat, 28 Feb 2026 06:36:42 -0500 Subject: [PATCH 326/473] Fix POSIX header on apple --- src/support/platform.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/support/platform.c b/src/support/platform.c index 7aff7cdae..63243af39 100644 --- a/src/support/platform.c +++ b/src/support/platform.c @@ -15,8 +15,10 @@ #ifdef _WIN32 #include #include -#else - #define _POSIX_C_SOURCE 199309L +#else + #ifndef __APPLE__ // _POSIX_C_SOURCE Causes problems with qsort_r on apple + #define _POSIX_C_SOURCE 199309L + #endif #include #include #include From b6c3070db3677db7b722386e1592b81d8ba068ef Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 15 Mar 2026 10:38:41 -0400 Subject: [PATCH 327/473] Fix complex matrix arithmetic to allow redirection --- src/classes/cmplx.c | 12 ++++++------ src/linalg/complexmatrix.c | 4 ++-- .../arithmetic/complexmatrix_mulr_complex.morpho | 8 ++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 test/linalg/arithmetic/complexmatrix_mulr_complex.morpho diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index 6a9dd3bf1..a38e93a3a 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -423,7 +423,7 @@ value Complex_add(vm *v, int nargs, value *args) { complex_add_real(a, val, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -452,7 +452,7 @@ value Complex_sub(vm *v, int nargs, value *args) { complex_add_real(a, -val, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -475,7 +475,7 @@ value Complex_subr(vm *v, int nargs, value *args) { complex_add_real(new, val, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -504,7 +504,7 @@ value Complex_mul(vm *v, int nargs, value *args) { complex_mul_real(a, val, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -533,7 +533,7 @@ value Complex_div(vm *v, int nargs, value *args) { complex_mul_real(a, 1.0/val, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -559,7 +559,7 @@ value Complex_divr(vm *v, int nargs, value *args) { morpho_bindobjects(v, 1, &out); } } else UNREACHABLE("Number did not return float value"); - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } return out; } diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index a773dd805..dc2b27f52 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -281,7 +281,7 @@ linalgError_t complexmatrix_mmul(MorphoComplex alpha, objectmatrix *a, objectmat } /** Scales a matrix x <- scale * x >*/ -void complematrix_scale(objectmatrix *a, MorphoComplex scale) { +void complexmatrix_scale(objectmatrix *a, MorphoComplex scale) { cblas_zscal(a->nrows * a->ncols, (linalg_complexdouble_t *) &scale, (linalg_complexdouble_t *) a->elements, 1); } @@ -423,7 +423,7 @@ value ComplexMatrix_mul__complex(vm *v, int nargs, value *args) { objectmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); objectmatrix *new = matrix_clone(a); - if (new) complematrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); + if (new) complexmatrix_scale(new, MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0))->Z); return morpho_wrapandbind(v, (object *) new); } diff --git a/test/linalg/arithmetic/complexmatrix_mulr_complex.morpho b/test/linalg/arithmetic/complexmatrix_mulr_complex.morpho new file mode 100644 index 000000000..7a29a96ac --- /dev/null +++ b/test/linalg/arithmetic/complexmatrix_mulr_complex.morpho @@ -0,0 +1,8 @@ +// Multiply ComplexMatrix by scalar + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im +A[1,1]=2+2im + +print ((1+im)*A - A*(1+im)).norm() < 1e-10 +// expect: true From 8dd2e1da47abb26192f2f624f2264c25579a48fe Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Mon, 23 Mar 2026 00:01:45 -0400 Subject: [PATCH 328/473] Cleanup vm.c and gc.c --- src/core/gc.c | 14 +- src/core/vm.c | 358 ++++++++++++++++++++++++-------------------------- 2 files changed, 176 insertions(+), 196 deletions(-) diff --git a/src/core/gc.c b/src/core/gc.c index 0e3ac4f90..7a6e98825 100644 --- a/src/core/gc.c +++ b/src/core/gc.c @@ -48,7 +48,7 @@ void vm_graylistadd(graylist *g, object *obj) { } /* ********************************************************************** - * Garbage collector + * Marking phase * ********************************************************************** */ /** Recalculates the size of bound objects to the VM */ @@ -76,9 +76,7 @@ void vm_gcmarkobject(vm *v, object *obj) { /** Marks a value as reachable */ void vm_gcmarkvalue(vm *v, value val) { - if (MORPHO_ISOBJECT(val)) { - vm_gcmarkobject(v, MORPHO_GETOBJECT(val)); - } + if (MORPHO_ISOBJECT(val)) vm_gcmarkobject(v, MORPHO_GETOBJECT(val)); } /** Marks all entries in a dictionary */ @@ -123,14 +121,6 @@ void vm_gcmarkroots(vm *v) { #endif value *stacktop = v->stack.data+v->fp->roffset+v->fp->function->nregs-1; - /* Find the largest stack position currently in play */ - /*for (callframe *f=v->frame; ffp; f++) { - value *ftop = v->stack.data+f->roffset+f->function->nregs-1; - if (ftop>stacktop) stacktop=ftop; - }*/ - - //debug_showstack(v); - for (value *s=stacktop; s>=v->stack.data; s--) { if (MORPHO_ISOBJECT(*s)) vm_gcmarkvalue(v, *s); } diff --git a/src/core/vm.c b/src/core/vm.c index 22ae04e51..31c439d7a 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -39,7 +39,7 @@ dictionary sizecheck; #endif /* ********************************************************************** -* VM objects +* VM initialization and finalization * ********************************************************************** */ vm *globalvm=NULL; @@ -156,10 +156,46 @@ void vm_freeobjects(vm *v) { } /* ********************************************************************** -* Binding and unbinding objects to the VM +* Garbage collection * ********************************************************************** */ -/** Unbinds an object from a VM. */ +/** @brief Checks whether the gc should run. */ +static void vm_checkgc(vm *v) { +#ifdef MORPHO_DEBUG_STRESSGARBAGECOLLECTOR + vm_collectgarbage(v); +#else + if (v->bound>v->nextgc) vm_collectgarbage(v); +#endif +} + +/** @brief Binds an object to a Virtual Machine without triggering garbage collection. + * @param v the virtual machine + * @param obj object to bind + * @warning: For internal use only; e.g. when the internal state of the VM is not consistent and calling the GC could cause a sigsev. */ +static void vm_bindobjectwithoutcollect(vm *v, value obj) { + object *ob = MORPHO_GETOBJECT(obj); + if (!MORPHO_ISOBJECT(obj) || ob->statusstatus=OBJECT_ISUNMARKED; + ob->next=v->objects; + v->objects=ob; + size_t size=object_size(ob); + v->bound+=size; + +#ifdef MORPHO_DEBUG_GCSIZETRACKING + dictionary_insert(&sizecheck, obj, MORPHO_INTEGER(size)); +#endif +} + +/** @brief Binds an object to a Virtual Machine. + * @details Any object created during execution should be bound to a VM; this object is then managed by the garbage collector. + * @param v the virtual machine + * @param obj object to bind */ +static void vm_bindobject(vm *v, value obj) { + vm_bindobjectwithoutcollect(v, obj); + vm_checkgc(v); +} + +/** @brief Unbinds an object from a VM. */ void vm_unbindobject(vm *v, value obj) { object *ob=MORPHO_GETOBJECT(obj); @@ -170,56 +206,86 @@ void vm_unbindobject(vm *v, value obj) { if (e->next==ob) { e->next=ob->next; break; } } } - // Correct estimate of bound size. - if (MORPHO_ISGARBAGECOLLECTED(obj)) { + + if (MORPHO_ISGARBAGECOLLECTED(obj)) { // Correct estimate of bound size. v->bound-=object_size(ob); ob->status=OBJECT_ISUNMANAGED; } } -/** @brief Binds an object to a Virtual Machine. - * @details Any object created during execution should be bound to a VM; this object is then managed by the garbage collector. +/** @brief Temporarily retain objects across multiple reentrant calls to the VM. * @param v the virtual machine - * @param obj object to bind */ -static void vm_bindobject(vm *v, value obj) { - object *ob = MORPHO_GETOBJECT(obj); - ob->status=OBJECT_ISUNMARKED; - ob->next=v->objects; - v->objects=ob; - size_t size=object_size(ob); -#ifdef MORPHO_DEBUG_GCSIZETRACKING - dictionary_insert(&sizecheck, obj, MORPHO_INTEGER(size)); -#endif + * @param nobj number of objects to retain + * @param obj objects to retain + * @returns an integer handle to pass to releaseobjects */ +int morpho_retainobjects(vm *v, int nobj, value *obj) { + int gcount=v->retain.count; + varray_valueadd(&v->retain, obj, nobj); + return gcount; +} - v->bound+=size; +/** @brief Release objects temporarily retained by the VM. + * @param v the virtual machine + * @param handle a handle returned by morpho_retainobjects. */ +void morpho_releaseobjects(vm *v, int handle) { + if (handle>=0) v->retain.count=handle; +} -#ifdef MORPHO_DEBUG_STRESSGARBAGECOLLECTOR - vm_collectgarbage(v); -#else - if (v->bound>v->nextgc) vm_collectgarbage(v); +/** @brief Inform the VM that the size of an object has changed + * @param v the virtual machine + * @param obj the object to resize + * @param oldsize old size + * @param newsize new size */ +void morpho_resizeobject(vm *v, object *obj, size_t oldsize, size_t newsize) { +#ifdef MORPHO_DEBUG_GCSIZETRACKING + dictionary_insert(&sizecheck, MORPHO_OBJECT(obj), MORPHO_INTEGER(newsize)); #endif + if (!MORPHO_ISGARBAGECOLLECTED(MORPHO_OBJECT(obj))) return; + v->bound-=oldsize; + v->bound+=newsize; } -/** @brief Binds an object to a Virtual Machine without garbage collection. +/** @brief Binds a set of objects to a Virtual Machine; public interface. * @details Any object created during execution should be bound to a VM; this object is then managed by the garbage collector. * @param v the virtual machine - * @param obj object to bind - * @warning: This should only be used in circumstances where the internal state of the VM is not consistent (i.e. calling the GC could cause a sigsev) */ -static void vm_bindobjectwithoutcollect(vm *v, value obj) { - object *ob = MORPHO_GETOBJECT(obj); - ob->status=OBJECT_ISUNMARKED; - ob->next=v->objects; - v->objects=ob; - size_t size=object_size(ob); -#ifdef MORPHO_DEBUG_GCSIZETRACKING - dictionary_insert(&sizecheck, obj, MORPHO_INTEGER(size)); + * @param obj objects to bind */ +void morpho_bindobjects(vm *v, int nobj, value *obj) { + for (unsigned int i=0; ibound>v->nextgc) #endif + { + int handle=morpho_retainobjects(v, nobj, obj); + vm_collectgarbage(v); + morpho_releaseobjects(v, handle); + } +} - v->bound+=size; +/** @brief Convenience function to wrap a single object into a value and bind to the VM + * @param v VM to use + * @param out Object to wrap + * @returns object wrapped in a value, or MORPHO_NIL if obj is NULL + * Also raises ERROR_ALLOCATIONFAILED if passed a null pointer */ +value morpho_wrapandbind(vm *v, object *obj) { + value out = MORPHO_NIL; + if (obj) { + out=MORPHO_OBJECT(obj); + morpho_bindobjects(v, 1, &out); + } else if (!morpho_checkerror(&v->err)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return out; +} + +/** @brief Checks if an object is managed by the garbage collector + * @param obj the object to check + * @returns true if it is managed, false otherwise */ +bool morpho_ismanagedobject(object *obj) { + return MORPHO_ISGARBAGECOLLECTED(MORPHO_OBJECT(obj)); } /* ********************************************************************** -* Virtual machine +* Errors * ********************************************************************** */ /** @brief Raises a runtime error @@ -265,8 +331,66 @@ void vm_throwOpError(vm *v, ptrdiff_t iindx, errorid id, char* op, value left, v vm_runtimeerror(v,iindx,id,op,left_buffer.data,right_buffer.data); varray_charclear(&left_buffer); varray_charclear(&right_buffer); +} + + +/** Returns a VM's error block */ +error *morpho_geterror(vm *v) { + return &v->err; +} + +/** @brief Raises an error described by an error structure + * @param v the virtual machine + * @param err error to raise */ +void morpho_error(vm *v, error *err) { + if (err->cat!=ERROR_WARNING) { // Errors of category ERROR_WARNING are always raised as warnings + v->err = *err; + } else morpho_warning(v, err); +} + +/** @brief Raises an warning described by an error structure */ +void morpho_warning(vm *v, error *err) { + if (v->warningfn) { + (v->warningfn) (v, v->warningref, err); + } else { + fprintf(stderr, "Warning [%s]: %s\n", err->id, err->msg); } +} + +/** @brief Raise a runtime error given an id + * @param v the virtual machine + * @param id error id + * @param ... additional data for sprintf. */ +void morpho_runtimeerror(vm *v, errorid id, ...) { + va_list args; + error err; + error_init(&err); + + va_start(args, id); + morpho_writeerrorwithidvalist(&err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE, args); + va_end(args); + + morpho_error(v, &err); + error_clear(&err); +} + +/** @brief Raise a runtime warning given an id */ +void morpho_runtimewarning(vm *v, errorid id, ...) { + va_list args; + error err; + error_init(&err); + + va_start(args, id); + morpho_writeerrorwithidvalist(&err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE, args); + va_end(args); + + morpho_warning(v, &err); + error_clear(&err); +} +/* ********************************************************************** +* Upvalues +* ********************************************************************** */ /** @brief Captures an upvalue * @param v the virtual machine @@ -316,6 +440,10 @@ static inline void vm_closeupvalues(vm *v, value *reg) { } } +/* ********************************************************************** +* VM helper functions +* ********************************************************************** */ + /** Check if we should break at a given pc */ bool vm_shouldbreakatpc(vm *v, instruction *pc) { if (!v->debug) return false; @@ -382,6 +510,11 @@ static inline void vm_expandstack(vm *v, value **reg, unsigned int n) { v->stack.count+=n; } +/** Recovers the number of optional arguments */ +int vm_getoptionalargs(vm *v) { + return v->fp->nopt; +} + /** Process optional args */ bool vm_optargs(vm *v, ptrdiff_t iindx, objectfunction *func, unsigned int nopt, value *args, value *outreg) { unsigned int nfopt = func->opt.count; @@ -593,6 +726,11 @@ bool _findtypeinparent(objectclass *type, value match) { return false; } +/** Performs a type check operation + * @param[in] v - the VM in use + * @param[in] val - value to check + * @param[in] match - type to match + * @returns true on success, false otherwise */ static inline bool vm_typecheck(vm *v, value val, value match) { value type; if (!value_type(val, &type)) return false; @@ -606,11 +744,6 @@ static inline bool vm_typecheck(vm *v, value val, value match) { return false; } -/** Recovers the number of optional arguments */ -int vm_getoptionalargs(vm *v) { - return v->fp->nopt; -} - /** @brief Executes a sequence of code * @param v The virtual machine to use * @param rstart Starting register pointer @@ -1631,7 +1764,7 @@ bool morpho_interpret(vm *v, value *rstart, instructionindx istart) { } /* ********************************************************************** -* VM public interfaces +* VM creation and configuration * ********************************************************************** */ /** Creates a new virtual machine */ @@ -1673,149 +1806,6 @@ void morpho_setdebuggerfn(vm *v, morphodebuggerfn debuggerfn, void *ref) { v->debuggerref=ref; } -/** Returns a VM's error block */ -error *morpho_geterror(vm *v) { - return &v->err; -} - -/** @brief Raises an error described by an error structure - * @param v the virtual machine - * @param err error to raise */ -void morpho_error(vm *v, error *err) { - if (err->cat!=ERROR_WARNING) { // Errors of category ERROR_WARNING are always raised as warnings - v->err = *err; - } else morpho_warning(v, err); -} - -/** @brief Raises an warning described by an error structure */ -void morpho_warning(vm *v, error *err) { - if (v->warningfn) { - (v->warningfn) (v, v->warningref, err); - } else { - fprintf(stderr, "Warning [%s]: %s\n", err->id, err->msg); - } -} - -/** @brief Raise a runtime error given an id - * @param v the virtual machine - * @param id error id - * @param ... additional data for sprintf. */ -void morpho_runtimeerror(vm *v, errorid id, ...) { - va_list args; - error err; - error_init(&err); - - va_start(args, id); - morpho_writeerrorwithidvalist(&err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE, args); - va_end(args); - - morpho_error(v, &err); - error_clear(&err); -} - -/** @brief Raise a runtime warning given an id */ -void morpho_runtimewarning(vm *v, errorid id, ...) { - va_list args; - error err; - error_init(&err); - - va_start(args, id); - morpho_writeerrorwithidvalist(&err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE, args); - va_end(args); - - morpho_warning(v, &err); - error_clear(&err); -} - -/** @brief Binds a set of objects to a Virtual Machine; public interface. - * @details Any object created during execution should be bound to a VM; this object is then managed by the garbage collector. - * @param v the virtual machine - * @param obj objects to bind */ -void morpho_bindobjects(vm *v, int nobj, value *obj) { - /* Now bind the new objects in. */ - for (unsigned int i=0; istatusstatus=OBJECT_ISUNMARKED; - ob->next=v->objects; - v->objects=ob; - size_t size=object_size(ob); - v->bound+=size; -#ifdef MORPHO_DEBUG_GCSIZETRACKING - dictionary_insert(&sizecheck, obj[i], MORPHO_INTEGER(size)); -#endif - } - } - - /* Check if size triggers garbage collection */ -#ifndef MORPHO_DEBUG_STRESSGARBAGECOLLECTOR - if (v->bound>v->nextgc) -#endif - { - int handle=morpho_retainobjects(v, nobj, obj); - - vm_collectgarbage(v); - - morpho_releaseobjects(v, handle); - } -} - -/** @brief Convenience function to wrap a single object into a value and bind to the VM - * @param v VM to use - * @param out Object to wrap - * @returns object wrapped in a value, or MORPHO_NIL if obj is NULL - * Also raises ERROR_ALLOCATIONFAILED if passed a null pointer */ -value morpho_wrapandbind(vm *v, object *obj) { - value out = MORPHO_NIL; - if (obj) { - out=MORPHO_OBJECT(obj); - morpho_bindobjects(v, 1, &out); - } else if (!morpho_checkerror(&v->err)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - return out; -} - -/** @brief Temporarily retain objects across multiple reentrant calls to the VM. - * @param v the virtual machine - * @param nobj number of objects to retain - * @param obj objects to retain - * @returns an integer handle to pass to releaseobjects */ -int morpho_retainobjects(vm *v, int nobj, value *obj) { - int gcount=v->retain.count; - varray_valueadd(&v->retain, obj, nobj); - return gcount; -} - -/** @brief Release objects temporarily retained by the VM. - * @param v the virtual machine - * @param handle a handle returned by morpho_retainobjects. */ -void morpho_releaseobjects(vm *v, int handle) { - if (handle>=0) v->retain.count=handle; -} - -/** @brief Inform the VM that the size of an object has changed - * @param v the virtual machine - * @param obj the object to resize - * @param oldsize old size - * @param newsize new size - */ -void morpho_resizeobject(vm *v, object *obj, size_t oldsize, size_t newsize) { -#ifdef MORPHO_DEBUG_GCSIZETRACKING - dictionary_insert(&sizecheck, MORPHO_OBJECT(obj), MORPHO_INTEGER(newsize)); -#endif - if (!MORPHO_ISGARBAGECOLLECTED(MORPHO_OBJECT(obj))) return; - v->bound-=oldsize; - v->bound+=newsize; -} - - -/** @brief Checks if an object is managed by the garbage collector - * @param obj the object to check - * @returns true if it is managed, false otherwise - */ -bool morpho_ismanagedobject(object *obj) { - return (obj->status==OBJECT_ISUNMARKED || obj->status==OBJECT_ISMARKED); -} - /** Runs a program * @param[in] v - the virtual machine to use * @param[in] p - program to run From 36828a4468eefd4b430bf068a3f3da6e7472bd5b Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 29 Mar 2026 21:26:41 -0400 Subject: [PATCH 329/473] Recursive binding --- src/core/core.h | 4 ++- src/core/gc.c | 17 +++++++----- src/core/vm.c | 54 ++++++++++++++++++++++++++++++++++--- src/datastructures/object.c | 6 +---- src/linalg/matrix.c | 11 +++++--- src/morpho.h | 1 + 6 files changed, 72 insertions(+), 21 deletions(-) diff --git a/src/core/core.h b/src/core/core.h index 0a542ad27..02d4a3c54 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -191,6 +191,8 @@ typedef struct { /** Varrays of vms */ DECLARE_VARRAY(vm, vm*) +typedef enum { VM_RUNNING, VM_BIND, VM_INGC } vmstatus; + /** @brief A Morpho virtual machine and its current state */ struct svm { program *current; /** The current program being executed */ @@ -220,8 +222,8 @@ struct svm { #ifdef MORPHO_PROFILER profiler *profiler; - enum { VM_RUNNING, VM_INGC } status; #endif + vmstatus status; objectupvalue *openupvalues; /** Linked list of open upvalues */ diff --git a/src/core/gc.c b/src/core/gc.c index 7a6e98825..7e90910a9 100644 --- a/src/core/gc.c +++ b/src/core/gc.c @@ -60,9 +60,16 @@ size_t vm_gcrecalculatesize(vm *v) { return size; } +void vm_bindobjectwithoutcollect(vm *v, value obj); + /** Marks an object as reachable */ void vm_gcmarkobject(vm *v, object *obj) { - if (!obj || obj->status!=OBJECT_ISUNMARKED) return; + if (!obj) return; + if (v->status==VM_BIND) { // Bind object rather than mark + vm_bindobjectwithoutcollect(v, MORPHO_OBJECT(obj)); + return; + } + if (obj->status!=OBJECT_ISUNMARKED) return; #ifdef MORPHO_DEBUG_LOGGARBAGECOLLECTOR morpho_printf(v, "Marking %p ", obj); @@ -239,10 +246,8 @@ void vm_collectgarbage(vm *v) { if (!vc) return; if (vc->parent) return; // Don't garbage collect in subkernels - -#ifdef MORPHO_PROFILER + vmstatus oldstatus = v->status; // Preserve status vc->status=VM_INGC; -#endif if (vc && vc->bound>0) { size_t init=vc->bound; @@ -271,7 +276,5 @@ void vm_collectgarbage(vm *v) { #endif } -#ifdef MORPHO_PROFILER - vc->status=VM_RUNNING; -#endif + vc->status=oldstatus; } diff --git a/src/core/vm.c b/src/core/vm.c index 31c439d7a..5ba7301d5 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -68,8 +68,8 @@ static void vm_init(vm *v) { v->errfp=NULL; #ifdef MORPHO_PROFILER v->profiler=NULL; - v->status=VM_RUNNING; #endif + v->status=VM_RUNNING; v->parent=NULL; varray_vminit(&v->subkernels); @@ -160,11 +160,16 @@ void vm_freeobjects(vm *v) { * ********************************************************************** */ /** @brief Checks whether the gc should run. */ +static bool vm_shouldgc(vm *v) { + return v->bound>v->nextgc; +} + +/** @brief Runs the gc if necessary. */ static void vm_checkgc(vm *v) { #ifdef MORPHO_DEBUG_STRESSGARBAGECOLLECTOR vm_collectgarbage(v); #else - if (v->bound>v->nextgc) vm_collectgarbage(v); + if (vm_shouldgc(v)) vm_collectgarbage(v); #endif } @@ -172,9 +177,15 @@ static void vm_checkgc(vm *v) { * @param v the virtual machine * @param obj object to bind * @warning: For internal use only; e.g. when the internal state of the VM is not consistent and calling the GC could cause a sigsev. */ -static void vm_bindobjectwithoutcollect(vm *v, value obj) { +void vm_bindobjectwithoutcollect(vm *v, value obj) { + if (!MORPHO_ISOBJECT(obj)) return; object *ob = MORPHO_GETOBJECT(obj); - if (!MORPHO_ISOBJECT(obj) || ob->statusstatus!=OBJECT_ISUNMANAGED) return; ob->status=OBJECT_ISUNMARKED; ob->next=v->objects; v->objects=ob; @@ -186,6 +197,27 @@ static void vm_bindobjectwithoutcollect(vm *v, value obj) { #endif } +/** @brief Binds an object to a Virtual Machine without triggering garbage collection. + * @param v the virtual machine + * @param obj object to bind; searches contents through markfn and binds anything that is enclosed */ +void vm_bindrecursive(vm *v, value obj) { + vmstatus old = v->status; // Preserve status + object *oldobjects = v->objects; // Remember first old bound object + v->status = VM_BIND; + vm_bindobjectwithoutcollect(v, obj); + + object *ob = MORPHO_GETOBJECT(obj); + objecttypedefn *defn=object_getdefn(ob); + if (defn->markfn) defn->markfn(ob, v); // Call the mark function, which will bind subsequent objects + + v->status=old; // Restore status + + // Ensure objects added are preserved in garbage collection + for (object *obj = v->objects; obj!=NULL && obj!=oldobjects; obj=obj->next) obj->status=OBJECT_ISMARKED; + + vm_checkgc(v); +} + /** @brief Binds an object to a Virtual Machine. * @details Any object created during execution should be bound to a VM; this object is then managed by the garbage collector. * @param v the virtual machine @@ -277,6 +309,20 @@ value morpho_wrapandbind(vm *v, object *obj) { return out; } +/** @brief Convenience function to wrap a single object into a value and bind to the VM + * @param v VM to use + * @param out Object to wrap + * @returns object wrapped in a value, or MORPHO_NIL if obj is NULL + * Also raises ERROR_ALLOCATIONFAILED if passed a null pointer */ +value morpho_wrapandbindrecursive(vm *v, object *obj) { + value out = MORPHO_NIL; + if (obj) { + out=MORPHO_OBJECT(obj); + vm_bindrecursive(v, out); + } else if (!morpho_checkerror(&v->err)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return out; +} + /** @brief Checks if an object is managed by the garbage collector * @param obj the object to check * @returns true if it is managed, false otherwise */ diff --git a/src/datastructures/object.c b/src/datastructures/object.c index bab47ebec..b151a6bc5 100644 --- a/src/datastructures/object.c +++ b/src/datastructures/object.c @@ -58,11 +58,7 @@ void object_init(object *obj, objecttype type) { /** Frees an object */ void object_free(object *obj) { #ifdef MORPHO_DEBUG_LOGGARBAGECOLLECTOR - if (obj) { - fprintf(stderr, "Free object %p of type %d ", (void *) obj, obj->type); - morpho_printvalue(NULL, MORPHO_OBJECT(obj)); - fprintf(stderr, "\n"); - } + if (obj) fprintf(stderr, "Free object %p of type %d.\n", (void *) obj, obj->type); #endif if (object_getdefn(obj)->freefn) object_getdefn(obj)->freefn(obj); MORPHO_FREE(obj); diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 557e65845..32e396247 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -674,7 +674,10 @@ linalgError_t matrix_eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) objectmatrix *temp = matrix_clone(a); if (!temp) return LINALGERR_ALLOC; - return efn(temp, w, vec); + linalgError_t result = efn(temp, w, vec); + object_free((object *) temp); + + return result; } /* ---------------------- @@ -1289,7 +1292,7 @@ value Matrix_eigensystem(vm *v, int nargs, value *args) { otuple = object_newtuple(2, outtuple); _CHK(otuple); - return morpho_wrapandbind(v, (object *) otuple); + return morpho_wrapandbindrecursive(v, (object *) otuple); _eigensystem_cleanup: if (evec) object_free((object *) evec); @@ -1381,7 +1384,7 @@ value Matrix_svd(vm *v, int nargs, value *args) { otuple = object_newtuple(3, outtuple); _CHK_SVD(otuple); - return morpho_wrapandbind(v, (object *) otuple); + return morpho_wrapandbindrecursive(v, (object *) otuple); _svd_cleanup: if (u) object_free((object *) u); @@ -1422,7 +1425,7 @@ value Matrix_qr(vm *v, int nargs, value *args) { otuple = object_newtuple(2, outtuple); _CHK_QR(otuple); - return morpho_wrapandbind(v, (object *) otuple); + return morpho_wrapandbindrecursive(v, (object *) otuple); _qr_cleanup: if (q) object_free((object *) q); diff --git a/src/morpho.h b/src/morpho.h index 42725e431..5baa80f13 100644 --- a/src/morpho.h +++ b/src/morpho.h @@ -117,6 +117,7 @@ void morpho_freevm(vm *v); /* Bind new objects to the virtual machine */ void morpho_bindobjects(vm *v, int nobj, value *obj); value morpho_wrapandbind(vm *v, object *obj); +value morpho_wrapandbindrecursive(vm *v, object *obj); /* Interact with the garbage collector in an object definition */ void morpho_markobject(void *v, object *obj); From b132348cae48a31e17e45b8e93c5f81efc6e192c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 12 Apr 2026 12:20:12 -0400 Subject: [PATCH 330/473] Ensure metafunctions are compiled before execution --- src/builtin/builtin.c | 7 +++++++ src/classes/array.c | 2 +- src/classes/metafunction.c | 41 +++++++++++++++++++++++++++++++++----- src/classes/metafunction.h | 11 ++++++++++ src/core/compile.c | 4 +++- src/core/gc.c | 12 +++++------ 6 files changed, 64 insertions(+), 13 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index f1f85d747..9408e37fc 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -507,6 +507,13 @@ void builtin_initialize(void) { if (!builtin_parsesignatures()) { UNREACHABLE("Syntax error in signature."); } + + error err; + error_init(&err); + if (!metafunction_finalizelist(builtin_objects, &err)) { + UNREACHABLE("Unable to finalize builtin metafunctions."); + } + error_clear(&err); morpho_addfinalizefn(builtin_finalize); } diff --git a/src/classes/array.c b/src/classes/array.c index 832b7ad8c..6d0f02010 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -59,7 +59,7 @@ void object_arrayinit(objectarray *array, unsigned int ndim, unsigned int *dim) /* Store the size of the object for convenient access */ array->nelements=nel; - /* Arrays are initialized to nil. */ + /* Arrays are initialized to (float) 0.0. */ #ifdef MORPHO_NAN_BOXING memset(array->values, 0, sizeof(value)*nel); #else diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 9173df2f3..3fc909362 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -43,6 +43,7 @@ void objectmetafunction_freefn(object *obj) { void objectmetafunction_markfn(object *obj, void *v) { objectmetafunction *f = (objectmetafunction *) obj; morpho_markvalue(v, f->name); // Mark the name + morpho_markvarrayvalue(v, &f->fns); // Preserve implementations while building/frozen for (int i=0; iresolver.count; i++) { // Mark any functions in the resolver mfinstruction *instr = &f->resolver.data[i]; @@ -81,6 +82,7 @@ objectmetafunction *object_newmetafunction(value name) { new->name=MORPHO_NIL; if (MORPHO_ISSTRING(name)) new->name=object_clonestring(name); new->klass=NULL; + new->state=METAFUNCTION_BUILDING; varray_valueinit(&new->fns); varray_mfinstructioninit(&new->resolver); } @@ -114,6 +116,10 @@ bool metafunction_wrap(value name, value fn, value *out) { /** Adds a function to a metafunction */ bool metafunction_add(objectmetafunction *f, value fn) { + if (f->state==METAFUNCTION_FROZEN) { + metafunction_clearinstructions(f); + f->state=METAFUNCTION_BUILDING; + } return varray_valuewrite(&f->fns, fn); } @@ -797,7 +803,7 @@ void metafunction_clearinstructions(objectmetafunction *fn) { varray_mfinstructionclear(&fn->resolver); } -/** Compiles the metafunction resolver */ +/** Compiles the resolver for a metafunction that is still being assembled */ bool metafunction_compile(objectmetafunction *fn, error *err) { mfset set; set.count = fn->fns.count; @@ -824,6 +830,28 @@ bool metafunction_compile(objectmetafunction *fn, error *err) { return success; } +/** Finalizes a metafunction, compiling its resolver once the implementation set is complete */ +bool metafunction_finalize(objectmetafunction *fn, error *err) { + if (fn->state==METAFUNCTION_FROZEN) return true; + + if (!metafunction_compile(fn, err)) return false; + fn->state=METAFUNCTION_FROZEN; + + return true; +} + +/** Finalizes any metafunctions stored in a linked object list */ +bool metafunction_finalizelist(object *list, error *err) { + for (object *obj=list; obj!=NULL; obj=obj->next) { + if (obj->type==OBJECT_METAFUNCTION && + !metafunction_finalize((objectmetafunction *) obj, err)) { + return false; + } + } + + return true; +} + /** Attempt to find the desired class uid in the linearization of a given class */ bool _finduidinlinearization(objectclass *klass, int uid) { for (int k=0; klinearization.count; k++) { @@ -832,7 +860,7 @@ bool _finduidinlinearization(objectclass *klass, int uid) { return false; } -/** Execute the metafunction's resolver +/** Execute the resolver for a finalized metafunction. @param[in] fn - the metafunction to resolve @param[in] nargs - number of positional arguments @param[in] args - positional arguments @warning: the first user-visible argument should be in the zero position @@ -840,8 +868,10 @@ bool _finduidinlinearization(objectclass *klass, int uid) { @param[out] out - resolved function @returns true if the metafunction was successfully resolved */ bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { - if (!fn->resolver.data && - !metafunction_compile(fn, err)) return false; + if (fn->state!=METAFUNCTION_FROZEN) { + if (err) morpho_writeerrorwithid(err, METAFUNCTION_UNFROZEN, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); + return false; + } mfinstruction *pc = fn->resolver.data; if (!pc) return false; @@ -940,7 +970,7 @@ value metafunction_constructor(vm *v, int nargs, value *args) { error err; error_init(&err); - if (!metafunction_compile(new, &err)) morpho_runtimeerror(v, err.id); + if (!metafunction_finalize(new, &err)) morpho_runtimeerror(v, err.id); error_clear(&err); out=morpho_wrapandbind(v, (object *) new); @@ -1003,4 +1033,5 @@ void metafunction_initialize(void) { // Metafunction error messages morpho_defineerror(METAFUNCTION_CMPLAMBGS, ERROR_PARSE, METAFUNCTION_CMPLAMBGS_MSG); + morpho_defineerror(METAFUNCTION_UNFROZEN, ERROR_HALT, METAFUNCTION_UNFROZEN_MSG); } diff --git a/src/classes/metafunction.h b/src/classes/metafunction.h index bddf8857b..d7d41e350 100644 --- a/src/classes/metafunction.h +++ b/src/classes/metafunction.h @@ -34,10 +34,16 @@ typedef struct { DECLARE_VARRAY(mfinstruction, mfinstruction); /** A metafunction object */ +typedef enum { + METAFUNCTION_BUILDING, + METAFUNCTION_FROZEN +} metafunctionstate; + typedef struct sobjectmetafunction { object obj; value name; objectclass *klass; // Parent class for metafunction methods + metafunctionstate state; varray_value fns; varray_mfinstruction resolver; } objectmetafunction; @@ -61,6 +67,9 @@ typedef struct sobjectmetafunction { #define METAFUNCTION_CMPLAMBGS "MltplDisptchAmbg" #define METAFUNCTION_CMPLAMBGS_MSG "Ambiguous or duplicate implementations in multiple dispatch." +#define METAFUNCTION_UNFROZEN "MltplDisptchUnfrzn" +#define METAFUNCTION_UNFROZEN_MSG "Metafunction was used before it was finalized." + /* ------------------------------------------------------- * Metafunction interface * ------------------------------------------------------- */ @@ -81,6 +90,8 @@ signature *metafunction_getsignature(value fn); void metafunction_inferreturntype(objectmetafunction *fn, value *type); bool metafunction_compile(objectmetafunction *fn, error *err); +bool metafunction_finalize(objectmetafunction *fn, error *err); +bool metafunction_finalizelist(object *list, error *err); void metafunction_clearinstructions(objectmetafunction *fn); bool metafunction_resolve(objectmetafunction *f, int nargs, value *args, error *err, value *fn); diff --git a/src/core/compile.c b/src/core/compile.c index 55aa56497..a15d16e06 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -1727,7 +1727,7 @@ bool compiler_resolvefunctionref(compiler *c, syntaxtreenode *node, value symbol } if (MORPHO_ISMETAFUNCTION(outfn)) { - metafunction_compile(MORPHO_GETMETAFUNCTION(outfn), &c->err); + metafunction_finalize(MORPHO_GETMETAFUNCTION(outfn), &c->err); } out->returntype=CONSTANT; @@ -4917,6 +4917,8 @@ bool morpho_compile(char *in, compiler *c, bool opt, error *err) { if (success) { if (opt && optimizer) (*optimizer) (c->out); + + if (!metafunction_finalizelist(out->boundlist, err)) return false; c->line=c->lex.line+1; // Update the line counter if compilation was a success; assumes a new line every time morpho_compile is called. } diff --git a/src/core/gc.c b/src/core/gc.c index 7e90910a9..2e6361504 100644 --- a/src/core/gc.c +++ b/src/core/gc.c @@ -246,13 +246,13 @@ void vm_collectgarbage(vm *v) { if (!vc) return; if (vc->parent) return; // Don't garbage collect in subkernels - vmstatus oldstatus = v->status; // Preserve status + vmstatus oldstatus = vc->status; // Preserve status vc->status=VM_INGC; if (vc && vc->bound>0) { size_t init=vc->bound; #ifdef MORPHO_DEBUG_LOGGARBAGECOLLECTOR - morpho_printf(v, "--- begin garbage collection ---\n"); + morpho_printf(vc, "--- begin garbage collection ---\n"); #endif vm_gcmarkroots(vc); vm_gctrace(vc); @@ -260,19 +260,19 @@ void vm_collectgarbage(vm *v) { if (vc->bound>init) { #ifdef MORPHO_DEBUG_GCSIZETRACKING - morpho_printf(v, "GC collected %ld bytes (from %zu to %zu) next at %zu.\n", init-vc->bound, init, vc->bound, vc->bound*MORPHO_GCGROWTHFACTOR); + morpho_printf(vc, "GC collected %ld bytes (from %zu to %zu) next at %zu.\n", init-vc->bound, init, vc->bound, vc->bound*MORPHO_GCGROWTHFACTOR); UNREACHABLE("VM bound object size < 0"); #else // This catch has been put in to prevent the garbarge collector from completely seizing up. - vc->bound=vm_gcrecalculatesize(v); + vc->bound=vm_gcrecalculatesize(vc); #endif } vc->nextgc=vc->bound*MORPHO_GCGROWTHFACTOR; #ifdef MORPHO_DEBUG_LOGGARBAGECOLLECTOR - morpho_printf(v, "--- end garbage collection ---\n"); - if (vc) morpho_printf(v, " collected %ld bytes (from %zu to %zu) next at %zu.\n", init-vc->bound, init, vc->bound, vc->nextgc); + morpho_printf(vc, "--- end garbage collection ---\n"); + if (vc) morpho_printf(vc, " collected %ld bytes (from %zu to %zu) next at %zu.\n", init-vc->bound, init, vc->bound, vc->nextgc); #endif } From e84fb9fae610560d828b6ee6c1450c56dbbed2af Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 12 Apr 2026 12:26:59 -0400 Subject: [PATCH 331/473] Check return codes --- test/test.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/test.py b/test/test.py index 7fdaad273..acbeff794 100755 --- a/test/test.py +++ b/test/test.py @@ -8,7 +8,7 @@ # Expectations are coded into comments in the input file as follows: # import necessary modules -import os, glob, sys +import os, glob, sys, subprocess import regex as rx from functools import reduce import operator @@ -125,8 +125,9 @@ def test(file,testLog,CI): #Get the expected output expected=getexpect(file) - # Run the test - os.system(command + ' ' +file + ' > ' + tmp) + # Run the test and capture the exit status + with open(tmp, 'w', encoding="utf8") as outfile: + result = subprocess.run(command.split() + [file], stdout=outfile, stderr=subprocess.STDOUT) # If we produced output if os.path.exists(tmp): @@ -134,13 +135,14 @@ def test(file,testLog,CI): out=getoutput(tmp) # Was it expected? - if(expected==out): + if(result.returncode==0 and expected==out): if not CI: print(stylize("Passed",colored.fg("green"))) ret = 1 else: if not CI: print(stylize("Failed",colored.fg("red"))) + print(" Return code: ", result.returncode) print(" Expected: ", expected) print(" Output: ", out) else: @@ -159,6 +161,7 @@ def test(file,testLog,CI): print(" Expected: ", expected[testNum], file = testLog) print(" Output: ", out[testNum], file = testLog) else: + print(" Return code: ", result.returncode, file = testLog) print(" Expected: ", expected, file = testLog) print(" Output: ", out, file = testLog) From 9214df741454405a1645ac034ba280c1c18c8a0b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 12 Apr 2026 13:22:21 -0400 Subject: [PATCH 332/473] Hardening of Complex division --- src/linalg/complexmatrix.c | 22 +++++++++++++++++-- src/linalg/matrix.c | 2 ++ .../complexmatrix_div_singular_error.morpho | 7 ++++++ .../complexmatrix_divr_singular_error.morpho | 7 ++++++ ...x_div_incompatible_dimensions_error.morpho | 7 ++++++ .../errors/matrix_div_non_square_error.morpho | 7 ++++++ 6 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 test/linalg/errors/complexmatrix_div_singular_error.morpho create mode 100644 test/linalg/errors/complexmatrix_divr_singular_error.morpho create mode 100644 test/linalg/errors/matrix_div_incompatible_dimensions_error.morpho create mode 100644 test/linalg/errors/matrix_div_non_square_error.morpho diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index dc2b27f52..e4735ac0b 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -465,14 +465,32 @@ value ComplexMatrix_mulr__matrix(vm *v, int nargs, value *args) { value ComplexMatrix_div__matrix(vm *v, int nargs, value *args) { objectmatrix *b=MORPHO_GETMATRIX(MORPHO_SELF(args)), *A=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *ap=NULL; objectmatrix *new=matrix_clone(b); - if (new && _promote(v, A, &ap)) matrix_solve(ap, new); + + if (!new) return morpho_wrapandbind(v, NULL); + if (!_promote(v, A, &ap)) goto ComplexMatrix_div__matrix_cleanup; + + LINALG_ERRCHECKVMGOTO(matrix_solve(ap, new), ComplexMatrix_div__matrix_cleanup); + + object_free((object *) ap); return morpho_wrapandbind(v, (object *) new); + +ComplexMatrix_div__matrix_cleanup: + if (new) object_free((object *) new); + if (ap) object_free((object *) ap); + return MORPHO_NIL; } value ComplexMatrix_divr__matrix(vm *v, int nargs, value *args) { objectmatrix *A=MORPHO_GETMATRIX(MORPHO_SELF(args)), *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)), *bp=NULL; - if (_promote(v, b, &bp)) matrix_solve(A, bp); // Promote the matrix that will contain the solution anyway + + if (!_promote(v, b, &bp)) goto ComplexMatrix_divr__matrix_cleanup; + LINALG_ERRCHECKVMGOTO(matrix_solve(A, bp), ComplexMatrix_divr__matrix_cleanup); + return morpho_wrapandbind(v, (object *) bp); + +ComplexMatrix_divr__matrix_cleanup: + if (bp) object_free((object *) bp); + return MORPHO_NIL; } /** Computes the trace */ diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 32e396247..da4fdd50d 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -635,6 +635,8 @@ linalgError_t matrix_solvelarge(objectmatrix *a, objectmatrix *b) { * @param[in|out] b rhs — overwritten by the solution * @returns linalgError_t indicating the status; MATRIX_OK indicates success. */ linalgError_t matrix_solve(objectmatrix *a, objectmatrix *b) { + if (a->nrows!=a->ncols) return LINALGERR_NOT_SQUARE; + if (a->nrows!=b->nrows) return LINALGERR_INCOMPATIBLE_DIM; if (MATRIX_ISSMALL(a)) return matrix_solvesmall(a, b); else return matrix_solvelarge(a, b); } diff --git a/test/linalg/errors/complexmatrix_div_singular_error.morpho b/test/linalg/errors/complexmatrix_div_singular_error.morpho new file mode 100644 index 000000000..d26c85297 --- /dev/null +++ b/test/linalg/errors/complexmatrix_div_singular_error.morpho @@ -0,0 +1,7 @@ +// Division of a ComplexMatrix by a singular Matrix should fail + +var A = Matrix(((1,2),(2,4))) +var b = ComplexMatrix((1+1im, 2)) + +print b / A +// expect error 'LnAlgMtrxSnglr' diff --git a/test/linalg/errors/complexmatrix_divr_singular_error.morpho b/test/linalg/errors/complexmatrix_divr_singular_error.morpho new file mode 100644 index 000000000..592736ce6 --- /dev/null +++ b/test/linalg/errors/complexmatrix_divr_singular_error.morpho @@ -0,0 +1,7 @@ +// Division of a Matrix by a singular ComplexMatrix should fail + +var A = ComplexMatrix(((1,2),(2,4))) +var b = Matrix((1, 2)) + +print b / A +// expect error 'LnAlgMtrxSnglr' diff --git a/test/linalg/errors/matrix_div_incompatible_dimensions_error.morpho b/test/linalg/errors/matrix_div_incompatible_dimensions_error.morpho new file mode 100644 index 000000000..6a4e55784 --- /dev/null +++ b/test/linalg/errors/matrix_div_incompatible_dimensions_error.morpho @@ -0,0 +1,7 @@ +// Division with incompatible right-hand side dimensions should fail + +var A = Matrix(((1,0),(0,1))) +var b = Matrix((1,2,3)) + +print b / A +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/linalg/errors/matrix_div_non_square_error.morpho b/test/linalg/errors/matrix_div_non_square_error.morpho new file mode 100644 index 000000000..5b549c9fd --- /dev/null +++ b/test/linalg/errors/matrix_div_non_square_error.morpho @@ -0,0 +1,7 @@ +// Division by a non-square matrix should fail + +var A = Matrix(2,3) +var b = Matrix((1,2)) + +print b / A +// expect error 'LnAlgMtrxNtSq' From 9fbcb330c3c17908962f5de6643f832396613a86 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 16:23:37 -0400 Subject: [PATCH 333/473] Matrix-ComplexMatrix inner products --- src/linalg/complexmatrix.c | 17 +++++++++++------ src/linalg/complexmatrix.h | 13 +++++++++++++ ...xmatrix_inner_incompatible_dimensions.morpho | 10 ++++++++++ test/linalg/methods/complexmatrix_inner.morpho | 9 +++++++++ 4 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 test/linalg/errors/complexmatrix_inner_incompatible_dimensions.morpho diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index e4735ac0b..b5e832018 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -11,9 +11,6 @@ #include "cmplx.h" objecttype objectcomplexmatrixtype; -#define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype - -typedef objectmatrix objectcomplexmatrix; /* ********************************************************************** * ComplexMatrix utility functions @@ -557,16 +554,24 @@ value ComplexMatrix_conjTranspose(vm *v, int nargs, value *args) { /** Frobenius inner product */ value ComplexMatrix_inner(vm *v, int nargs, value *args) { - objectcomplexmatrix *a=MORPHO_GETMATRIX(MORPHO_SELF(args)); - objectcomplexmatrix *b=MORPHO_GETMATRIX(MORPHO_GETARG(args, 0)); + objectcomplexmatrix *a=MORPHO_GETCOMPLEXMATRIX(MORPHO_SELF(args)), *b = NULL; MorphoComplex prod=MCBuild(0.0, 0.0); - value out = MORPHO_NIL; + value arg = MORPHO_GETARG(args, 0), out = MORPHO_NIL; + objectmatrix *bp = NULL; + + if (MORPHO_ISCOMPLEXMATRIX(arg)) { + b=MORPHO_GETCOMPLEXMATRIX(arg); + } else if (_promote(v, MORPHO_GETMATRIX(arg), &bp)) { + b=bp; + } else goto ComplexMatrix_inner_cleanup; if (complexmatrix_inner(a, b, &prod)==LINALGERR_OK) { objectcomplex *new = object_newcomplex(creal(prod), cimag(prod)); out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LINALG_INCOMPATIBLEMATRICES); +ComplexMatrix_inner_cleanup: + if (bp) object_free((object *) bp); return out; } diff --git a/src/linalg/complexmatrix.h b/src/linalg/complexmatrix.h index cdb7bdd89..6e89b7529 100644 --- a/src/linalg/complexmatrix.h +++ b/src/linalg/complexmatrix.h @@ -7,6 +7,8 @@ #ifndef complexmatrix_h #define complexmatrix_h +#include "matrix.h" + /* ------------------------------------------------------- * ComplexMatrix veneer class * ------------------------------------------------------- */ @@ -15,6 +17,17 @@ #define COMPLEXMATRIX_CONJTRANSPOSE_METHOD "conjTranspose" +extern objecttype objectcomplexmatrixtype; +#define OBJECT_COMPLEXMATRIX objectcomplexmatrixtype + +typedef objectmatrix objectcomplexmatrix; + +/** Tests whether an object is a complex matrix */ +#define MORPHO_ISCOMPLEXMATRIX(val) object_istype(val, OBJECT_COMPLEXMATRIX) + +/** Gets the object as a complex matrix */ +#define MORPHO_GETCOMPLEXMATRIX(val) ((objectcomplexmatrix *) MORPHO_GETOBJECT(val)) + void complexmatrix_initialize(void); #endif diff --git a/test/linalg/errors/complexmatrix_inner_incompatible_dimensions.morpho b/test/linalg/errors/complexmatrix_inner_incompatible_dimensions.morpho new file mode 100644 index 000000000..0ee89780b --- /dev/null +++ b/test/linalg/errors/complexmatrix_inner_incompatible_dimensions.morpho @@ -0,0 +1,10 @@ +// Incompatible dimensions for ComplexMatrix inner product + +var A = ComplexMatrix(2,2) +A[0,0]=1+1im + +var B = Matrix(3,3) +B[0,0]=1 + +print A.inner(B) +// expect error 'LnAlgMtrxIncmptbl' diff --git a/test/linalg/methods/complexmatrix_inner.morpho b/test/linalg/methods/complexmatrix_inner.morpho index 68150dd58..a86765099 100644 --- a/test/linalg/methods/complexmatrix_inner.morpho +++ b/test/linalg/methods/complexmatrix_inner.morpho @@ -14,3 +14,12 @@ B[1,1]=1 print A.inner(B) // expect: 4 - 6im + +var C = Matrix(2,2) +C[0,0]=1 +C[0,1]=2 +C[1,0]=3 +C[1,1]=4 + +print A.inner(C) +// expect: 30 - 30im From d582209e31b7e0d8a1bb3dc1dc39cc750ab52885 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 17:23:19 -0400 Subject: [PATCH 334/473] Fix guard MORPHO_INCLUDE_LINALG --- src/linalg/linalg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index 835247f40..29e861e37 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -92,8 +92,10 @@ void linalg_raiseerror(vm *v, linalgError_t err); * Include the rest of the library * ------------------------------------------------------- */ +#ifdef MORPHO_INCLUDE_LINALG #include "matrix.h" #include "complexmatrix.h" +#endif /* ------------------------------------------------------- * Initialization and finalization From ae1d832a45a148a21ca68dc8482e66c874798373 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 17:38:18 -0400 Subject: [PATCH 335/473] Fix array constructor --- src/linalg/matrix.c | 7 ++++++- ...lexmatrix_array_constructor_invalid_elements.morpho | 10 ++++++++++ .../matrix_array_constructor_invalid_elements.morpho | 10 ++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho create mode 100644 test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index da4fdd50d..dbd9c78e6 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -358,11 +358,15 @@ objectmatrix *matrix_arrayconstructor(vm *v, objectarray *a, objecttype type, Ma unsigned int indx[2]={ i, j }; value el; if (array_getelement(a, 2, indx, &el)==ARRAY_OK) { - matrix_getinterface(new)->setelfn(v, el, new->elements+(j*nrows + i)*new->nvals); + LINALG_ERRCHECKVMGOTO(matrix_getinterface(new)->setelfn(v, el, new->elements+(j*nrows + i)*new->nvals), + matrix_arrayconstructor_cleanup); } } } return new; +matrix_arrayconstructor_cleanup: + object_free((object *) new); + return NULL; } /* ---------------------- @@ -812,6 +816,7 @@ value matrix_constructor__array(vm *v, int nargs, value *args) { if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_MATRIX, 1); + LINALG_ERRCHECKVMRETURN((new ? LINALGERR_OK : LINALGERR_INVLD_ARG), MORPHO_NIL); return morpho_wrapandbind(v, (object *) new); } diff --git a/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho b/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho new file mode 100644 index 000000000..01e5ec8ef --- /dev/null +++ b/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho @@ -0,0 +1,10 @@ +// ComplexMatrix constructor from Array with invalid element types + +var a[2,2] +a[0,0] = 1+im +a[0,1] = "invalid" +a[1,0] = 3+3im +a[1,1] = 4+4im + +print ComplexMatrix(a) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho b/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho new file mode 100644 index 000000000..4ae74f986 --- /dev/null +++ b/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho @@ -0,0 +1,10 @@ +// Matrix constructor from Array with invalid element types + +var a[2,2] +a[0,0] = 1 +a[0,1] = "invalid" +a[1,0] = 3 +a[1,1] = 4 + +print Matrix(a) +// expect error 'LnAlgMtrxInvldArg' From 4709c796013050b54cfdc82b58338d2337256aa6 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 17:41:45 -0400 Subject: [PATCH 336/473] Update test --- .../complexmatrix_array_constructor_invalid_elements.morpho | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho b/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho index 01e5ec8ef..c91f62987 100644 --- a/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho +++ b/test/linalg/constructors/complexmatrix_array_constructor_invalid_elements.morpho @@ -7,4 +7,4 @@ a[1,0] = 3+3im a[1,1] = 4+4im print ComplexMatrix(a) -// expect error 'LnAlgMtrxInvldArg' +// expect error 'LnAlgMtrxNnNmrclArg' From be5f3a52b3763c5c21fe1695a4a9972dd5527ed5 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 17:56:13 -0400 Subject: [PATCH 337/473] Validate dimensions for matrix constructors and fix SVD allocations --- src/linalg/complexmatrix.c | 8 ++++++-- src/linalg/linalg.h | 3 +++ src/linalg/matrix.c | 9 +++++++-- .../complexmatrix_constructor_negative_dimensions.morpho | 4 ++++ ...xmatrix_vector_constructor_negative_dimensions.morpho | 4 ++++ .../matrix_constructor_negative_dimensions.morpho | 4 ++++ .../matrix_vector_constructor_negative_dimensions.morpho | 4 ++++ 7 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 test/linalg/constructors/complexmatrix_constructor_negative_dimensions.morpho create mode 100644 test/linalg/constructors/complexmatrix_vector_constructor_negative_dimensions.morpho create mode 100644 test/linalg/constructors/matrix_constructor_negative_dimensions.morpho create mode 100644 test/linalg/constructors/matrix_vector_constructor_negative_dimensions.morpho diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index b5e832018..afea6b01a 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -96,6 +96,7 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat #ifdef MORPHO_LINALG_USE_LAPACKE double* superb = malloc(minmn * sizeof(double)); + if (!superb) return LINALGERR_ALLOC; info = LAPACKE_zgesvd(LAPACK_COL_MAJOR, (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT @@ -106,6 +107,7 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat (linalg_complexdouble_t *) (vt ? vt->elements : NULL), n, // VT matrix (n×n) superb ); + free(superb); #else int lwork = -1; linalg_complexdouble_t work_query; @@ -342,14 +344,16 @@ linalgError_t complexmatrix_inverse(objectcomplexmatrix *a) { value complexmatrix_constructor__int_int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); MatrixIdx_t ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - + + LINALG_ERRCHECKVMRETURN(LINALG_VALIDATECONSTRUCTORDIMS(nrows, ncols), MORPHO_NIL); objectcomplexmatrix *new=complexmatrix_new(nrows, ncols, true); return morpho_wrapandbind(v, (object *) new); } value complexmatrix_constructor__int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - + + LINALG_ERRCHECKVMRETURN(LINALG_VALIDATECONSTRUCTORDIMS(nrows, 1), MORPHO_NIL); objectcomplexmatrix *new=complexmatrix_new(nrows, 1, true); return morpho_wrapandbind(v, (object *) new); } diff --git a/src/linalg/linalg.h b/src/linalg/linalg.h index 29e861e37..6f021e147 100644 --- a/src/linalg/linalg.h +++ b/src/linalg/linalg.h @@ -88,6 +88,9 @@ void linalg_raiseerror(vm *v, linalgError_t err); /** Similar to the above, except returns the error rather than raising it */ #define LINALG_ERRCHECKRETURN(f) { linalgError_t err = f; if (err!=LINALGERR_OK) return err; } +/** Validate constructor dimensions before allocation */ +#define LINALG_VALIDATECONSTRUCTORDIMS(nrows, ncols) (((nrows)<0 || (ncols)<0) ? LINALGERR_INVLD_ARG : LINALGERR_OK) + /* ------------------------------------------------------- * Include the rest of the library * ------------------------------------------------------- */ diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index dbd9c78e6..d575b3cd7 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -156,6 +156,7 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat #ifdef MORPHO_LINALG_USE_LAPACKE double* superb = malloc(minmn * sizeof(double)); + if (!superb) return LINALGERR_ALLOC; info = LAPACKE_dgesvd(LAPACK_COL_MAJOR, (u ? 'A' : 'N'), // jobu: 'A' = all U columns, 'N' = no U (vt ? 'A' : 'N'), // jobvt: 'A' = all VT rows, 'N' = no VT @@ -166,6 +167,7 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat (vt ? vt->elements : NULL), n, // VT matrix (n×n) superb ); + free(superb); #else int lwork = -1; double work_query; @@ -264,6 +266,7 @@ matrixinterfacedefn matrixdefn = { /** Create a generic matrix with given type and layout */ objectmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { + if (nrows<0 || ncols<0 || nvals<=0) return NULL; MatrixCount_t nels = nrows*ncols*nvals; objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix) + nels*sizeof(double), type); @@ -775,14 +778,16 @@ linalgError_t matrix_roll(objectmatrix *a, int nplaces, int axis, objectmatrix * value matrix_constructor__int_int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), ncols = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); - + + LINALG_ERRCHECKVMRETURN(LINALG_VALIDATECONSTRUCTORDIMS(nrows, ncols), MORPHO_NIL); objectmatrix *new=matrix_new(nrows, ncols, true); return morpho_wrapandbind(v, (object *) new); } value matrix_constructor__int(vm *v, int nargs, value *args) { MatrixIdx_t nrows = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - + + LINALG_ERRCHECKVMRETURN(LINALG_VALIDATECONSTRUCTORDIMS(nrows, 1), MORPHO_NIL); objectmatrix *new=matrix_new(nrows, 1, true); return morpho_wrapandbind(v, (object *) new); } diff --git a/test/linalg/constructors/complexmatrix_constructor_negative_dimensions.morpho b/test/linalg/constructors/complexmatrix_constructor_negative_dimensions.morpho new file mode 100644 index 000000000..a70e9c0d1 --- /dev/null +++ b/test/linalg/constructors/complexmatrix_constructor_negative_dimensions.morpho @@ -0,0 +1,4 @@ +// ComplexMatrix constructor with negative dimensions + +print ComplexMatrix(-1, 2) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/constructors/complexmatrix_vector_constructor_negative_dimensions.morpho b/test/linalg/constructors/complexmatrix_vector_constructor_negative_dimensions.morpho new file mode 100644 index 000000000..ed6c7104f --- /dev/null +++ b/test/linalg/constructors/complexmatrix_vector_constructor_negative_dimensions.morpho @@ -0,0 +1,4 @@ +// ComplexMatrix vector constructor with negative dimensions + +print ComplexMatrix(-1) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/constructors/matrix_constructor_negative_dimensions.morpho b/test/linalg/constructors/matrix_constructor_negative_dimensions.morpho new file mode 100644 index 000000000..de3ac5258 --- /dev/null +++ b/test/linalg/constructors/matrix_constructor_negative_dimensions.morpho @@ -0,0 +1,4 @@ +// Matrix constructor with negative dimensions + +print Matrix(-1, 2) +// expect error 'LnAlgMtrxInvldArg' diff --git a/test/linalg/constructors/matrix_vector_constructor_negative_dimensions.morpho b/test/linalg/constructors/matrix_vector_constructor_negative_dimensions.morpho new file mode 100644 index 000000000..51023c7d9 --- /dev/null +++ b/test/linalg/constructors/matrix_vector_constructor_negative_dimensions.morpho @@ -0,0 +1,4 @@ +// Matrix vector constructor with negative dimensions + +print Matrix(-1) +// expect error 'LnAlgMtrxInvldArg' From a2b5e1adaae5b0b14bc58f0f0436ae84d405bda3 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 18:54:33 -0400 Subject: [PATCH 338/473] Make QR return a full basis --- src/linalg/complexmatrix.c | 20 +++++++++------ src/linalg/matrix.c | 21 +++++++++------- test/linalg/methods/complexmatrix_qr.morpho | 28 +++++++++------------ test/linalg/methods/matrix_qr.morpho | 22 +++++++--------- 4 files changed, 45 insertions(+), 46 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index afea6b01a..39bee1aed 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -147,13 +147,14 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { #else linalg_complexdouble_t tau[minmn]; int lwork = -1; + int lwork_geqrf; linalg_complexdouble_t work_query; - // Query optimal work size for ZGEQRF, which is reused for ZUNGQR + // Query optimal work size for ZGEQRF zgeqrf_(&m, &n, (linalg_complexdouble_t *) a->elements, &m, tau, &work_query, &lwork, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - int lwork_geqrf = (int) creal(work_query); + lwork_geqrf = (int) creal(work_query); linalg_complexdouble_t work[lwork_geqrf]; lwork = lwork_geqrf; @@ -181,16 +182,19 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { } #ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, minmn, minmn, (linalg_complexdouble_t *) q->elements, m, tau); + info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, m, minmn, (linalg_complexdouble_t *) q->elements, m, tau); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else - lwork = lwork_geqrf; - zungqr_(&m, &minmn, &minmn, (linalg_complexdouble_t *) q->elements, &m, tau, work, &lwork, &info); + int lwork_ungqr = -1; + linalg_complexdouble_t ungqr_work_query; + zungqr_(&m, &m, &minmn, (linalg_complexdouble_t *) q->elements, &m, tau, &ungqr_work_query, &lwork_ungqr, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork_ungqr = (int) creal(ungqr_work_query); + linalg_complexdouble_t ungqr_work[lwork_ungqr]; + zungqr_(&m, &m, &minmn, (linalg_complexdouble_t *) q->elements, &m, tau, ungqr_work, &lwork_ungqr, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #endif - - // If Q should be m×m, zero out remaining columns if m > minmn - if (m > minmn) memset(&q->elements[minmn * m * q->nvals], 0, (m - minmn) * m * sizeof(linalg_complexdouble_t)); } return LINALGERR_OK; diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index d575b3cd7..0af8dd9d9 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -198,13 +198,14 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else int lwork = -1; + int lwork_geqrf; double work_query; - // Query optimal work size for DGEQRF, which is reused for DORGQR + // Query optimal work size for DGEQRF dgeqrf_(&m, &n, a->elements, &m, tau, &work_query, &lwork, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - int lwork_geqrf = (int) work_query; + lwork_geqrf = (int) work_query; double work[lwork_geqrf]; lwork = lwork_geqrf; @@ -228,17 +229,19 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { for (int j = 0; j < minmn; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); #ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, minmn, minmn, q->elements, m, tau); + info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, m, minmn, q->elements, m, tau); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else - lwork = lwork_geqrf; - dorgqr_(&m, &minmn, &minmn, q->elements, &m, tau, work, &lwork, &info); + double orgqr_work_query; + int lwork_orgqr = -1; + dorgqr_(&m, &m, &minmn, q->elements, &m, tau, &orgqr_work_query, &lwork_orgqr, &info); + if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); + + lwork_orgqr = (int) orgqr_work_query; + double orgqr_work[lwork_orgqr]; + dorgqr_(&m, &m, &minmn, q->elements, &m, tau, orgqr_work, &lwork_orgqr, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #endif - - // If Q should be m×m, zero out remaining columns if m > minmn - // DORGQR only generates the first minmn columns, so we zero the rest - if (m > minmn) memset(&q->elements[minmn * m], 0, (m - minmn) * m * sizeof(double)); } return LINALGERR_OK; diff --git a/test/linalg/methods/complexmatrix_qr.morpho b/test/linalg/methods/complexmatrix_qr.morpho index 7d509bb66..cb339317a 100644 --- a/test/linalg/methods/complexmatrix_qr.morpho +++ b/test/linalg/methods/complexmatrix_qr.morpho @@ -66,22 +66,13 @@ print Q2.dimensions() print R2.dimensions() // expect: (4, 2) -// Verify Q2 first 2 columns are orthonormal (unitary) -// For tall matrices, only the first min(m,n) columns from ZUNGQR are orthonormal -// The remaining columns are zero -var Q2_col0 = Q2.column(0) -var Q2_col1 = Q2.column(1) -// Check norms -var norm0 = Q2_col0.norm() -var norm1 = Q2_col1.norm() - -print abs(norm0-1) < 1e-7 // expect: true -print abs(norm1-1) < 1e-7 // expect: true - -// Check orthogonality: inner product should be close to zero -var inner01 = Q2_col0.inner(Q2_col1) -var inner01_mag = inner01.abs() -print inner01_mag < 1e-10 +// Verify Q2 is unitary +var Q2HQ2 = Q2.conjTranspose() * Q2 +var I4 = ComplexMatrix(4,4) +for (var i = 0; i < 4; i = i + 1) { + I4[i,i] = 1.0 + 0.0im +} +print (Q2HQ2 - I4).norm() < 1e-10 // expect: true // Verify R2 is upper triangular @@ -97,6 +88,11 @@ for (var i = 0; i < 4; i = i + 1) { print R2_lower_norm < 1e-10 // expect: true +// Verify Q2 * R2 reconstruction +var Q2R2 = Q2 * R2 +print (Q2R2 - B).norm() < 1e-10 +// expect: true + // Test with a wide matrix var C = ComplexMatrix(2,4) C[0,0] = 1.0 + 1.0im diff --git a/test/linalg/methods/matrix_qr.morpho b/test/linalg/methods/matrix_qr.morpho index 9dfc2b262..60125e5cc 100644 --- a/test/linalg/methods/matrix_qr.morpho +++ b/test/linalg/methods/matrix_qr.morpho @@ -65,19 +65,10 @@ print Q2.dimensions() print R2.dimensions() // expect: (4, 2) -// Verify Q2 first 2 columns are orthonormal -// For tall matrices, only the first min(m,n) columns from DORGQR are orthonormal -// The remaining columns are zero -var Q2_col0 = Q2.column(0) -var Q2_col1 = Q2.column(1) -// Check norms -print Q2_col0.norm() < 1.0 + 1e-10 and Q2_col0.norm() > 1.0 - 1e-10 -// expect: true -print Q2_col1.norm() < 1.0 + 1e-10 and Q2_col1.norm() > 1.0 - 1e-10 -// expect: true -// Check orthogonality: dot product should be close to zero -var dot01 = Q2_col0.inner(Q2_col1) -print dot01 < 1e-10 and dot01 > -1e-10 +// Verify Q2 is orthogonal +var Q2TQ2 = Q2.transpose() * Q2 +var I4 = IdentityMatrix(4) +print (Q2TQ2 - I4).norm() < 1e-10 // expect: true // Verify R2 is upper triangular @@ -92,6 +83,11 @@ for (var i = 0; i < 4; i = i + 1) { print R2_lower_norm < 1e-10 // expect: true +// Verify Q2 * R2 reconstruction +var Q2R2 = Q2 * R2 +print (Q2R2 - B).norm() < 1e-10 +// expect: true + // Test with a wide matrix var C = Matrix(2,4) C[0,0] = 1.0 From 63f98f4c6f72fb44cf795710f7f9aa9b847cb115 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 19:19:42 -0400 Subject: [PATCH 339/473] Use alternative construction of Q --- src/linalg/complexmatrix.c | 24 ++++++++++-------------- src/linalg/matrix.c | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 39bee1aed..99d06eef0 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -171,28 +171,24 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { memset(&relems[j * m + (j + 1)], 0, (m - j - 1) * sizeof(linalg_complexdouble_t)); } - // Generate Q from reflectors + // Generate Q by applying the Householder product to the identity matrix if (q) { - // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) - // ZGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns - linalg_complexdouble_t *aelems = (linalg_complexdouble_t *) a->elements; linalg_complexdouble_t *qelems = (linalg_complexdouble_t *) q->elements; - for (int j = 0; j < minmn; j++) { - cblas_zcopy(m, &aelems[j * m], 1, &qelems[j * m], 1); - } + memset(q->elements, 0, q->nels*sizeof(double)); + for (int i = 0; i < m; i++) qelems[i*m+i] = 1.0 + 0.0*I; #ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_zungqr(LAPACK_COL_MAJOR, m, m, minmn, (linalg_complexdouble_t *) q->elements, m, tau); + info = LAPACKE_zunmqr(LAPACK_COL_MAJOR, 'L', 'N', m, m, minmn, (linalg_complexdouble_t *) a->elements, m, tau, (linalg_complexdouble_t *) q->elements, m); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else - int lwork_ungqr = -1; - linalg_complexdouble_t ungqr_work_query; - zungqr_(&m, &m, &minmn, (linalg_complexdouble_t *) q->elements, &m, tau, &ungqr_work_query, &lwork_ungqr, &info); + int lwork_unmqr = -1; + linalg_complexdouble_t unmqr_work_query; + zunmqr_("L", "N", &m, &m, &minmn, (linalg_complexdouble_t *) a->elements, &m, tau, (linalg_complexdouble_t *) q->elements, &m, &unmqr_work_query, &lwork_unmqr, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - lwork_ungqr = (int) creal(ungqr_work_query); - linalg_complexdouble_t ungqr_work[lwork_ungqr]; - zungqr_(&m, &m, &minmn, (linalg_complexdouble_t *) q->elements, &m, tau, ungqr_work, &lwork_ungqr, &info); + lwork_unmqr = (int) creal(unmqr_work_query); + linalg_complexdouble_t unmqr_work[lwork_unmqr]; + zunmqr_("L", "N", &m, &m, &minmn, (linalg_complexdouble_t *) a->elements, &m, tau, (linalg_complexdouble_t *) q->elements, &m, unmqr_work, &lwork_unmqr, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #endif } diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 0af8dd9d9..64bffd045 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -222,24 +222,23 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { memset(&r->elements[j * m + (j + 1)], 0, (m - j - 1) * sizeof(double)); } - // Generate Q from reflectors + // Generate Q by applying the Householder product to the identity matrix if (q) { - // Copy reflectors from a to q (only first n columns, since a is m×n and q is m×m) - // DGEQRF stores reflectors in lower triangle and R in upper triangle of first n columns - for (int j = 0; j < minmn; j++) cblas_dcopy(m, &a->elements[j * m], 1, &q->elements[j * m], 1); + memset(q->elements, 0, q->nels*sizeof(double)); + for (int i=0; ielements[i*m+i]=1.0; #ifdef MORPHO_LINALG_USE_LAPACKE - info = LAPACKE_dorgqr(LAPACK_COL_MAJOR, m, m, minmn, q->elements, m, tau); + info = LAPACKE_dormqr(LAPACK_COL_MAJOR, 'L', 'N', m, m, minmn, a->elements, m, tau, q->elements, m); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #else - double orgqr_work_query; - int lwork_orgqr = -1; - dorgqr_(&m, &m, &minmn, q->elements, &m, tau, &orgqr_work_query, &lwork_orgqr, &info); + double ormqr_work_query; + int lwork_ormqr = -1; + dormqr_("L", "N", &m, &m, &minmn, a->elements, &m, tau, q->elements, &m, &ormqr_work_query, &lwork_ormqr, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); - lwork_orgqr = (int) orgqr_work_query; - double orgqr_work[lwork_orgqr]; - dorgqr_(&m, &m, &minmn, q->elements, &m, tau, orgqr_work, &lwork_orgqr, &info); + lwork_ormqr = (int) ormqr_work_query; + double ormqr_work[lwork_ormqr]; + dormqr_("L", "N", &m, &m, &minmn, a->elements, &m, tau, q->elements, &m, ormqr_work, &lwork_ormqr, &info); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); #endif } From 617afe26f3e2d1cccae07d668d39a479dbe5f85c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 15 Apr 2026 20:02:33 -0400 Subject: [PATCH 340/473] Check for overflow and other minor hardenings --- src/linalg/complexmatrix.c | 15 +++++++--- src/linalg/matrix.c | 28 +++++++++++++++---- ..._array_constructor_invalid_elements.morpho | 2 +- 3 files changed, 35 insertions(+), 10 deletions(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 99d06eef0..148c80873 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -139,6 +139,16 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; + if (q) { + linalg_complexdouble_t *qelems = (linalg_complexdouble_t *) q->elements; + memset(q->elements, 0, q->nels*sizeof(double)); + for (int i = 0; i < m; i++) qelems[i*m+i] = 1.0 + 0.0*I; + } + if (minmn==0) { + if (r) matrix_copy(a, r); + return LINALGERR_OK; + } + // Compute QR factorization without pivoting: A = Q*R #ifdef MORPHO_LINALG_USE_LAPACKE linalg_complexdouble_t tau[minmn]; @@ -173,10 +183,6 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { // Generate Q by applying the Householder product to the identity matrix if (q) { - linalg_complexdouble_t *qelems = (linalg_complexdouble_t *) q->elements; - memset(q->elements, 0, q->nels*sizeof(double)); - for (int i = 0; i < m; i++) qelems[i*m+i] = 1.0 + 0.0*I; - #ifdef MORPHO_LINALG_USE_LAPACKE info = LAPACKE_zunmqr(LAPACK_COL_MAJOR, 'L', 'N', m, m, minmn, (linalg_complexdouble_t *) a->elements, m, tau, (linalg_complexdouble_t *) q->elements, m); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); @@ -378,6 +384,7 @@ value complexmatrix_constructor__array(vm *v, int nargs, value *args) { if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_COMPLEXMATRIX, 2); + if (!new) return MORPHO_NIL; return morpho_wrapandbind(v, (object *) new); } diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 64bffd045..6982afd37 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -43,6 +43,12 @@ bool matrix_isamatrix(value val) { return iindx>=0 && iindxSIZE_MAX/a) return true; + *out = a*b; + return false; +} + /* ********************************************************************** * Matrix objects * ********************************************************************** */ @@ -191,6 +197,16 @@ static linalgError_t _svd(objectmatrix *a, double *s, objectmatrix *u, objectmat static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { int info, m=a->nrows, n=a->ncols; int minmn = (m < n) ? m : n; + + if (q) { + memset(q->elements, 0, q->nels*sizeof(double)); + for (int i=0; ielements[i*m+i]=1.0; + } + if (minmn==0) { + if (r) matrix_copy(a, r); + return LINALGERR_OK; + } + double tau[minmn]; #ifdef MORPHO_LINALG_USE_LAPACKE @@ -224,9 +240,6 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { // Generate Q by applying the Householder product to the identity matrix if (q) { - memset(q->elements, 0, q->nels*sizeof(double)); - for (int i=0; ielements[i*m+i]=1.0; - #ifdef MORPHO_LINALG_USE_LAPACKE info = LAPACKE_dormqr(LAPACK_COL_MAJOR, 'L', 'N', m, m, minmn, a->elements, m, tau, q->elements, m); if (info != 0) return (info > 0 ? LINALGERR_OP_FAILED : LINALGERR_LAPACK_INVLD_ARGS); @@ -269,7 +282,12 @@ matrixinterfacedefn matrixdefn = { /** Create a generic matrix with given type and layout */ objectmatrix *matrix_newwithtype(objecttype type, MatrixIdx_t nrows, MatrixIdx_t ncols, MatrixIdx_t nvals, bool zero) { if (nrows<0 || ncols<0 || nvals<=0) return NULL; - MatrixCount_t nels = nrows*ncols*nvals; + size_t nentries, scalarCount; + if (_mul_overflow_size((size_t) nrows, (size_t) ncols, &nentries)) return NULL; + if (_mul_overflow_size(nentries, (size_t) nvals, &scalarCount)) return NULL; + if (scalarCount > (size_t) ((MatrixCount_t) -1) || + scalarCount > (SIZE_MAX-sizeof(objectmatrix))/sizeof(double)) return NULL; + MatrixCount_t nels = (MatrixCount_t) scalarCount; objectmatrix *new = (objectmatrix *) object_new(sizeof(objectmatrix) + nels*sizeof(double), type); if (new) { @@ -823,7 +841,7 @@ value matrix_constructor__array(vm *v, int nargs, value *args) { if (a->ndim!=2) { morpho_runtimeerror(v, LINALG_INVLDARGS); return MORPHO_NIL; } objectmatrix *new = matrix_arrayconstructor(v, a, OBJECT_MATRIX, 1); - LINALG_ERRCHECKVMRETURN((new ? LINALGERR_OK : LINALGERR_INVLD_ARG), MORPHO_NIL); + if (!new) return MORPHO_NIL; return morpho_wrapandbind(v, (object *) new); } diff --git a/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho b/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho index 4ae74f986..e8ed6341b 100644 --- a/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho +++ b/test/linalg/constructors/matrix_array_constructor_invalid_elements.morpho @@ -7,4 +7,4 @@ a[1,0] = 3 a[1,1] = 4 print Matrix(a) -// expect error 'LnAlgMtrxInvldArg' +// expect error 'LnAlgMtrxNnNmrclArg' From b965eaf73b57161a3068b71583a809d2b629c718 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 16 Apr 2026 22:47:24 -0400 Subject: [PATCH 341/473] Single slice operator for vectors --- src/datastructures/object.h | 3 ++ src/linalg/complexmatrix.c | 3 ++ src/linalg/matrix.c | 38 +++++++++++++++---- src/linalg/matrix.h | 1 + ...exmatrix_vector_slice_compatibility.morpho | 10 +++++ .../matrix_vector_slice_compatibility.morpho | 10 +++++ 6 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 test/linalg/index/complexmatrix_vector_slice_compatibility.morpho create mode 100644 test/linalg/index/matrix_vector_slice_compatibility.morpho diff --git a/src/datastructures/object.h b/src/datastructures/object.h index 57a87848d..bb102b78c 100644 --- a/src/datastructures/object.h +++ b/src/datastructures/object.h @@ -44,6 +44,9 @@ struct sobject { @warning: Do not use this to compare types, use an appropriate macro like MORPHO_ISXXX */ #define MORPHO_GETOBJECTTYPE(val) (MORPHO_GETOBJECT(val)->type) +/** Gets the type of an object pointer */ +#define OBJECT_GETTYPE(obj) (((object *) (obj))->type) + /** Gets an object's key */ #define MORPHO_GETOBJECTHASH(val) (MORPHO_GETOBJECT(val)->hsh) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 148c80873..d600c86c8 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -603,6 +603,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Range)", Matrix_index__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (List)", Matrix_index__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Tuple)", Matrix_index__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index__x_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 6982afd37..21aff66e5 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -31,7 +31,7 @@ void matrix_addinterface(matrixinterfacedefn *defn) { } matrixinterfacedefn *matrix_getinterface(objectmatrix *a) { - int iindx = a->obj.type-OBJECT_MATRIX; + int iindx = OBJECT_GETTYPE(a)-OBJECT_MATRIX; if (iindxobj.type, in->nrows, in->ncols, in->nvals, false); + objectmatrix *new = matrix_newwithtype(OBJECT_GETTYPE(in), in->nrows, in->ncols, in->nvals, false); if (new) cblas_dcopy((linalg_int_t) in->nels, in->elements, 1, new->elements, 1); return new; @@ -984,15 +984,14 @@ static linalgError_t _slice_copy(value iv, value jv, MatrixIdx_t icnt, MatrixIdx return LINALGERR_OK; } -value Matrix_index__x_x(vm *v, int nargs, value *args) { - objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)), *new=NULL; - value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); +static value _index_slice(vm *v, objectmatrix *m, value iv, value jv) { + objectmatrix *new=NULL; value out=MORPHO_NIL; - MatrixIdx_t icnt=0, jcnt=0; // Counts become size of new matrix + MatrixIdx_t icnt=0, jcnt=0; LINALG_ERRCHECKVMRETURN(_slice_validate(iv, jv, &icnt, &jcnt), MORPHO_NIL); - new=matrix_newwithtype(MORPHO_GETOBJECTTYPE(MORPHO_SELF(args)), icnt, jcnt, m->nvals, false); + new=matrix_newwithtype(OBJECT_GETTYPE(m), icnt, jcnt, m->nvals, false); if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } linalgError_t err=_slice_copy(iv, jv, icnt, jcnt, m, new, false); @@ -1002,6 +1001,26 @@ value Matrix_index__x_x(vm *v, int nargs, value *args) { return out; } +value Matrix_index__x_x(vm *v, int nargs, value *args) { + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); + value iv=MORPHO_GETARG(args, 0), jv=MORPHO_GETARG(args, 1); + return _index_slice(v, m, iv, jv); +} + +value Matrix_index__x(vm *v, int nargs, value *args) { + objectmatrix *m = MORPHO_GETMATRIX(MORPHO_SELF(args)); + value indx = MORPHO_GETARG(args, 0); + + if (m->ncols==1) { + return _index_slice(v, m, indx, MORPHO_INTEGER(0)); + } else if (m->nrows==1) { + return _index_slice(v, m, MORPHO_INTEGER(0), indx); + } + + morpho_runtimeerror(v, LINALG_INVLDINDICES); + return MORPHO_NIL; +} + value Matrix_index__err(vm *v, int nargs, value *args) { morpho_runtimeerror(v, LINALG_INVLDINDICES); return MORPHO_NIL; @@ -1053,7 +1072,7 @@ value Matrix_getcolumn__int(vm *v, int nargs, value *args) { value out=MORPHO_NIL; if (i>=0 && incols) { - objectmatrix *new=matrix_newwithtype(a->obj.type, a->nrows, 1, a->nvals, false); + objectmatrix *new=matrix_newwithtype(OBJECT_GETTYPE(a), a->nrows, 1, a->nvals, false); if (new) matrix_getcolumn(a, i, new); out=morpho_wrapandbind(v, (object *)new); } else linalg_raiseerror(v, LINALGERR_INDX_OUT_OF_BNDS); @@ -1572,6 +1591,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(Matrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (Range)", Matrix_index__x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (List)", Matrix_index__x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (Tuple)", Matrix_index__x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index__int_int, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index__x_x, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index d911825c4..a34e90b9d 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -200,6 +200,7 @@ IMPLEMENTATIONFN(Matrix_clone); IMPLEMENTATIONFN(Matrix_index__int); IMPLEMENTATIONFN(Matrix_index__int_int); +IMPLEMENTATIONFN(Matrix_index__x); IMPLEMENTATIONFN(Matrix_index__x_x); IMPLEMENTATIONFN(Matrix_index__err); IMPLEMENTATIONFN(Matrix_setindex__int_x); diff --git a/test/linalg/index/complexmatrix_vector_slice_compatibility.morpho b/test/linalg/index/complexmatrix_vector_slice_compatibility.morpho new file mode 100644 index 000000000..38133f3d8 --- /dev/null +++ b/test/linalg/index/complexmatrix_vector_slice_compatibility.morpho @@ -0,0 +1,10 @@ +// Vector-style one-argument slicing should work on ComplexMatrix vectors + +var a = ComplexMatrix((1+1im,2+2im,3+3im)) +print a[0..1] +// expect: [ 1 + 1im ] +// expect: [ 2 + 2im ] + +var b = ComplexMatrix(((1+1im,2+2im,3+3im))) +print b[0..1] +// expect: [ 1 + 1im 2 + 2im ] diff --git a/test/linalg/index/matrix_vector_slice_compatibility.morpho b/test/linalg/index/matrix_vector_slice_compatibility.morpho new file mode 100644 index 000000000..5ccc3a759 --- /dev/null +++ b/test/linalg/index/matrix_vector_slice_compatibility.morpho @@ -0,0 +1,10 @@ +// Vector-style one-argument slicing should work on Matrix vectors + +var a = Matrix([1,2,3]) +print a[0..1] +// expect: [ 1 ] +// expect: [ 2 ] + +var b = Matrix(((1,2,3))) +print b[0..1] +// expect: [ 1 2 ] From 37109d87edb99bfe11647a665b69e2e19d10e0d1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 17 Apr 2026 16:12:48 -0400 Subject: [PATCH 342/473] Improvements to Tuple to provide the order method --- src/classes/list.c | 15 +++++----- src/classes/tuple.c | 64 +++++++++++++++++++++++++++++++----------- test/list/order.morpho | 4 +-- 3 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/classes/list.c b/src/classes/list.c index 5569e0a57..f72ba2b53 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -182,10 +182,10 @@ int list_orderfunction(const void *a, const void *b) { return -morpho_comparevalue(((listorderstruct *) a)->val, ((listorderstruct *) b)->val); } -/* Returns a list of indices giving the ordering of a list */ -objectlist *list_order(objectlist *list) { +/* Returns a tuple of indices giving the ordering of a list */ +objecttuple *list_order(objectlist *list) { listorderstruct *order = MORPHO_MALLOC(list->val.count*sizeof(listorderstruct)); - objectlist *new = NULL; + objecttuple *new = NULL; if (order) { for (unsigned int i=0; ival.count; i++) { @@ -194,12 +194,11 @@ objectlist *list_order(objectlist *list) { } qsort(order, list->val.count, sizeof(listorderstruct), list_orderfunction); - new=object_newlist(list->val.count, NULL); + new=object_newtuple(list->val.count, NULL); if (new) { for (unsigned int i=0; ival.count; i++) { - new->val.data[i]=MORPHO_INTEGER(order[i].indx); + new->tuple[i]=MORPHO_INTEGER(order[i].indx); } - new->val.count=list->val.count; } MORPHO_FREE(order); @@ -636,12 +635,12 @@ value List_sort_fn(vm *v, int nargs, value *args) { return MORPHO_NIL; } -/** Returns a list of indices that would sort the list self */ +/** Returns a tuple of indices that would sort the list self */ value List_order(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); value out=MORPHO_NIL; - objectlist *new=list_order(slf); + objecttuple *new=list_order(slf); if (new) { out=MORPHO_OBJECT(new); morpho_bindobjects(v, 1, &out); diff --git a/src/classes/tuple.c b/src/classes/tuple.c index dd256f56e..34d6f0823 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -160,13 +160,8 @@ errorid array_to_tuple_error(objectarrayerror err) { /** Constructor function for tuples */ value tuple_constructor(vm *v, int nargs, value *args) { - value out = MORPHO_NIL; objecttuple *new=object_newtuple(nargs, & MORPHO_GETARG(args, 0)); - if (new) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - return out; + return morpho_wrapandbind(v, (object *) new); } /** Find a tuple's length */ @@ -178,16 +173,10 @@ value Tuple_count(vm *v, int nargs, value *args) { /** Clones a tuple */ value Tuple_clone(vm *v, int nargs, value *args) { - value out = MORPHO_NIL; objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); objecttuple *new = object_newtuple(slf->length, slf->tuple); - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - - return out; + return morpho_wrapandbind(v, (object *) new); } /** Get an element */ @@ -247,16 +236,49 @@ value Tuple_join(vm *v, int nargs, value *args) { objecttuple *operand = MORPHO_GETTUPLE(MORPHO_GETARG(args, 0)); objecttuple *new = tuple_concatenate(slf, operand); - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } + out = morpho_wrapandbind(v, (object *) new); } else morpho_runtimeerror(v, LIST_ADDARGS); return out; } +/** Sort function for tuple_order */ +typedef struct { + unsigned int indx; + value val; +} tupleorderstruct; + +/** Sort function for tuple_order */ +int tuple_orderfunction(const void *a, const void *b) { + return -morpho_comparevalue(((tupleorderstruct *) a)->val, ((tupleorderstruct *) b)->val); +} + +/** Returns a tuple of indices giving the ordering of a tuple */ +objecttuple *tuple_order(objecttuple *tuple) { + tupleorderstruct *order = MORPHO_MALLOC(tuple->length*sizeof(tupleorderstruct)); + objecttuple *new = NULL; + + if (order) { + for (unsigned int i=0; ilength; i++) { + order[i].indx=i; + order[i].val=tuple->tuple[i]; + } + qsort(order, tuple->length, sizeof(tupleorderstruct), tuple_orderfunction); + + new=object_newtuple(tuple->length, NULL); + if (new) { + for (unsigned int i=0; ilength; i++) { + new->tuple[i]=MORPHO_INTEGER(order[i].indx); + } + } + + MORPHO_FREE(order); + } + + return new; +} + /** Sorts the contents of a tuple, returning a new tuple */ value Tuple_sort(vm *v, int nargs, value *args) { objecttuple *src = MORPHO_GETTUPLE(MORPHO_SELF(args)); @@ -284,6 +306,13 @@ value Tuple_sort_fn(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/** Returns a tuple of indices that would sort the tuple self */ +value Tuple_order(vm *v, int nargs, value *args) { + objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); + objecttuple *new=tuple_order(slf); + return morpho_wrapandbind(v, (object *) new); +} + /** Tests if a tuple has a value as a member */ value Tuple_ismember(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); @@ -305,6 +334,7 @@ MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (_)", Tuple_join, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (_)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(LIST_ORDER_METHOD, Tuple_order, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/test/list/order.morpho b/test/list/order.morpho index 34fdb138a..2ee5041fb 100644 --- a/test/list/order.morpho +++ b/test/list/order.morpho @@ -6,7 +6,7 @@ var lst = [ 3,2,1 ] print lst // expect: [ 3, 2, 1 ] print lst.order() -// expect: [ 2, 1, 0 ] +// expect: (2, 1, 0) print lst.sort() // // expect: nil print lst @@ -19,7 +19,7 @@ print a // expect: [ 1, 0.92388, 0.707107, 0.382683, 6.12323e-17, -0.382683, -0.707107, -0.92388, -1, -0.92388, -0.707107, -0.382683, -1.83697e-16, 0.382683, 0.707107, 0.92388, 1 ] var o = a.order() print o -// expect: [ 8, 9, 7, 10, 6, 11, 5, 12, 4, 3, 13, 2, 14, 1, 15, 0, 16 ] +// expect: (8, 9, 7, 10, 6, 11, 5, 12, 4, 3, 13, 2, 14, 1, 15, 0, 16) var y = [] for (i in 0...a.count()) y.append(a[o[i]]) From 2d5efd69797f7051acbf450371c4e93b63c0a784 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 17 Apr 2026 16:29:36 -0400 Subject: [PATCH 343/473] Improvements to Tuple class --- src/classes/tuple.c | 92 +++++++++++++++++++++++++++++++- test/tuple/tuple_order.morpho | 6 +++ test/tuple/tuple_reverse.morpho | 12 +++++ test/tuple/tuple_roll.morpho | 18 +++++++ test/tuple/tuple_tostring.morpho | 5 ++ 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 test/tuple/tuple_order.morpho create mode 100644 test/tuple/tuple_reverse.morpho create mode 100644 test/tuple/tuple_roll.morpho create mode 100644 test/tuple/tuple_tostring.morpho diff --git a/src/classes/tuple.c b/src/classes/tuple.c index 34d6f0823..5afc52746 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -6,6 +6,7 @@ #include "morpho.h" #include "classes.h" +#include "common.h" /* ********************************************************************** * Tuple objects @@ -114,6 +115,47 @@ objecttuple *tuple_concatenate(objecttuple *a, objecttuple *b) { return new; } +/** Reverses a tuple, returning a new tuple */ +objecttuple *tuple_reverse(objecttuple *tuple) { + objecttuple *new = object_newtuple(tuple->length, tuple->tuple); + + if (new) { + unsigned int hlen = new->length / 2; + for (unsigned int i=0; ilength-i-1; + value swp = new->tuple[i]; + new->tuple[i]=new->tuple[j]; + new->tuple[j]=swp; + } + } + + return new; +} + +/** Rolls a tuple by a number of elements, returning a new tuple */ +objecttuple *tuple_roll(objecttuple *tuple, int nplaces) { + objecttuple *new=object_newtuple(tuple->length, NULL); + + if (new) { + unsigned int N = tuple->length; + if (N==0) return new; + + int n = abs(nplaces); + if (n>N) n = n % N; + unsigned int Np = N - n; + + if (nplaces<0) { + memcpy(new->tuple, tuple->tuple+n, sizeof(value)*Np); + memcpy(new->tuple+Np, tuple->tuple, sizeof(value)*n); + } else { + memcpy(new->tuple+n, tuple->tuple, sizeof(value)*Np); + if (n>0) memcpy(new->tuple, tuple->tuple+Np, sizeof(value)*n); + } + } + + return new; +} + /* ------------------------------------------------------- * Slicing * ------------------------------------------------------- */ @@ -179,6 +221,28 @@ value Tuple_clone(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/** Convert a tuple to a string */ +value Tuple_tostring(vm *v, int nargs, value *args) { + objecttuple *tuple=MORPHO_GETTUPLE(MORPHO_SELF(args)); + value out = MORPHO_NIL; + + varray_char buffer; + varray_charinit(&buffer); + + varray_charadd(&buffer, "(", 1); + for (unsigned int i=0; ilength; i++) { + morpho_printtobuffer(v, tuple->tuple[i], &buffer); + if (ilength-1) varray_charadd(&buffer, ", ", 2); + } + varray_charadd(&buffer, ")", 1); + + out = object_stringfromvarraychar(&buffer); + if (MORPHO_ISSTRING(out)) morpho_bindobjects(v, 1, &out); + varray_charclear(&buffer); + + return out; +} + /** Get an element */ value Tuple_getindex(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); @@ -313,6 +377,29 @@ value Tuple_order(vm *v, int nargs, value *args) { return morpho_wrapandbind(v, (object *) new); } +/** Returns a reversed copy of the tuple */ +value Tuple_reverse(vm *v, int nargs, value *args) { + objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); + objecttuple *new=tuple_reverse(slf); + return morpho_wrapandbind(v, (object *) new); +} + +/** Rolls a tuple */ +value Tuple_roll(vm *v, int nargs, value *args) { + objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); + + if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + int roll; + morpho_valuetoint(MORPHO_GETARG(args, 0), &roll); + + objecttuple *new = tuple_roll(slf, roll); + return morpho_wrapandbind(v, (object *) new); + } + + morpho_runtimeerror(v, LIST_ADDARGS); + return MORPHO_NIL; +} + /** Tests if a tuple has a value as a member */ value Tuple_ismember(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); @@ -327,14 +414,17 @@ value Tuple_ismember(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Tuple) MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Tuple_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Tuple_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (_)", Tuple_join, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (_)", Tuple_roll, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (_)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_ORDER_METHOD, Tuple_order, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/test/tuple/tuple_order.morpho b/test/tuple/tuple_order.morpho new file mode 100644 index 000000000..62d1925fb --- /dev/null +++ b/test/tuple/tuple_order.morpho @@ -0,0 +1,6 @@ +// Tuple order + +var t = ( 3, 2, 1 ) +print t.order() +// expect: (2, 1, 0) + diff --git a/test/tuple/tuple_reverse.morpho b/test/tuple/tuple_reverse.morpho new file mode 100644 index 000000000..f894b82c1 --- /dev/null +++ b/test/tuple/tuple_reverse.morpho @@ -0,0 +1,12 @@ +// Tuple reverse + +var t = ( 1, 2, 3 ) +print t.reverse() +// expect: (3, 2, 1) +print t +// expect: (1, 2, 3) + +var u = ( 1, 2, 3, 4 ) +print u.reverse() +// expect: (4, 3, 2, 1) + diff --git a/test/tuple/tuple_roll.morpho b/test/tuple/tuple_roll.morpho new file mode 100644 index 000000000..792d84ad0 --- /dev/null +++ b/test/tuple/tuple_roll.morpho @@ -0,0 +1,18 @@ +// Tuple roll + +var t = ( 1, 2, 3 ) + +for (n in -4..4) { + print t.roll(n) +} + +// expect: (2, 3, 1) +// expect: (1, 2, 3) +// expect: (3, 1, 2) +// expect: (2, 3, 1) +// expect: (1, 2, 3) +// expect: (3, 1, 2) +// expect: (2, 3, 1) +// expect: (1, 2, 3) +// expect: (3, 1, 2) + diff --git a/test/tuple/tuple_tostring.morpho b/test/tuple/tuple_tostring.morpho new file mode 100644 index 000000000..6f9a71eda --- /dev/null +++ b/test/tuple/tuple_tostring.morpho @@ -0,0 +1,5 @@ +// Tuple tostring + +var t = ( 1, 2, 3 ) +print t.tostring() +// expect: (1, 2, 3) From d3205520ad2318ed9893cb75c33eba9fcc95976a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 17 Apr 2026 17:00:29 -0400 Subject: [PATCH 344/473] Improvements to help --- help/errors.md | 6 ++-- help/json.md | 2 +- help/list.md | 8 +++-- help/matrix.md | 84 ++++++++++++++++++++++++++++++++++++++++++++------ help/tuple.md | 53 +++++++++++++++++++++++++++++-- 5 files changed, 135 insertions(+), 18 deletions(-) diff --git a/help/errors.md b/help/errors.md index 8d7ce5e12..6a17a1277 100644 --- a/help/errors.md +++ b/help/errors.md @@ -976,10 +976,12 @@ This error occurs when the norm method is called with invalid arguments. It expe ## MtrxStClArgs [tagmtrxstclargs]: # (mtrxstclargs) -This error occurs when setcolumn is called with invalid arguments. It expects an integer column index and a column matrix: +This error occurs when `setColumn` is called with invalid arguments. It expects an integer column index and a column matrix: var m = Matrix([[1,2],[3,4]]) - m.setcolumn("invalid", Matrix([1,2])) // Causes 'MtrxStClArgs' + m.setColumn("invalid", Matrix([1,2])) // Causes 'MtrxStClArgs' + +The older method name `setcolumn` is retained for compatibility but is deprecated. ## LnAlgMtrxIncmptbl [taglnalgmtrxincmptbl]: # (lnalgmtrxincmptbl) diff --git a/help/json.md b/help/json.md index 3185e3312..55befc8a0 100644 --- a/help/json.md +++ b/help/json.md @@ -15,7 +15,7 @@ To parse a string that contains JSON, use the `parse` method: Elements in the JSON string are converted to equivalent morpho values. -To convert basic data types to JSON, use the `tostring` method: +To convert basic data types to JSON, use the `JSON.tostring` class method: var b = JSON.tostring([1,2,3]) diff --git a/help/list.md b/help/list.md index f343eec4b..065254a92 100644 --- a/help/list.md +++ b/help/list.md @@ -80,12 +80,14 @@ This function should return a negative value if `ab` ## Order [tagorder]: # (order) -Returns a list of indices that would, if used in order, would sort a list. For example +Returns a tuple of indices that would, if used in order, sort a list, without modifying the original list. For example var list = [2,3,1] - print list.order() // expect: [2,0,1] + print list.order() // expect: (2,0,1) -would produce `[2,0,1]` +would produce `(2,0,1)` + +In contrast to `sort`, `order` does not modify the list. ## Remove [tagremove]: # (remove) diff --git a/help/matrix.md b/help/matrix.md index 6e28fa063..9d808bf00 100644 --- a/help/matrix.md +++ b/help/matrix.md @@ -26,6 +26,8 @@ Finally, you can create a Matrix by assembling other matrices like this, var a = Matrix([[0,1],[1,0]]) var b = Matrix([[a,0],[0,a]]) // produces a 4x4 matrix +The `ComplexMatrix` class provides the corresponding support for complex-valued matrices and supports the same core indexing, slicing, decomposition and arithmetic operations, together with methods such as `real`, `imag`, `conjugate` and `conjTranspose`. + Once a matrix is created, you can use all the regular arithmetic operators with matrix operands, e.g. a+b @@ -39,6 +41,11 @@ or create a submatrix using slices: print a[0..1,0..1] +If a matrix is a row or column vector, it can also be sliced with a single argument: + + var v = Matrix([1,2,3]) + print v[0..1] + The division operator is used to solve a linear system, e.g. var a = Matrix([[1,2],[3,4]]) @@ -65,15 +72,15 @@ The two matrices must have the same dimensions. Returns the dimensions of a matrix: var A = Matrix([1,2,3]) // Create a column matrix - print A.dimensions() // Expect: [ 3, 1 ] + print A.dimensions() // Expect: (3, 1) ## Eigenvalues [tageigenvalues]: # (Eigenvalues) -Returns a list of eigenvalues of a Matrix: +Returns a tuple of eigenvalues of a Matrix: var A = Matrix([[0,1],[1,0]]) - print A.eigenvalues() // Expect: [1,-1] + print A.eigenvalues() // Expect: (1,-1) ## Eigensystem [tageigensystem]: # (Eigensystem) @@ -83,14 +90,46 @@ Returns the eigenvalues and eigenvectors of a Matrix: var A = Matrix([[0,1],[1,0]]) print A.eigensystem() -Eigensystem returns a two element list: The first element is a List of eigenvalues. The second element is a Matrix containing the corresponding eigenvectors as its columns: +Eigensystem returns a two element tuple: The first element is a tuple of eigenvalues. The second element is a Matrix containing the corresponding eigenvectors as its columns: print A.eigensystem()[0] - // [ 1, -1 ] + // (1, -1) print A.eigensystem()[1] // [ 0.707107 -0.707107 ] // [ 0.707107 0.707107 ] +## SVD +[tagsvd]: # (SVD) + +The 'svd' method returns the singular value decomposition of a matrix as a three element tuple: + + var svd = A.svd() + +The return value contains the left singular vectors, singular values, and right singular vectors in that order. + +If `A` is a matrix, its singular value decomposition factors it as + + A = U S V^T + +where `U` and `V` are orthogonal matrices and `S` contains the singular values of `A`. + +The SVD is useful for understanding the numerical rank of a matrix, solving least-squares problems, and analyzing the dominant modes or directions present in the data represented by a matrix. + +## QR +[tagqr]: # (QR) + +The 'qr' method returns the QR decomposition of a matrix as a two element tuple: + + var qr = A.qr() + +If `A` is a matrix, its QR decomposition factors it as + + A = Q R + +where `Q` is orthogonal and `R` is upper triangular. + +The QR decomposition is useful for solving linear least-squares problems and for constructing numerically stable orthogonal bases from the columns of a matrix. + ## Inner [taginner]: # (Inner) @@ -122,17 +161,16 @@ matrix. ## Norm [tagnorm]: # (Norm) -Returns a matrix norm. By default the L2 norm is returned: +Returns a matrix norm. By default the Frobenius norm is returned: var a = Matrix([1,2,3,4]) print a.norm() // Expect: sqrt(30) = 5.47723... -You can select a different norm by supplying an argument: +You can select a different supported norm by supplying an argument: import constants - print a.norm(1) // Expect: 10 (L1 norm is sum of absolute values) - print a.norm(3) // Expect: 4.64159 (An unusual choice of norm) - print a.norm(Inf) // Expect: 4 (Inf-norm corresponds to maximum absolute value) + print a.norm(1) // Expect: 10 (L1 norm) + print a.norm(Inf) // Expect: 4 (Infinity norm) ## Reshape [tagreshape]: # (Reshape) @@ -181,3 +219,29 @@ Elements that roll beyond the last position are re-introduced at the first. Constructs an identity matrix of a specified size: var a = IdentityMatrix(size) + +## ComplexMatrix +[tagcomplexmatrix]: # (ComplexMatrix) + +The `ComplexMatrix` class provides support for complex-valued matrices. It can be initialized in the same ways as `Matrix`, for example + + var a = ComplexMatrix(2,2) + var b = ComplexMatrix((1+1im, 2+2im, 3+3im)) + var c = ComplexMatrix([[1+1im, 2], [3, 4-1im]]) + +`ComplexMatrix` supports the same core indexing, slicing, arithmetic and decomposition methods as `Matrix`, including `inverse`, `norm`, `sum`, `trace`, `transpose`, `eigenvalues`, `eigensystem`, `svd`, `qr`, `reshape` and `roll`. + +As with `Matrix`, single-argument slicing is supported for row and column vectors. + +For `ComplexMatrix`, `eigenvalues()` and the first component of `eigensystem()` may contain complex values. + +In addition, `ComplexMatrix` provides methods for accessing and manipulating the complex structure: + + var r = c.real() + var i = c.imag() + var z = c.conjugate() + var h = c.conjTranspose() + +`conjugate()` returns the elementwise complex conjugate of the matrix, while `conjTranspose()` returns the conjugate transpose (also called the Hermitian transpose). + +Mixed arithmetic between `Matrix` and `ComplexMatrix` is supported, with the result promoted to complex where needed. diff --git a/help/tuple.md b/help/tuple.md index 8f19995d8..a5822d098 100644 --- a/help/tuple.md +++ b/help/tuple.md @@ -4,7 +4,7 @@ # Tuple [tagtuple]: # (Tuple) -Tuples are collection objects that contain a sequence of values each associated with an integer index. Unlike Lists, they can't be changed after creation. +Tuples are collection objects that contain a sequence of values each associated with an integer index. Unlike Lists, they can't be changed after creation, so they form Morpho's immutable sequence type. Create a tuple like this: @@ -35,7 +35,56 @@ Tests if a value is a member of a tuple: ## Join [tagjoin]: # (join) -Join two lists together: +Join two tuples together: var t1 = (1,2,3), t2 = (4, 5, 6) print t1.join(t2) // expect: (1,2,3,4,5,6) + +## Sort +[tagsort]: # (sort) + +Sorts the contents of a tuple into ascending order, returning a new tuple: + + var tuple = (4,3,2,1) + print tuple.sort() // prints (1, 2, 3, 4) + +You can provide your own function to use to compare values in the tuple: + + tuple.sort(fn (a, b) a-b) + +This function should return a negative value if `ab` and `0` if `a` and `b` are equal. + +## Order +[tagorder]: # (order) + +Returns a tuple of indices that would, if used in order, sort a tuple. For example + + var tuple = (2,3,1) + print tuple.order() // prints (2,0,1) + +would produce `(2,0,1)`. + +## Reverse +[tagreverse]: # (reverse) + +Returns a reversed copy of a tuple, leaving the original unchanged: + + var tuple = (1,2,3) + print tuple.reverse() // prints (3,2,1) + +## Roll +[tagroll]: # (roll) + +Returns a copy of a tuple with its contents rolled by a specified number of positions, leaving the original unchanged: + + var tuple = (1,2,3) + print tuple.roll(1) // prints (3,1,2) + print tuple.roll(-1) // prints (2,3,1) + +## tostring +[tagtostring]: # (tostring) + +Converts a tuple to a string: + + var tuple = (1,2,3) + print tuple.tostring() // prints (1, 2, 3) From a50a56c57f3d8ef5b366f402bb7d4b146f9f351f Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 19 Apr 2026 08:41:56 -0400 Subject: [PATCH 345/473] Compile correctly and produce complex eigenvalues --- .gitignore | 2 ++ src/linalg/complexmatrix.c | 12 ++++++++++-- src/linalg/matrix.c | 13 ++++++------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 71583e0c1..c5afddde0 100644 --- a/.gitignore +++ b/.gitignore @@ -76,3 +76,5 @@ build-xcode/* build-win/* *.valgrind /.vs +/dist +/vcpkg_installed diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index d600c86c8..4bf0c2ce2 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -80,7 +80,15 @@ static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec int info, n=a->nrows; #ifdef MORPHO_LINALG_USE_LAPACKE - info=LAPACKE_zgeev(LAPACK_COL_MAJOR, 'N', (vec ? 'V' : 'N'), n, (linalg_complexdouble_t *) a->elements, n, (linalg_complexdouble_t *) w, NULL, n, (linalg_complexdouble_t *) (vec ? vec->elements : NULL), n); + lapack_complex_double dummy; // Win32 lapacke seems to require we never pass null pointers + info = LAPACKE_zgeev( + LAPACK_COL_MAJOR, + 'N', (vec ? 'V' : 'N'), + n, + (lapack_complex_double *) a->elements, n, + (lapack_complex_double *) w, + &dummy, 1, + (vec ? (lapack_complex_double *) vec->elements : &dummy), 1); #else int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; zgeev_("N", (vec ? "V" : "N"), &n, (linalg_complexdouble_t *) a->elements, &n, (linalg_complexdouble_t *) w, NULL, &n, (linalg_complexdouble_t *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); @@ -142,7 +150,7 @@ static linalgError_t _qr(objectmatrix *a, objectmatrix *q, objectmatrix *r) { if (q) { linalg_complexdouble_t *qelems = (linalg_complexdouble_t *) q->elements; memset(q->elements, 0, q->nels*sizeof(double)); - for (int i = 0; i < m; i++) qelems[i*m+i] = 1.0 + 0.0*I; + for (int i = 0; i < m; i++) qelems[i*m+i] = 1.0; } if (minmn==0) { if (r) matrix_copy(a, r); diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 21aff66e5..bb1b30941 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -116,12 +116,11 @@ char matrix_normtolapack(matrix_norm_t norm) { /** Evaluate norms */ static double _normfn(objectmatrix *a, matrix_norm_t nrm) { char cnrm = matrix_normtolapack(nrm); - int nrows=a->nrows, ncols=a->ncols; - #ifdef MORPHO_LINALG_USE_LAPACKE return LAPACKE_dlange(LAPACK_COL_MAJOR, cnrm, a->nrows, a->ncols, a->elements, a->nrows); #else - double work[a->nrows]; + int nrows=a->nrows, ncols=a->ncols; + double work[nrows]; return dlange_(&cnrm, &nrows, &ncols, a->elements, &nrows, work); #endif } @@ -715,13 +714,13 @@ linalgError_t matrix_eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec) /** Prints a matrix */ void matrix_print(vm *v, objectmatrix *m) { - matrixinterfacedefn *interface=matrix_getinterface(m); + matrixinterfacedefn *intrfc=matrix_getinterface(m); double *elptr; for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m morpho_printf(v, "[ "); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k matrix_getelementptr(m, i, j, &elptr); - (*interface->printelfn) (v, elptr); + (*intrfc->printelfn) (v, elptr); morpho_printf(v, " "); } morpho_printf(v, "]%s", (inrows-1 ? "\n" : "")); @@ -730,14 +729,14 @@ void matrix_print(vm *v, objectmatrix *m) { /** Prints a matrix to a buffer */ bool matrix_printtobuffer(objectmatrix *m, char *format, varray_char *out) { - matrixinterfacedefn *interface=matrix_getinterface(m); + matrixinterfacedefn *intrfc=matrix_getinterface(m); double *elptr; for (MatrixIdx_t i=0; inrows; i++) { // Rows run from 0...m varray_charadd(out, "[ ", 2); for (MatrixIdx_t j=0; jncols; j++) { // Columns run from 0...k matrix_getelementptr(m, i, j, &elptr); - if (!(*interface->printeltobufffn) (out, format, elptr)) return false; + if (!(*intrfc->printeltobufffn) (out, format, elptr)) return false; varray_charadd(out, " ", 1); } varray_charadd(out, "]", 1); From 2f91b7ff00ca84a0e432827a5f9c0a793a05ec9d Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 19 Apr 2026 12:39:31 -0400 Subject: [PATCH 346/473] Correct length of right eigenvectors in _eigen --- src/linalg/complexmatrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 4bf0c2ce2..333db897e 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -88,7 +88,7 @@ static linalgError_t _eigen(objectmatrix *a, MorphoComplex *w, objectmatrix *vec (lapack_complex_double *) a->elements, n, (lapack_complex_double *) w, &dummy, 1, - (vec ? (lapack_complex_double *) vec->elements : &dummy), 1); + (vec ? (lapack_complex_double *) vec->elements : &dummy), (vec ? (lapack_int) n : 1)); #else int lwork=4*n; MorphoComplex work[4*n]; double rwork[2*n]; zgeev_("N", (vec ? "V" : "N"), &n, (linalg_complexdouble_t *) a->elements, &n, (linalg_complexdouble_t *) w, NULL, &n, (linalg_complexdouble_t *) (vec ? vec->elements : NULL), &n, work, &lwork, rwork, &info); From 3617f12157a2ae4acd479169a7f865c6d2e097e7 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Sun, 19 Apr 2026 13:34:03 -0400 Subject: [PATCH 347/473] Fix test to avoid direct comparison of floats --- test/linalg/methods/complexmatrix_inverse.morpho | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/linalg/methods/complexmatrix_inverse.morpho b/test/linalg/methods/complexmatrix_inverse.morpho index d6de0b084..b13fc2628 100644 --- a/test/linalg/methods/complexmatrix_inverse.morpho +++ b/test/linalg/methods/complexmatrix_inverse.morpho @@ -6,6 +6,7 @@ A[0,1]=1+im A[1,0]=1-im A[1,1]=0+0im -print A.inverse() -// expect: [ 0 + 0im 0.5 + 0.5im ] -// expect: [ 0.5 - 0.5im 0 + 0im ] +var Ainv = ComplexMatrix([[0, 0.5+0.5im],[0.5-0.5im, 0]]) + +print (A.inverse() - Ainv).norm() < 1e-10 // expect: true + From 7af05cd15d54565ec6594bcb78521aca2c111a1f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 19 Apr 2026 17:42:44 -0400 Subject: [PATCH 348/473] Bind eigenvalues --- src/core/vm.c | 7 ++++++- src/linalg/matrix.c | 2 +- src/morpho.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/vm.c b/src/core/vm.c index 5ba7301d5..5f573a085 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -197,7 +197,7 @@ void vm_bindobjectwithoutcollect(vm *v, value obj) { #endif } -/** @brief Binds an object to a Virtual Machine without triggering garbage collection. +/** @brief Binds an object to a Virtual Machine recursively. * @param v the virtual machine * @param obj object to bind; searches contents through markfn and binds anything that is enclosed */ void vm_bindrecursive(vm *v, value obj) { @@ -295,6 +295,11 @@ void morpho_bindobjects(vm *v, int nobj, value *obj) { } } +/** @brief Binds an object and any children to the virtual machine. */ +void morpho_bindrecursive(vm *v, value obj) { + vm_bindrecursive(v, obj); +} + /** @brief Convenience function to wrap a single object into a value and bind to the VM * @param v VM to use * @param out Object to wrap diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index bb1b30941..f25b3af22 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1310,7 +1310,7 @@ value Matrix_eigenvalues(vm *v, int nargs, value *args) { linalgError_t err=matrix_eigen(a, w, NULL); if (err==LINALGERR_OK) { if (_processeigenvalues(v, n, w, &out)) { - morpho_bindobjects(v, 1, &out); + morpho_bindrecursive(v, out); } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); } else linalg_raiseerror(v, err); diff --git a/src/morpho.h b/src/morpho.h index 5baa80f13..f3c50c75b 100644 --- a/src/morpho.h +++ b/src/morpho.h @@ -116,6 +116,7 @@ void morpho_freevm(vm *v); /* Bind new objects to the virtual machine */ void morpho_bindobjects(vm *v, int nobj, value *obj); +void morpho_bindrecursive(vm *v, value obj); value morpho_wrapandbind(vm *v, object *obj); value morpho_wrapandbindrecursive(vm *v, object *obj); From 4bc83743327a456ac4ef40862cd88c7785c021d9 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 19 Apr 2026 22:53:55 -0400 Subject: [PATCH 349/473] vm_bindrecursive is now recursive --- src/core/vm.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/core/vm.c b/src/core/vm.c index 5f573a085..c57b17fa8 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -201,20 +201,32 @@ void vm_bindobjectwithoutcollect(vm *v, value obj) { * @param v the virtual machine * @param obj object to bind; searches contents through markfn and binds anything that is enclosed */ void vm_bindrecursive(vm *v, value obj) { + if (!MORPHO_ISOBJECT(obj)) return; + object *ob = MORPHO_GETOBJECT(obj); + if (ob->status != OBJECT_ISUNMANAGED) return; // Don't recurse into an already managed object. vmstatus old = v->status; // Preserve status - object *oldobjects = v->objects; // Remember first old bound object - v->status = VM_BIND; - vm_bindobjectwithoutcollect(v, obj); + v->status = VM_BIND; // Enter bind mode - object *ob = MORPHO_GETOBJECT(obj); - objecttypedefn *defn=object_getdefn(ob); - if (defn->markfn) defn->markfn(ob, v); // Call the mark function, which will bind subsequent objects + object *oldobjects = v->objects; // Remember the previous head of the managed list. + object *boundary = oldobjects; // Stop at the previous head of the managed list. + vm_bindobjectwithoutcollect(v, obj); // Bind first object + + do { + object *head = v->objects; + + // Loop over newly added objects, calling their markfn which causes children to be bound. + for (object *current = head; current != boundary; current = current->next) { + current->status = OBJECT_ISMARKED; // Ensure newly added objects are retained at least across this gc run. + objecttypedefn *defn = object_getdefn(current); + if (defn->markfn) defn->markfn(current, v); + } + + boundary = head; + } while (v->objects != boundary); // Did we add any new objects? + v->status=old; // Restore status - - // Ensure objects added are preserved in garbage collection - for (object *obj = v->objects; obj!=NULL && obj!=oldobjects; obj=obj->next) obj->status=OBJECT_ISMARKED; - + vm_checkgc(v); } From b720614ff70fbe71231701c605ddc336d22abcf3 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 20 Apr 2026 16:44:38 -0400 Subject: [PATCH 350/473] New slow source-of-truth resolver --- src/classes/metafunction.c | 103 ++++++++++++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 1 deletion(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 3fc909362..65badfd44 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -867,7 +867,7 @@ bool _finduidinlinearization(objectclass *klass, int uid) { @param[out] err - error block to be filled out @param[out] out - resolved function @returns true if the metafunction was successfully resolved */ -bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { +bool metafunction_xresolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { if (fn->state!=METAFUNCTION_FROZEN) { if (err) morpho_writeerrorwithid(err, METAFUNCTION_UNFROZEN, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); return false; @@ -948,6 +948,107 @@ bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error } while(true); } +/* ********************************************************************** + * Metafunction base-case resolver + * ********************************************************************** */ + +/** Define a possible resolution */ +typedef struct { + value fn; + signature *sig; +} mfresolution; + +/** Checks if a resolution matches a given number of arguments */ +bool mfresolution_checkarity(mfresolution *res, int nargs) { + if (!res->sig) return false; + int nparams = signature_countparams(res->sig); + return (nparams == nargs) || (nargs >= nparams - 1 && signature_isvarg(res->sig)); +} + +/** Checks if a resolution matches a given set of arguments based on types */ +bool mfresolution_checktypes(mfresolution *res, int nargs, value *args) { + if (!res->sig) return false; + + return false; +} + +/** A set of possible resolutions */ +typedef struct { + int count; + mfresolution *data; +} mfresolutionset; + +/** @brief Collapses a set, removing any resolutions that lack a signature */ +void mfresolutionset_collapse(mfresolutionset *set) { + int n=0; + + for (int i=0; icount; i++) { + if (set->data[i].sig) { + set->data[n] = set->data[i]; + n++; + } + } + + set->count=n; +} + +/** @brief Initialize the set of resolutions from the metafunction. */ +void mfresolutionset_init(mfresolutionset *set, mfresolution *res, objectmetafunction *fn) { + set->count = fn->fns.count; + set->data=res; + for (int i=0; icount; i++) { + res[i].fn = fn->fns.data[i]; + res[i].sig = metafunction_getsignature(res[i].fn); + } + mfresolutionset_collapse(set); +} + +/** @brief Filter the resolution set by arity */ +void mfresolutionset_filterbyarity(mfresolutionset *set, int nargs) { + for (int i=0; icount; i++) { + if (!mfresolution_checkarity(&set->data[i], nargs)) set->data[i].sig = NULL; + } + mfresolutionset_collapse(set); +} + +/** @brief Filter the resolution set by types of the arguments */ +void mfresolutionset_filterbytypes(mfresolutionset *set, int nargs, value *args) { + for (int i=0; icount; i++) { + if (!mfresolution_checktypes(&set->data[i], nargs, args)) set->data[i].sig = NULL; + } + mfresolutionset_collapse(set); +} + +/** @brief Find a resolution, if any exists, for given arguments by direct comparison. + @details Slow direct comparison acts as a source of truth for metafunction compiler. + @param[in] fn - the metafunction to resolve + @param[in] nargs - number of positional arguments + @param[in] args - positional arguments @warning: the first user-visible argument should be in the zero position + @param[out] err - error block to be filled out + @param[out] out - resolved function + @returns true if the metafunction was successfully resolved */ +bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { + if (fn->state!=METAFUNCTION_FROZEN) { + if (err) error_writewithid(err, METAFUNCTION_UNFROZEN); return false; + } + + int nres = fn->fns.count; + + mfresolutionset set; // Initial set of resolutions + mfresolution res[nres]; + + mfresolutionset_init(&set, res, fn); + + mfresolutionset_filterbyarity(&set, nargs); + mfresolutionset_filterbytypes(&set, nargs, args); + + switch (set.count) { + case 0: if (err) error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + case 1: if (out) *out = set.data[0].fn; return true; + default: if (err) error_writewithid(err, METAFUNCTION_CMPLAMBGS); return false; + } +} + /* ********************************************************************** * Metafunction veneer class * ********************************************************************** */ From 90b70205b3c1d2d0a1ab947f1bda4070d267b3d9 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 20 Apr 2026 20:56:45 -0400 Subject: [PATCH 351/473] filter by types --- src/classes/metafunction.c | 15 +++++++-------- src/core/compile.c | 17 +---------------- src/core/vm.c | 20 +------------------- src/datastructures/value.c | 27 +++++++++++++++++++++++++++ src/datastructures/value.h | 6 ++++++ 5 files changed, 42 insertions(+), 43 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 65badfd44..7d241756f 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -125,13 +125,7 @@ bool metafunction_add(objectmetafunction *f, value fn) { /** Checks if val matches a given type */ bool metafunction_matchtype(value type, value val) { - value match; - if (!value_type(val, &match)) return false; - - if (MORPHO_ISNIL(type) || // If type is unset, we always match - MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same - - return false; + return value_istype(val, type); } /** Sets the parent class of a metafunction */ @@ -968,8 +962,13 @@ bool mfresolution_checkarity(mfresolution *res, int nargs) { /** Checks if a resolution matches a given set of arguments based on types */ bool mfresolution_checktypes(mfresolution *res, int nargs, value *args) { if (!res->sig) return false; + int nparams = signature_countparams(res->sig); - return false; + for (int i=0; isig->types.data[i])) return false; + } + + return true; } /** A set of possible resolutions */ diff --git a/src/core/compile.c b/src/core/compile.c index a15d16e06..26978b8fe 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -419,24 +419,9 @@ bool compiler_typefromvalue(compiler *c, value v, value *out) { return value_type(v, out); } -/** Recursively searches the parents list of classes to see if the type 'match' is present */ -bool compiler_findtypeinparent(compiler *c, objectclass *type, value match) { - for (int i=0; iparents.count; i++) { - if (MORPHO_ISEQUAL(type->parents.data[i], match) || - compiler_findtypeinparent(c, MORPHO_GETCLASS(type->parents.data[i]), match)) return true; - } - return false; -} - /** Checks if type "match" matches a given type "type" */ bool compiler_checktype(compiler *c, value type, value match) { - if (MORPHO_ISNIL(type) || // If type is unset, we always match - MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same - - // Also match if 'match' inherits from 'type' - if (MORPHO_ISCLASS(match)) return compiler_findtypeinparent(c, MORPHO_GETCLASS(match), type); - - return false; + return value_typematch(type, match); } /** Select the more specific type of two types; returns false if the types are contradictory*/ diff --git a/src/core/vm.c b/src/core/vm.c index c57b17fa8..f501badb6 100644 --- a/src/core/vm.c +++ b/src/core/vm.c @@ -780,31 +780,13 @@ static inline bool vm_invoke(vm *v, value obj, value method, int nargs, value *a return false; } -/** Recursively searches the parents list of classes to see if the type 'match' is present */ -bool _findtypeinparent(objectclass *type, value match) { - for (int i=0; iparents.count; i++) { - if (MORPHO_ISEQUAL(type->parents.data[i], match) || - _findtypeinparent(MORPHO_GETCLASS(type->parents.data[i]), match)) return true; - } - return false; -} - /** Performs a type check operation * @param[in] v - the VM in use * @param[in] val - value to check * @param[in] match - type to match * @returns true on success, false otherwise */ static inline bool vm_typecheck(vm *v, value val, value match) { - value type; - if (!value_type(val, &type)) return false; - - if (MORPHO_ISNIL(type) || // If type is unset, we always match - MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same - - // Also match if 'match' inherits from 'type' - if (MORPHO_ISCLASS(match)) return _findtypeinparent( MORPHO_GETCLASS(match), type); - - return false; + return value_istype(val, match); } /** @brief Executes a sequence of code diff --git a/src/datastructures/value.c b/src/datastructures/value.c index af88eb477..927182120 100644 --- a/src/datastructures/value.c +++ b/src/datastructures/value.c @@ -210,6 +210,33 @@ bool value_type(value v, value *type) { return clss; } +/** Recursively searches the parents list of classes to see if the required type is present */ +static bool value_findtypeinparent(objectclass *type, value match) { + for (int i=0; iparents.count; i++) { + if (MORPHO_ISEQUAL(type->parents.data[i], match) || + value_findtypeinparent(MORPHO_GETCLASS(type->parents.data[i]), match)) return true; + } + return false; +} + +/** Checks if an actual type matches a required type */ +bool value_typematch(value type, value match) { + if (MORPHO_ISNIL(type) || // If type is unset, we always match + MORPHO_ISEQUAL(type, match)) return true; // Or if the types are the same + + // Also match if 'match' inherits from 'type' + if (MORPHO_ISCLASS(match)) return value_findtypeinparent(MORPHO_GETCLASS(match), type); + + return false; +} + +/** Checks if a value matches a required type */ +bool value_istype(value v, value type) { + value match; + if (!value_type(v, &match)) return false; + return value_typematch(type, match); +} + /* ********************************************************************** * Varray_values and utility functions * ********************************************************************** */ diff --git a/src/datastructures/value.h b/src/datastructures/value.h index b466fa312..91f4e2301 100644 --- a/src/datastructures/value.h +++ b/src/datastructures/value.h @@ -250,6 +250,12 @@ bool morpho_valuetofloat(value v, double *out); /** Get the type associated with a value */ bool value_type(value v, value *type); +/** Check whether an actual type matches a required type */ +bool value_typematch(value type, value match); + +/** Check whether a value matches a required type */ +bool value_istype(value v, value type); + /* ------------------------------------------------------- * Varrays of values * ------------------------------------------------------- */ From eec851193c208db3087f50ee5b666cd4fdb83240 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 21 Apr 2026 08:02:41 -0400 Subject: [PATCH 352/473] Resolve using specificity --- src/classes/clss.c | 27 ++++++++++++ src/classes/clss.h | 1 + src/classes/metafunction.c | 88 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 116 insertions(+) diff --git a/src/classes/clss.c b/src/classes/clss.c index 1eeea8437..c43e0d2da 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -167,6 +167,33 @@ bool class_linearize(objectclass *klass) { return _linearize(klass, &klass->linearization); } +/** Finds the position of a class within another class's linearization. */ +static bool _findinlinearization(objectclass *klass, objectclass *target, int *out) { + for (int i=0; ilinearization.count; i++) { + if (MORPHO_GETCLASS(klass->linearization.data[i])==target) { *out=i; return true; } + } + + return false; +} + +/** @brief Compare the distance between two classes. + * @param[in] a - + * @param[in] b - Classes to compare. + * @param[out] out - signed distance between the two classes; Negative means a is more specific; positive means b is + * more specific. + * @returns true if one class appears in the other's linearization. */ +bool class_comparedistance(objectclass *a, objectclass *b, int *out) { + if (!a || !b || !out) return false; + if (a==b) { + *out=0; return true; + } else if (_findinlinearization(a, b, out)) { + *out *= -1; return true; + } else if (_findinlinearization(b, a, out)) { + return true; + } + return false; +} + /* ********************************************************************** * Class veneer class * ********************************************************************** */ diff --git a/src/classes/clss.h b/src/classes/clss.h index 2d61f2715..df943c84e 100644 --- a/src/classes/clss.h +++ b/src/classes/clss.h @@ -54,6 +54,7 @@ objectclass *object_newclass(value name); objectclass *morpho_lookupclass(value obj); bool class_linearize(objectclass *klass); +bool class_comparedistance(objectclass *a, objectclass *b, int *out); void class_initialize(void); diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 7d241756f..e0fec3df1 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -5,6 +5,7 @@ */ #include +#include #include "morpho.h" #include "classes.h" @@ -971,6 +972,78 @@ bool mfresolution_checktypes(mfresolution *res, int nargs, value *args) { return true; } +/** Rank a parameter type by its distance from an actual argument type. */ +static bool mfresolution_rankparamtype(value actual, value type, int *out) { + if (MORPHO_ISEQUAL(actual, type)) { *out=0; return true; } + if (MORPHO_ISNIL(type)) { *out=INT_MAX; return true; } // Ensures a wildcare loses to an actual type + + if (MORPHO_ISCLASS(actual) && MORPHO_ISCLASS(type)) { + if (class_comparedistance(MORPHO_GETCLASS(actual), MORPHO_GETCLASS(type), out)) { + *out = abs(*out); return true; + } + } + + return false; +} + +/** Compare the specificity of two parameter types relative to an actual argument type. + * @returns true if the types are comparable, setting out to the signed comparison. */ +static bool mfresolution_compareparamtypes(value actual, value a, value b, int *out) { + int arank, brank; + if (mfresolution_rankparamtype(actual, a, &arank) && + mfresolution_rankparamtype(actual, b, &brank)) { + *out = arank-brank; + return true; + } + return false; +} + +/** Compare resolutions by whether they are variadic. Non-variadic resolutions are more specific. */ +static int mfresolution_comparevarg(mfresolution *a, mfresolution *b) { + bool avarg = signature_isvarg(a->sig); + bool bvarg = signature_isvarg(b->sig); + if (avarg==bvarg) return 0; + return (avarg ? 1 : -1); +} + +/** Determine how many parameters should be checked when comparing resolutions. */ +static int _min(int a, int b, int c) { + return (a < b) ? ((a < c) ? a : c) : ((b < c) ? b : c); +} + +/** Returns the sign of an integer. */ +static int _sign(int x) { + return (x>0) - (x<0); +} + +/** Compare the specificity of two resolutions. + * Returns <0 if a is more specific, >0 if b is more specific, 0 if they are equal + * or incomparable. */ +static int mfresolution_comparespecificity(mfresolution *a, mfresolution *b, int nargs, value *args) { + if (!a->sig || !b->sig) return 0; + + int ncheck=_min(signature_countparams(a->sig), signature_countparams(b->sig), nargs); + int cmp[ncheck]; + for (int i=0; isig->types.data[i], b->sig->types.data[i], &cmp[i]); + } + } + + int firstsign = 0; + for (int i=0; icount; i++) { // Compare all possible pairs and remove resolutions dominated by at least one other candidate + if (!set->data[i].sig) continue; + for (int j=i+1; jcount; j++) { + if (!set->data[j].sig) continue; + int cmp = mfresolution_comparespecificity(&set->data[i], &set->data[j], nargs, args); + if (cmp < 0) set->data[j].sig = NULL; + else if (cmp > 0) { set->data[i].sig = NULL; break; } + } + } + mfresolutionset_collapse(set); +} + /** @brief Find a resolution, if any exists, for given arguments by direct comparison. @details Slow direct comparison acts as a source of truth for metafunction compiler. @param[in] fn - the metafunction to resolve @@ -1040,6 +1127,7 @@ bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error mfresolutionset_filterbyarity(&set, nargs); mfresolutionset_filterbytypes(&set, nargs, args); + mfresolutionset_filterbyspecificity(&set, nargs, args); switch (set.count) { case 0: if (err) error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; From 06a1216d18c737021e9823c95087c95ed27248c0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 21 Apr 2026 23:45:00 -0400 Subject: [PATCH 353/473] New resolver passes test suite --- src/core/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/compile.c b/src/core/compile.c index 26978b8fe..811264283 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3497,8 +3497,9 @@ static codeinfo compiler_function(compiler *c, syntaxtreenode *node, registerind /* -- Compile the parameters -- */ compiler_functionparameters(c, node->left); - value signature[func->nargs+1]; + value signature[function_countpositionalargs(func)]; for (int i=0; inargs; i++) compiler_regtype(c, i+1, &signature[i]); + if (function_hasvargs(func)) signature[func->nargs]=MORPHO_NIL; function_setsignature(func, signature); signature_setvarg(&func->sig, function_hasvargs(func)); From a5a6f6071ace49ce83be5fabd37b51755a64e76b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 22 Apr 2026 00:01:03 -0400 Subject: [PATCH 354/473] Additional multiple dispatch tests --- .../diamond_linearization.morpho | 26 ++++++++++++++ .../inheritance_linearization_order.morpho | 24 +++++++++++++ .../multiple_inheritance_wildcard.morpho | 28 +++++++++++++++ .../specificity_ambiguity.morpho | 17 ++++++++++ .../multiple_dispatch/varg_specificity.morpho | 26 ++++++++++++++ .../wildcard_dominance.morpho | 29 ++++++++++++++++ .../wildcard_multiple_args.morpho | 34 +++++++++++++++++++ 7 files changed, 184 insertions(+) create mode 100644 test/types/multiple_dispatch/diamond_linearization.morpho create mode 100644 test/types/multiple_dispatch/inheritance_linearization_order.morpho create mode 100644 test/types/multiple_dispatch/multiple_inheritance_wildcard.morpho create mode 100644 test/types/multiple_dispatch/specificity_ambiguity.morpho create mode 100644 test/types/multiple_dispatch/varg_specificity.morpho create mode 100644 test/types/multiple_dispatch/wildcard_dominance.morpho create mode 100644 test/types/multiple_dispatch/wildcard_multiple_args.morpho diff --git a/test/types/multiple_dispatch/diamond_linearization.morpho b/test/types/multiple_dispatch/diamond_linearization.morpho new file mode 100644 index 000000000..dde99a13c --- /dev/null +++ b/test/types/multiple_dispatch/diamond_linearization.morpho @@ -0,0 +1,26 @@ +// Diamond inheritance linearization in dispatch + +class A {} + +class B is A {} + +class C is A {} + +class D is B with C {} + +class E is C with B {} + +fn f(B x) { + return "B" +} + +fn f(C x) { + return "C" +} + +print f(D()) +// expect: B + +print f(E()) +// expect: C + diff --git a/test/types/multiple_dispatch/inheritance_linearization_order.morpho b/test/types/multiple_dispatch/inheritance_linearization_order.morpho new file mode 100644 index 000000000..9431508fb --- /dev/null +++ b/test/types/multiple_dispatch/inheritance_linearization_order.morpho @@ -0,0 +1,24 @@ +// Multiple inheritance linearization order in dispatch + +class A {} + +class D {} + +class E is A with D {} + +class F is D with A {} + +fn f(A x) { + return "A" +} + +fn f(D x) { + return "D" +} + +print f(E()) +// expect: A + +print f(F()) +// expect: D + diff --git a/test/types/multiple_dispatch/multiple_inheritance_wildcard.morpho b/test/types/multiple_dispatch/multiple_inheritance_wildcard.morpho new file mode 100644 index 000000000..53142b741 --- /dev/null +++ b/test/types/multiple_dispatch/multiple_inheritance_wildcard.morpho @@ -0,0 +1,28 @@ +// Multiple inheritance specificity beats wildcard fallback + +class A {} + +class D {} + +class E is A with D {} + +class F {} + +fn f(x) { + return "_" +} + +fn f(A x) { + return "A" +} + +fn f(D x) { + return "D" +} + +print f(E()) +// expect: A + +print f(F()) +// expect: _ + diff --git a/test/types/multiple_dispatch/specificity_ambiguity.morpho b/test/types/multiple_dispatch/specificity_ambiguity.morpho new file mode 100644 index 000000000..dea7a3771 --- /dev/null +++ b/test/types/multiple_dispatch/specificity_ambiguity.morpho @@ -0,0 +1,17 @@ +// Specificity ambiguity across multiple parameters + +class A {} + +class B is A {} + +fn f(A x, B y) { + return "AB" +} + +fn f(B x, A y) { + return "BA" +} + +print f(B(), B()) +// expect error 'MltplDisptchAmbg' + diff --git a/test/types/multiple_dispatch/varg_specificity.morpho b/test/types/multiple_dispatch/varg_specificity.morpho new file mode 100644 index 000000000..225bb1d73 --- /dev/null +++ b/test/types/multiple_dispatch/varg_specificity.morpho @@ -0,0 +1,26 @@ +// Variadic dispatch specificity + +fn f(Int x) { + return "Int" +} + +fn f(Int x, ...rest) { + return "Int..." +} + +fn f(...rest) { + return "..." +} + +print f() +// expect: ... + +print f(1) +// expect: Int + +print f(1, "x") +// expect: Int... + +print f("x") +// expect: ... + diff --git a/test/types/multiple_dispatch/wildcard_dominance.morpho b/test/types/multiple_dispatch/wildcard_dominance.morpho new file mode 100644 index 000000000..66300b7cb --- /dev/null +++ b/test/types/multiple_dispatch/wildcard_dominance.morpho @@ -0,0 +1,29 @@ +// Typed overloads dominate untyped wildcard overloads + +class A {} + +class B is A {} + +class C {} + +fn f(x) { + return "_" +} + +fn f(A x) { + return "A" +} + +fn f(B x) { + return "B" +} + +print f(A()) +// expect: A + +print f(B()) +// expect: B + +print f(C()) +// expect: _ + diff --git a/test/types/multiple_dispatch/wildcard_multiple_args.morpho b/test/types/multiple_dispatch/wildcard_multiple_args.morpho new file mode 100644 index 000000000..76c886599 --- /dev/null +++ b/test/types/multiple_dispatch/wildcard_multiple_args.morpho @@ -0,0 +1,34 @@ +// Wildcard dominance across multiple arguments + +class A {} + +class B {} + +fn f(x, y) { + return "__" +} + +fn f(A x, y) { + return "A_" +} + +fn f(x, A y) { + return "_A" +} + +fn f(A x, A y) { + return "AA" +} + +print f(A(), A()) +// expect: AA + +print f(A(), B()) +// expect: A_ + +print f(B(), A()) +// expect: _A + +print f(B(), B()) +// expect: __ + From 7e5cf057cce8126dd9dfae50fd26f4e098afcdba Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 22 Apr 2026 18:36:45 -0400 Subject: [PATCH 355/473] Disable old resolver --- src/classes/metafunction.c | 1475 ++++++++++++++++++------------------ 1 file changed, 754 insertions(+), 721 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index e0fec3df1..ecf41c5ba 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -195,647 +195,776 @@ value _getname(value fn) { * Fast metafunction resolver * ********************************************************************** */ -DEFINE_VARRAY(mfinstruction, mfinstruction); - -#define MFINSTRUCTION_EMPTY -1 - -#define MFINSTRUCTION_FAIL { .opcode=MF_FAIL, .branch=MFINSTRUCTION_EMPTY } -#define MFINSTRUCTION_RESOLVE(fn) { .opcode=MF_RESOLVE, .data.resolvefn=fn, .branch=MFINSTRUCTION_EMPTY } -#define MFINSTRUCTION_OPTARGS { .opcode=MF_OPTARGS, .branch=MFINSTRUCTION_EMPTY } -#define MFINSTRUCTION_CHECKNARGS(op, n, brnch) { .opcode=op, .narg=n, .branch=brnch } -#define MFINSTRUCTION_CHECKTYPE(op, n, t, brnch) { .opcode=op, .data.tindx=t, .narg=n, .branch=brnch } -#define MFINSTRUCTION_BRANCH(brnch) { .opcode=MF_BRANCH, .branch=brnch } -#define MFINSTRUCTION_BRANCHNARG(table, brnch) { .opcode=MF_BRANCHNARGS, .data.btable=table, .branch=brnch } -#define MFINSTRUCTION_BRANCHTABLE(op, n, table, brnch) { .opcode=op, .narg=n, .data.btable=table, .branch=brnch } - -typedef struct { - signature *sig; /** Signature of the target */ - value fn; /** The target */ - int indx; /** Used to sort */ -} mfresult; - -typedef struct { - int count; - mfresult *rlist; -} mfset; - -/** Static intiializer for the mfset */ -#define MFSET(c, l) { .count=c, .rlist=l } - -DECLARE_VARRAY(mfset, mfset) -DEFINE_VARRAY(mfset, mfset) - -typedef struct { - objectmetafunction *fn; - varray_int checked; // Stack of checked parameters - bool varchecked; // Have we checked for a variadic function? - error err; -} mfcompiler; - -/** Initialize the metafunction compiler */ -void mfcompiler_init(mfcompiler *c, objectmetafunction *fn) { - c->fn=fn; - varray_intinit(&c->checked); - error_init(&c->err); - c->varchecked=false; -} - -/** Clear the metafunction compiler */ -void mfcompiler_clear(mfcompiler *c, objectmetafunction *fn) { - varray_intclear(&c->checked); - error_clear(&c->err); -} - -/** Report an error during metafunction compilation */ -void mfcompiler_error(mfcompiler *c, errorid id) { - morpho_writeerrorwithid(&c->err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); -} - -/** Pushes a parameter check onto the stack*/ -void mfcompiler_pushcheck(mfcompiler *c, int i) { - varray_intwrite(&c->checked, i); -} - -/** Pops a parameter check from the stack*/ -int mfcompiler_popcheck(mfcompiler *c) { - c->checked.count--; - return c->checked.data[c->checked.count]; -} - -/** Tests if a parameter has been checked according to the check stack */ -bool mfcompiler_ischecked(mfcompiler *c, int i) { - for (int j=0; jchecked.count; j++) if (i==c->checked.data[j]) return true; - return false; -} - -void _mfcompiler_disassemblebranchtable(mfinstruction *instr, mfindx i) { - for (int k=0; kdata.btable.count; k++) { - printf(" %i -> %i\n", k, i+instr->data.btable.data[k]+1); - } -} - -/** Disassemble */ -void mfcompiler_disassemble(mfcompiler *c) { - int ninstr = c->fn->resolver.count; - morpho_printvalue(NULL, MORPHO_OBJECT(c->fn)); - printf(":\n"); - for (int i=0; ifn->resolver.data[i]; - printf("%5i : ", i) ; - switch(instr->opcode) { - case MF_CHECKNARGSNEQ: { - printf("checknargsneq %i -> (%i)", instr->narg, i+instr->branch+1); - break; - } - case MF_CHECKNARGSLT: { - printf("checknargslt %i -> (%i)", instr->narg, i+instr->branch+1); - break; - } - case MF_CHECKVALUE: { - objectclass *klass=value_veneerclassfromtype(instr->data.tindx); - printf("checkvalue (%i) [%s] -> (%i)", instr->narg, MORPHO_GETCSTRING(klass->name), i+instr->branch+1); - break; - } - case MF_CHECKOBJECT: { - objectclass *klass=object_getveneerclass(instr->data.tindx); - printf("checkobject (%i) [%s] -> (%i)", instr->narg, MORPHO_GETCSTRING(klass->name), i+instr->branch+1); - break; - } - case MF_CHECKINSTANCE: { - printf("checkinstance (%i) [%i] -> (%i)", instr->narg, instr->data.tindx, i+instr->branch+1); - break; - } - case MF_BRANCH: { - printf("branch -> (%i)", i+instr->branch+1); - break; - } - case MF_BRANCHNARGS: { - printf("branchnargs (%i) -> (%i)\n", instr->narg, i+instr->branch+1); - _mfcompiler_disassemblebranchtable(instr, i); - break; - } - case MF_BRANCHVALUETYPE: { - printf("branchvalue (%i) -> (%i)\n", instr->narg, i+instr->branch+1); - for (int k=0; kdata.btable.count; k++) { - if (instr->data.btable.data[k]==0) continue; - objectclass *klass=value_veneerclassfromtype(k); - printf(" %i [%s] -> %i\n", k, (klass ? MORPHO_GETCSTRING(klass->name) : ""), i+instr->data.btable.data[k]+1); - } - break; - } - case MF_BRANCHOBJECTTYPE: { - printf("branchobjtype (%i) -> (%i)\n", instr->narg, i+instr->branch+1); - for (int k=0; kdata.btable.count; k++) { - if (instr->data.btable.data[k]==0) continue; - objectclass *klass=object_getveneerclass(k); - printf(" %i [%s] -> %i\n", k, (klass ? MORPHO_GETCSTRING(klass->name) : ""), i+instr->data.btable.data[k]+1); - } - break; - } - case MF_BRANCHINSTANCE: { - printf("branchinstance (%i) -> (%i)\n", instr->narg, i+instr->branch+1); - _mfcompiler_disassemblebranchtable(instr, i); - break; - } - case MF_RESOLVE: { - printf("resolve "); - signature *sig = metafunction_getsignature(instr->data.resolvefn); - printf(" "); - if (sig) signature_print(sig); - break; - } - case MF_FAIL: printf("fail"); break; - } - printf("\n"); - } -} - -/** Counts the range of parameters for the function call */ -void mfcompile_countparams(mfcompiler *c, mfset *set, int *min, int *max) { - int imin=INT_MAX, imax=INT_MIN; - for (int i=0; icount; i++) { - int nparams; - signature_paramlist(set->rlist[i].sig, &nparams, NULL); - if (nparamsimax) imax=nparams; - } - if (min) *min = imin; - if (max) *max = imax; -} - -/** Check if a set contains a variadic */ -bool mfcompile_containsvariadic(mfcompiler *c, mfset *set) { - for (int i=0; icount; i++) { - if (signature_isvarg(set->rlist[i].sig)) return true; - } - return false; -} - -/** Places the various outcomes for a parameter into a dictionary */ -bool mfcompile_outcomes(mfcompiler *c, mfset *set, int i, dictionary *out) { - for (int k=0; kcount; k++) { // Loop over outcomes - value type; - if (!signature_getparamtype(set->rlist[k].sig, i, &type)) continue; - if (!dictionary_insert(out, (MORPHO_ISNIL(type) ? MORPHO_FALSE : type), MORPHO_NIL)) return false; - } - return true; -} - -/** Find the parameter number that has most variety in types */ -bool mfcompile_countoutcomes(mfcompiler *c, mfset *set, int *best) { - varray_int count; - varray_intinit(&count); - - dictionary dict; - dictionary_init(&dict); - - // Loop over parameters, counting the number of outcomes. - while (true) { - mfcompile_outcomes(c, set, count.count, &dict); - if (!dict.count) break; - varray_intwrite(&count, dict.count); - dictionary_clear(&dict); // Not needed if dict.count was zero - }; - - // Find the parameter that has most variability that has not already been checked - int max=0, maxindx=-1; - for (int i=0; imax) { max=count.data[i]; maxindx=i; } - } - - varray_intclear(&count); - - if (maxindx<0) return false; - if (best) *best = maxindx; - - return true; -} - -mfindx mfcompile_insertinstruction(mfcompiler *c, mfinstruction instr) { - return varray_mfinstructionwrite(&c->fn->resolver, instr); -} - -mfindx mfcompile_currentinstruction(mfcompiler *c) { - return c->fn->resolver.count-1; -} - -mfindx mfcompile_nextinstruction(mfcompiler *c) { - return c->fn->resolver.count; -} - -void mfcompile_setbranch(mfcompiler *c, mfindx i, mfindx branch) { - if (i>=c->fn->resolver.count) return; - c->fn->resolver.data[i].branch=branch; -} - -void mfcompile_replaceinstruction(mfcompiler *c, mfindx i, mfinstruction instr) { - if (i>=c->fn->resolver.count) return; - c->fn->resolver.data[i] = instr; -} - -enum { - MF_VENEERVALUE, - MF_INSTANCE, - MF_VENEEROBJECT, - MF_ANY -}; - -/** Detects the kind of type */ -int _detecttype(value type, int *tindx) { - if (MORPHO_ISCLASS(type)) { - objectclass *klass = MORPHO_GETCLASS(type); - if (object_veneerclasstotype(klass, tindx)) { - return MF_VENEEROBJECT; - } else if (value_veneerclasstotype(klass, tindx)) { - return MF_VENEERVALUE; - } else { - if (tindx) *tindx=klass->uid; - return MF_INSTANCE; - } - } - return MF_ANY; -} - -mfindx mfcompile_fail(mfcompiler *c); -mfindx mfcompile_resolve(mfcompiler *c, mfresult *res); -mfindx mfcompile_dispatchonparam(mfcompiler *c, mfset *set, int i); -mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max); -mfindx mfcompile_set(mfcompiler *c, mfset *set); - -/** Inserts a fail instruction */ -mfindx mfcompile_fail(mfcompiler *c) { - mfinstruction fail = MFINSTRUCTION_FAIL; - return mfcompile_insertinstruction(c, fail); -} - -/** Checks a parameter i for type */ -mfindx mfcompile_check(mfcompiler *c, int i, value type) { - int tindx; - int opcode[MF_ANY] = { MF_CHECKVALUE, MF_CHECKINSTANCE, MF_CHECKOBJECT }; - int k=_detecttype(type, &tindx); - - if (k==MF_ANY) return MFINSTRUCTION_EMPTY; - - mfinstruction check = MFINSTRUCTION_CHECKTYPE(opcode[k], i, tindx, 0); - return mfcompile_insertinstruction(c, check); -} - -/** Compiles a single result */ -mfindx mfcompile_resolve(mfcompiler *c, mfresult *res) { - mfindx start = mfcompile_nextinstruction(c); - - // Check all arguments have been resolved - signature *sig = res->sig; - for (int i=0; itypes.count; i++) { - if (MORPHO_ISNIL(sig->types.data[i]) || - mfcompiler_ischecked(c, i)) continue; - - mfcompile_check(c, i, sig->types.data[i]); - } - - mfindx end = mfcompile_nextinstruction(c); - - mfinstruction instr = MFINSTRUCTION_RESOLVE(res->fn); - mfcompile_insertinstruction(c, instr); - - if (start!=end) { - mfindx fail = mfcompile_fail(c); - for (mfindx i=start; icount && set->rlist[k].indx<0) k++; - - // Deal with each outcome - while (kcount) { - int indx=set->rlist[k].indx, n=0; - while (k+ncount && set->rlist[k+n].indx==indx) n++; - - mfset out = MFSET(n, &set->rlist[k]); - - // Set the branch point - btable->data[indx]=mfcompile_currentinstruction(c)-bindx; - mfcompile_set(c, &out); - - k+=n; - } -} - -void _insertchildren(dictionary *dict, value v) { - if (!MORPHO_ISCLASS(v) || - dictionary_get(dict, v, NULL)) return; - - dictionary_insert(dict, v, MORPHO_NIL); // Insert the class - objectclass *klass = MORPHO_GETCLASS(v); // and its children - for (int i=0; ichildren.count; i++) _insertchildren(dict, klass->children.data[i]); -} - -bool _resolve(objectclass *klass, dictionary *types, value *out) { - for (int k=0; klinearization.count; k++) { - if (dictionary_get(types, klass->linearization.data[k], NULL)) { - *out = klass->linearization.data[k]; - return true; - } - } - return false; -} - -int _maxindx(dictionary *dict) { - int indx=0, maxindx=0; - for (int i=0; icapacity; i++) { - _detecttype(dict->contents[i].key, &indx); - if (indx>maxindx) maxindx=indx; - } - return maxindx; -} +// DEFINE_VARRAY(mfinstruction, mfinstruction); +// +// #define MFINSTRUCTION_EMPTY -1 +// +// #define MFINSTRUCTION_FAIL { .opcode=MF_FAIL, .branch=MFINSTRUCTION_EMPTY } +// #define MFINSTRUCTION_RESOLVE(fn) { .opcode=MF_RESOLVE, .data.resolvefn=fn, .branch=MFINSTRUCTION_EMPTY } +// #define MFINSTRUCTION_OPTARGS { .opcode=MF_OPTARGS, .branch=MFINSTRUCTION_EMPTY } +// #define MFINSTRUCTION_CHECKNARGS(op, n, brnch) { .opcode=op, .narg=n, .branch=brnch } +// #define MFINSTRUCTION_CHECKTYPE(op, n, t, brnch) { .opcode=op, .data.tindx=t, .narg=n, .branch=brnch } +// #define MFINSTRUCTION_BRANCH(brnch) { .opcode=MF_BRANCH, .branch=brnch } +// #define MFINSTRUCTION_BRANCHNARG(table, brnch) { .opcode=MF_BRANCHNARGS, .data.btable=table, .branch=brnch } +// #define MFINSTRUCTION_BRANCHTABLE(op, n, table, brnch) { .opcode=op, .narg=n, .data.btable=table, .branch=brnch } +// +// typedef struct { +// signature *sig; /** Signature of the target */ +// value fn; /** The target */ +// int indx; /** Used to sort */ +// } mfresult; +// +// typedef struct { +// int count; +// mfresult *rlist; +// } mfset; +// +// /** Static intiializer for the mfset */ +// #define MFSET(c, l) { .count=c, .rlist=l } +// +// DECLARE_VARRAY(mfset, mfset) +// DEFINE_VARRAY(mfset, mfset) +// +// typedef struct { +// objectmetafunction *fn; +// varray_int checked; // Stack of checked parameters +// bool varchecked; // Have we checked for a variadic function? +// error err; +// } mfcompiler; +// +// /** Initialize the metafunction compiler */ +// void mfcompiler_init(mfcompiler *c, objectmetafunction *fn) { +// c->fn=fn; +// varray_intinit(&c->checked); +// error_init(&c->err); +// c->varchecked=false; +// } +// +// /** Clear the metafunction compiler */ +// void mfcompiler_clear(mfcompiler *c, objectmetafunction *fn) { +// varray_intclear(&c->checked); +// error_clear(&c->err); +// } +// +// /** Report an error during metafunction compilation */ +// void mfcompiler_error(mfcompiler *c, errorid id) { +// morpho_writeerrorwithid(&c->err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); +// } +// +// /** Pushes a parameter check onto the stack*/ +// void mfcompiler_pushcheck(mfcompiler *c, int i) { +// varray_intwrite(&c->checked, i); +// } +// +// /** Pops a parameter check from the stack*/ +// int mfcompiler_popcheck(mfcompiler *c) { +// c->checked.count--; +// return c->checked.data[c->checked.count]; +// } +// +// /** Tests if a parameter has been checked according to the check stack */ +// bool mfcompiler_ischecked(mfcompiler *c, int i) { +// for (int j=0; jchecked.count; j++) if (i==c->checked.data[j]) return true; +// return false; +// } +// +// void _mfcompiler_disassemblebranchtable(mfinstruction *instr, mfindx i) { +// for (int k=0; kdata.btable.count; k++) { +// printf(" %i -> %i\n", k, i+instr->data.btable.data[k]+1); +// } +// } +// +// /** Disassemble */ +// void mfcompiler_disassemble(mfcompiler *c) { +// int ninstr = c->fn->resolver.count; +// morpho_printvalue(NULL, MORPHO_OBJECT(c->fn)); +// printf(":\n"); +// for (int i=0; ifn->resolver.data[i]; +// printf("%5i : ", i) ; +// switch(instr->opcode) { +// case MF_CHECKNARGSNEQ: { +// printf("checknargsneq %i -> (%i)", instr->narg, i+instr->branch+1); +// break; +// } +// case MF_CHECKNARGSLT: { +// printf("checknargslt %i -> (%i)", instr->narg, i+instr->branch+1); +// break; +// } +// case MF_CHECKVALUE: { +// objectclass *klass=value_veneerclassfromtype(instr->data.tindx); +// printf("checkvalue (%i) [%s] -> (%i)", instr->narg, MORPHO_GETCSTRING(klass->name), i+instr->branch+1); +// break; +// } +// case MF_CHECKOBJECT: { +// objectclass *klass=object_getveneerclass(instr->data.tindx); +// printf("checkobject (%i) [%s] -> (%i)", instr->narg, MORPHO_GETCSTRING(klass->name), i+instr->branch+1); +// break; +// } +// case MF_CHECKINSTANCE: { +// printf("checkinstance (%i) [%i] -> (%i)", instr->narg, instr->data.tindx, i+instr->branch+1); +// break; +// } +// case MF_BRANCH: { +// printf("branch -> (%i)", i+instr->branch+1); +// break; +// } +// case MF_BRANCHNARGS: { +// printf("branchnargs (%i) -> (%i)\n", instr->narg, i+instr->branch+1); +// _mfcompiler_disassemblebranchtable(instr, i); +// break; +// } +// case MF_BRANCHVALUETYPE: { +// printf("branchvalue (%i) -> (%i)\n", instr->narg, i+instr->branch+1); +// for (int k=0; kdata.btable.count; k++) { +// if (instr->data.btable.data[k]==0) continue; +// objectclass *klass=value_veneerclassfromtype(k); +// printf(" %i [%s] -> %i\n", k, (klass ? MORPHO_GETCSTRING(klass->name) : ""), i+instr->data.btable.data[k]+1); +// } +// break; +// } +// case MF_BRANCHOBJECTTYPE: { +// printf("branchobjtype (%i) -> (%i)\n", instr->narg, i+instr->branch+1); +// for (int k=0; kdata.btable.count; k++) { +// if (instr->data.btable.data[k]==0) continue; +// objectclass *klass=object_getveneerclass(k); +// printf(" %i [%s] -> %i\n", k, (klass ? MORPHO_GETCSTRING(klass->name) : ""), i+instr->data.btable.data[k]+1); +// } +// break; +// } +// case MF_BRANCHINSTANCE: { +// printf("branchinstance (%i) -> (%i)\n", instr->narg, i+instr->branch+1); +// _mfcompiler_disassemblebranchtable(instr, i); +// break; +// } +// case MF_RESOLVE: { +// printf("resolve "); +// signature *sig = metafunction_getsignature(instr->data.resolvefn); +// printf(" "); +// if (sig) signature_print(sig); +// break; +// } +// case MF_FAIL: printf("fail"); break; +// } +// printf("\n"); +// } +// } +// +// /** Counts the range of parameters for the function call */ +// void mfcompile_countparams(mfcompiler *c, mfset *set, int *min, int *max) { +// int imin=INT_MAX, imax=INT_MIN; +// for (int i=0; icount; i++) { +// int nparams; +// signature_paramlist(set->rlist[i].sig, &nparams, NULL); +// if (nparamsimax) imax=nparams; +// } +// if (min) *min = imin; +// if (max) *max = imax; +// } +// +// /** Check if a set contains a variadic */ +// bool mfcompile_containsvariadic(mfcompiler *c, mfset *set) { +// for (int i=0; icount; i++) { +// if (signature_isvarg(set->rlist[i].sig)) return true; +// } +// return false; +// } +// +// /** Places the various outcomes for a parameter into a dictionary */ +// bool mfcompile_outcomes(mfcompiler *c, mfset *set, int i, dictionary *out) { +// for (int k=0; kcount; k++) { // Loop over outcomes +// value type; +// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) continue; +// if (!dictionary_insert(out, (MORPHO_ISNIL(type) ? MORPHO_FALSE : type), MORPHO_NIL)) return false; +// } +// return true; +// } +// +// /** Find the parameter number that has most variety in types */ +// bool mfcompile_countoutcomes(mfcompiler *c, mfset *set, int *best) { +// varray_int count; +// varray_intinit(&count); +// +// dictionary dict; +// dictionary_init(&dict); +// +// // Loop over parameters, counting the number of outcomes. +// while (true) { +// mfcompile_outcomes(c, set, count.count, &dict); +// if (!dict.count) break; +// varray_intwrite(&count, dict.count); +// dictionary_clear(&dict); // Not needed if dict.count was zero +// }; +// +// // Find the parameter that has most variability that has not already been checked +// int max=0, maxindx=-1; +// for (int i=0; imax) { max=count.data[i]; maxindx=i; } +// } +// +// varray_intclear(&count); +// +// if (maxindx<0) return false; +// if (best) *best = maxindx; +// +// return true; +// } +// +// mfindx mfcompile_insertinstruction(mfcompiler *c, mfinstruction instr) { +// return varray_mfinstructionwrite(&c->fn->resolver, instr); +// } +// +// mfindx mfcompile_currentinstruction(mfcompiler *c) { +// return c->fn->resolver.count-1; +// } +// +// mfindx mfcompile_nextinstruction(mfcompiler *c) { +// return c->fn->resolver.count; +// } +// +// void mfcompile_setbranch(mfcompiler *c, mfindx i, mfindx branch) { +// if (i>=c->fn->resolver.count) return; +// c->fn->resolver.data[i].branch=branch; +// } +// +// void mfcompile_replaceinstruction(mfcompiler *c, mfindx i, mfinstruction instr) { +// if (i>=c->fn->resolver.count) return; +// c->fn->resolver.data[i] = instr; +// } +// +// enum { +// MF_VENEERVALUE, +// MF_INSTANCE, +// MF_VENEEROBJECT, +// MF_ANY +// }; +// +// /** Detects the kind of type */ +// int _detecttype(value type, int *tindx) { +// if (MORPHO_ISCLASS(type)) { +// objectclass *klass = MORPHO_GETCLASS(type); +// if (object_veneerclasstotype(klass, tindx)) { +// return MF_VENEEROBJECT; +// } else if (value_veneerclasstotype(klass, tindx)) { +// return MF_VENEERVALUE; +// } else { +// if (tindx) *tindx=klass->uid; +// return MF_INSTANCE; +// } +// } +// return MF_ANY; +// } +// +// mfindx mfcompile_fail(mfcompiler *c); +// mfindx mfcompile_resolve(mfcompiler *c, mfresult *res); +// mfindx mfcompile_dispatchonparam(mfcompiler *c, mfset *set, int i); +// mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max); +// mfindx mfcompile_set(mfcompiler *c, mfset *set); +// +// /** Inserts a fail instruction */ +// mfindx mfcompile_fail(mfcompiler *c) { +// mfinstruction fail = MFINSTRUCTION_FAIL; +// return mfcompile_insertinstruction(c, fail); +// } +// +// /** Checks a parameter i for type */ +// mfindx mfcompile_check(mfcompiler *c, int i, value type) { +// int tindx; +// int opcode[MF_ANY] = { MF_CHECKVALUE, MF_CHECKINSTANCE, MF_CHECKOBJECT }; +// int k=_detecttype(type, &tindx); +// +// if (k==MF_ANY) return MFINSTRUCTION_EMPTY; +// +// mfinstruction check = MFINSTRUCTION_CHECKTYPE(opcode[k], i, tindx, 0); +// return mfcompile_insertinstruction(c, check); +// } +// +// /** Compiles a single result */ +// mfindx mfcompile_resolve(mfcompiler *c, mfresult *res) { +// mfindx start = mfcompile_nextinstruction(c); +// +// // Check all arguments have been resolved +// signature *sig = res->sig; +// for (int i=0; itypes.count; i++) { +// if (MORPHO_ISNIL(sig->types.data[i]) || +// mfcompiler_ischecked(c, i)) continue; +// +// mfcompile_check(c, i, sig->types.data[i]); +// } +// +// mfindx end = mfcompile_nextinstruction(c); +// +// mfinstruction instr = MFINSTRUCTION_RESOLVE(res->fn); +// mfcompile_insertinstruction(c, instr); +// +// if (start!=end) { +// mfindx fail = mfcompile_fail(c); +// for (mfindx i=start; icount && set->rlist[k].indx<0) k++; +// +// // Deal with each outcome +// while (kcount) { +// int indx=set->rlist[k].indx, n=0; +// while (k+ncount && set->rlist[k+n].indx==indx) n++; +// +// mfset out = MFSET(n, &set->rlist[k]); +// +// // Set the branch point +// btable->data[indx]=mfcompile_currentinstruction(c)-bindx; +// mfcompile_set(c, &out); +// +// k+=n; +// } +// } +// +// void _insertchildren(dictionary *dict, value v) { +// if (!MORPHO_ISCLASS(v) || +// dictionary_get(dict, v, NULL)) return; +// +// dictionary_insert(dict, v, MORPHO_NIL); // Insert the class +// objectclass *klass = MORPHO_GETCLASS(v); // and its children +// for (int i=0; ichildren.count; i++) _insertchildren(dict, klass->children.data[i]); +// } +// +// bool _resolve(objectclass *klass, dictionary *types, value *out) { +// for (int k=0; klinearization.count; k++) { +// if (dictionary_get(types, klass->linearization.data[k], NULL)) { +// *out = klass->linearization.data[k]; +// return true; +// } +// } +// return false; +// } +// +// int _maxindx(dictionary *dict) { +// int indx=0, maxindx=0; +// for (int i=0; icapacity; i++) { +// _detecttype(dict->contents[i].key, &indx); +// if (indx>maxindx) maxindx=indx; +// } +// return maxindx; +// } +// +// int _mfresultsortfn (const void *a, const void *b) { +// mfresult *aa = (mfresult *) a, *bb = (mfresult *) b; +// +// int ai = aa->indx, bi = bb->indx; +// if (aa->sig->varg) ai=-1; // Ensure vargs end up first +// if (bb->sig->varg) bi=-1; +// +// return ai-bi; +// } +// +// /** Constructs a dispatch table from the set of implementations */ +// mfindx mfcompile_dispatchtable(mfcompiler *c, mfset *set, int i, int otype, int opcode) { +// dictionary types, children; +// dictionary_init(&types); // Keep track of the available types provided by the implementation +// dictionary_init(&children); // and all of their children +// +// // Extract the type index for each member of the set +// for (int k=0; kcount; k++) { +// value type; +// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) UNREACHABLE("Incorrect parameter type"); +// if (_detecttype(type, &set->rlist[k].indx)==otype) { +// dictionary_insert(&types, type, MORPHO_NIL); +// _insertchildren(&children, type); +// } else set->rlist[k].indx=-1; // Exclude from the branch table +// } +// +// // Sort the set on the type index +// qsort(set->rlist, set->count, sizeof(mfresult), _mfresultsortfn); +// +// // Create the branch table +// int maxindx=_maxindx(&children); +// varray_int btable; +// varray_intinit(&btable); +// for (int i=0; i<=maxindx; i++) varray_intwrite(&btable, 0); +// +// // Insert the branch instruction +// mfinstruction instr = MFINSTRUCTION_BRANCHTABLE(opcode, i, btable, 0); +// mfindx bindx = mfcompile_insertinstruction(c, instr); +// +// // Fail if an object type isn't in the table +// mfcompile_fail(c); +// +// // Compile the branch table +// mfcompile_branchtable(c, set, bindx, &btable); +// +// // Fix branch table to include child classes +// for (int i=0; icount]; +// int n=0; +// +// // Find implementations that accept any type +// for (int k=0; kcount; k++) { +// value type; +// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) return MFINSTRUCTION_EMPTY; +// if (_detecttype(type, &set->rlist[k].indx)==MF_ANY) { +// rlist[n] = set->rlist[k]; n++; +// } +// } +// +// mfindx bindx = mfcompile_nextinstruction(c); +// +// mfset anyset = MFSET(n, rlist); +// mfcompile_set(c, &anyset); +// +// return bindx; +// } +// +// /** Fixes a fallthrough fail */ +// void mfcompile_fixfallthrough(mfcompiler *c, mfindx i, mfindx branchto) { +// mfinstruction instr = MFINSTRUCTION_BRANCH(branchto-i-1); +// mfcompile_replaceinstruction(c, i, instr); +// } +// +// typedef mfindx (mfcompile_dispatchfn) (mfcompiler *c, mfset *set, int i); +// +// /** Attempts to dispatch based on a parameter i */ +// mfindx mfcompile_dispatchonparam(mfcompiler *c, mfset *set, int i) { +// mfcompiler_pushcheck(c, i); +// int typecount[MF_ANY+1] = { 0, 0, 0, 0}; +// +// // Determine what types are present +// for (int k=0; kcount; k++) { +// value type; +// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) continue; +// typecount[_detecttype(type, NULL)]++; +// } +// +// mfindx bindx[MF_ANY+1]; +// mfcompile_dispatchfn *dfn[MF_ANY+1] = { mfcompile_dispatchveneervalue, +// mfcompile_dispatchinstance, +// mfcompile_dispatchveneerobj, +// mfcompile_dispatchany}; +// +// // Cycle through all value types, building a chain of branchtables +// int n=0; +// for (int j=0; j<=MF_ANY; j++) { +// if (typecount[j] && dfn[j]) { +// bindx[n]=(dfn[j]) (c, set, i); +// if (n>0) mfcompile_setbranch(c, bindx[n-1], bindx[n]-bindx[n-1]-1); +// n++; +// } +// } +// +// if (typecount[MF_ANY]) { // Fix branch table fallthroughs to point to any +// for (int j=0; jsig) ? MF_CHECKNARGSLT : MF_CHECKNARGSNEQ ), signature_countparams(res->sig), 0); +// mfindx bindx = mfcompile_insertinstruction(c, instr); // Write the check nargs instruction +// +// mfcompile_resolve(c, res); +// +// return bindx; +// } +// +// /** Attempts to dispatch based on the number of arguments */ +// mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max) { +// mfindx bindx = MFINSTRUCTION_EMPTY; +// +// // Sort the set into order given by number of parameters; resolution with varg is always first +// for (int k=0; kcount; k++) { +// set->rlist[k].indx=signature_countparams(set->rlist[k].sig); +// } +// qsort(set->rlist, set->count, sizeof(mfresult), _mfresultsortfn); +// +// if (set->count==2) { +// for (int i=1; i>=0; i--) { +// bindx = mfcompile_checknarg(c, &set->rlist[i]); +// +// mfindx eindx = mfcompile_currentinstruction(c); +// mfcompile_setbranch(c, bindx, eindx-bindx); +// } +// mfcompile_fail(c); +// } else { // If more than two options, generate a branch table +// varray_int btable; +// varray_intinit(&btable); +// for (int i=0; i<=max; i++) varray_intwrite(&btable, 0); +// +// // Insert the branch table instruction +// mfinstruction table = MFINSTRUCTION_BRANCHNARG(btable, 0); +// bindx = mfcompile_insertinstruction(c, table); +// +// // Immediately follow by a fail instruction if this falls through +// mfindx fail = mfcompile_fail(c); +// +// // Compile the branch table +// mfcompile_branchtable(c, set, bindx, &btable); +// +// // Insert variadic resolution into branch table if necessary +// if (set->rlist[0].sig->varg) { +// mfinstruction vargres = MFINSTRUCTION_RESOLVE(set->rlist[0].fn); +// mfindx varg = mfcompile_insertinstruction(c, vargres)-1; +// +// int nmin = set->rlist[0].sig->types.count-1; // varg can match this many args or more +// for (int i=nmin; icount==1) return mfcompile_resolve(c, set->rlist); +// +// int min, max; // Count the range of possible parameters +// mfcompile_countparams(c, set, &min, &max); +// +// bool isvariadic = mfcompile_containsvariadic(c, set); +// +// // Dispatch on the number of parameters if it's in doubt +// if (min!=max || (isvariadic && !c->varchecked)) { +// c->varchecked=true; +// return mfcompile_dispatchonnarg(c, set, min, max); +// } +// +// // If just one parameter, dispatch on it +// if (min==1 && !mfcompiler_ischecked(c, 0)) { +// return mfcompile_dispatchonparam(c, set, 0); +// } +// +// int best; +// if (mfcompile_countoutcomes(c, set, &best)) return mfcompile_dispatchonparam(c, set, best); +// +// mfcompiler_error(c, METAFUNCTION_CMPLAMBGS); +// return MFINSTRUCTION_EMPTY; +// } +// +// /** Clears the compiled code from a given metafunction */ +// void metafunction_clearinstructions(objectmetafunction *fn) { +// for (int i=0; iresolver.count; i++) { +// mfinstruction *mf = &fn->resolver.data[i]; +// if (mf->opcode>=MF_BRANCHNARGS && mf->opcode<=MF_BRANCHINSTANCE) varray_intclear(&mf->data.btable); +// } +// varray_mfinstructionclear(&fn->resolver); +// } +// +// /** Compiles the resolver for a metafunction that is still being assembled */ +// bool metafunction_compile(objectmetafunction *fn, error *err) { +// mfset set; +// set.count = fn->fns.count; +// if (!set.count) return false; +// +// mfresult rlist[set.count]; +// set.rlist=rlist; +// for (int i=0; ifns.data[i]); +// rlist[i].fn=fn->fns.data[i]; +// } +// +// mfcompiler compiler; +// mfcompiler_init(&compiler, fn); +// +// mfcompile_set(&compiler, &set); +// //mfcompiler_disassemble(&compiler); +// +// bool success=!morpho_checkerror(&compiler.err); +// if (!success && err) *err=compiler.err; +// +// mfcompiler_clear(&compiler, fn); +// +// return success; +// } +// +// /** Finalizes a metafunction, compiling its resolver once the implementation set is complete */ +// bool metafunction_finalize(objectmetafunction *fn, error *err) { +// if (fn->state==METAFUNCTION_FROZEN) return true; +// +// if (!metafunction_compile(fn, err)) return false; +// fn->state=METAFUNCTION_FROZEN; +// +// return true; +// } +// +// /** Finalizes any metafunctions stored in a linked object list */ +// bool metafunction_finalizelist(object *list, error *err) { +// for (object *obj=list; obj!=NULL; obj=obj->next) { +// if (obj->type==OBJECT_METAFUNCTION && +// !metafunction_finalize((objectmetafunction *) obj, err)) { +// return false; +// } +// } +// +// return true; +// } +// +// /** Attempt to find the desired class uid in the linearization of a given class */ +// bool _finduidinlinearization(objectclass *klass, int uid) { +// for (int k=0; klinearization.count; k++) { +// if (MORPHO_GETCLASS(klass->linearization.data[k])->uid == uid) return true; +// } +// return false; +// } +// +// /** Execute the resolver for a finalized metafunction. +// @param[in] fn - the metafunction to resolve +// @param[in] nargs - number of positional arguments +// @param[in] args - positional arguments @warning: the first user-visible argument should be in the zero position +// @param[out] err - error block to be filled out +// @param[out] out - resolved function +// @returns true if the metafunction was successfully resolved */ +// bool metafunction_xresolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { +// if (fn->state!=METAFUNCTION_FROZEN) { +// if (err) morpho_writeerrorwithid(err, METAFUNCTION_UNFROZEN, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); +// return false; +// } +// mfinstruction *pc = fn->resolver.data; +// if (!pc) return false; +// +// do { +// switch(pc->opcode) { +// case MF_CHECKNARGSNEQ: +// if (nargs!=pc->narg) pc+=pc->branch; +// break; +// case MF_CHECKNARGSLT: +// if (nargsnarg) pc+=pc->branch; +// break; +// case MF_CHECKVALUE: { +// if (!MORPHO_ISOBJECT(args[pc->narg])) { +// int tindx = (int) MORPHO_GETORDEREDTYPE(args[pc->narg]); +// if (pc->data.tindx!=tindx) pc+=pc->branch; +// } else pc+=pc->branch; +// } +// break; +// case MF_CHECKOBJECT: { +// if (MORPHO_ISOBJECT(args[pc->narg])) { +// int tindx = (int) MORPHO_GETOBJECTTYPE(args[pc->narg]); +// if (pc->data.tindx!=tindx) pc+=pc->branch; +// } else pc+=pc->branch; +// } +// break; +// case MF_CHECKINSTANCE: { +// if (MORPHO_ISINSTANCE(args[pc->narg])) { +// objectclass *klass = MORPHO_GETINSTANCE(args[pc->narg])->klass; +// +// if (!(klass->uid==pc->data.tindx || +// _finduidinlinearization(klass, pc->data.tindx))) { +// pc+=pc->branch; +// } +// } else pc+=pc->branch; +// } +// break; +// case MF_BRANCH: +// pc+=pc->branch; +// break; +// case MF_BRANCHNARGS: +// if (nargsdata.btable.count) { +// pc+=pc->data.btable.data[nargs]; +// } else pc+=pc->branch; +// break; +// case MF_BRANCHVALUETYPE: { +// if (!MORPHO_ISOBJECT(args[pc->narg])) { +// int type = (int) MORPHO_GETORDEREDTYPE(args[pc->narg]); +// if (typedata.btable.count) pc+=pc->data.btable.data[type]; +// } else pc+=pc->branch; +// } +// break; +// case MF_BRANCHOBJECTTYPE: { +// if (MORPHO_ISOBJECT(args[pc->narg])) { +// int type = MORPHO_GETOBJECTTYPE(args[pc->narg]); +// if (typedata.btable.count) pc+=pc->data.btable.data[type]; +// } else pc+=pc->branch; +// } +// break; +// case MF_BRANCHINSTANCE: { +// if (MORPHO_ISINSTANCE(args[pc->narg])) { +// // TODO: Check for btable bound +// objectclass *klass = MORPHO_GETINSTANCE(args[pc->narg])->klass; +// if (klass->uiddata.btable.count) pc+=pc->data.btable.data[klass->uid]; +// } else pc+=pc->branch; +// } +// break; +// case MF_RESOLVE: +// *out = pc->data.resolvefn; +// return true; +// case MF_FAIL: +// return false; +// } +// pc++; +// } while(true); +// } +// -int _mfresultsortfn (const void *a, const void *b) { - mfresult *aa = (mfresult *) a, *bb = (mfresult *) b; - - int ai = aa->indx, bi = bb->indx; - if (aa->sig->varg) ai=-1; // Ensure vargs end up first - if (bb->sig->varg) bi=-1; - - return ai-bi; -} - -/** Constructs a dispatch table from the set of implementations */ -mfindx mfcompile_dispatchtable(mfcompiler *c, mfset *set, int i, int otype, int opcode) { - dictionary types, children; - dictionary_init(&types); // Keep track of the available types provided by the implementation - dictionary_init(&children); // and all of their children - - // Extract the type index for each member of the set - for (int k=0; kcount; k++) { - value type; - if (!signature_getparamtype(set->rlist[k].sig, i, &type)) UNREACHABLE("Incorrect parameter type"); - if (_detecttype(type, &set->rlist[k].indx)==otype) { - dictionary_insert(&types, type, MORPHO_NIL); - _insertchildren(&children, type); - } else set->rlist[k].indx=-1; // Exclude from the branch table - } - - // Sort the set on the type index - qsort(set->rlist, set->count, sizeof(mfresult), _mfresultsortfn); - - // Create the branch table - int maxindx=_maxindx(&children); - varray_int btable; - varray_intinit(&btable); - for (int i=0; i<=maxindx; i++) varray_intwrite(&btable, 0); - - // Insert the branch instruction - mfinstruction instr = MFINSTRUCTION_BRANCHTABLE(opcode, i, btable, 0); - mfindx bindx = mfcompile_insertinstruction(c, instr); - - // Fail if an object type isn't in the table - mfcompile_fail(c); - - // Compile the branch table - mfcompile_branchtable(c, set, bindx, &btable); - - // Fix branch table to include child classes - for (int i=0; icount]; - int n=0; - - // Find implementations that accept any type - for (int k=0; kcount; k++) { - value type; - if (!signature_getparamtype(set->rlist[k].sig, i, &type)) return MFINSTRUCTION_EMPTY; - if (_detecttype(type, &set->rlist[k].indx)==MF_ANY) { - rlist[n] = set->rlist[k]; n++; - } - } - - mfindx bindx = mfcompile_nextinstruction(c); - - mfset anyset = MFSET(n, rlist); - mfcompile_set(c, &anyset); - - return bindx; -} - -/** Fixes a fallthrough fail */ -void mfcompile_fixfallthrough(mfcompiler *c, mfindx i, mfindx branchto) { - mfinstruction instr = MFINSTRUCTION_BRANCH(branchto-i-1); - mfcompile_replaceinstruction(c, i, instr); -} - -typedef mfindx (mfcompile_dispatchfn) (mfcompiler *c, mfset *set, int i); - -/** Attempts to dispatch based on a parameter i */ -mfindx mfcompile_dispatchonparam(mfcompiler *c, mfset *set, int i) { - mfcompiler_pushcheck(c, i); - int typecount[MF_ANY+1] = { 0, 0, 0, 0}; - - // Determine what types are present - for (int k=0; kcount; k++) { - value type; - if (!signature_getparamtype(set->rlist[k].sig, i, &type)) continue; - typecount[_detecttype(type, NULL)]++; - } - - mfindx bindx[MF_ANY+1]; - mfcompile_dispatchfn *dfn[MF_ANY+1] = { mfcompile_dispatchveneervalue, - mfcompile_dispatchinstance, - mfcompile_dispatchveneerobj, - mfcompile_dispatchany}; - - // Cycle through all value types, building a chain of branchtables - int n=0; - for (int j=0; j<=MF_ANY; j++) { - if (typecount[j] && dfn[j]) { - bindx[n]=(dfn[j]) (c, set, i); - if (n>0) mfcompile_setbranch(c, bindx[n-1], bindx[n]-bindx[n-1]-1); - n++; - } - } - - if (typecount[MF_ANY]) { // Fix branch table fallthroughs to point to any - for (int j=0; jsig) ? MF_CHECKNARGSLT : MF_CHECKNARGSNEQ ), signature_countparams(res->sig), 0); - mfindx bindx = mfcompile_insertinstruction(c, instr); // Write the check nargs instruction - - mfcompile_resolve(c, res); - - return bindx; -} - -/** Attempts to dispatch based on the number of arguments */ -mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max) { - mfindx bindx = MFINSTRUCTION_EMPTY; - - // Sort the set into order given by number of parameters; resolution with varg is always first - for (int k=0; kcount; k++) { - set->rlist[k].indx=signature_countparams(set->rlist[k].sig); - } - qsort(set->rlist, set->count, sizeof(mfresult), _mfresultsortfn); - - if (set->count==2) { - for (int i=1; i>=0; i--) { - bindx = mfcompile_checknarg(c, &set->rlist[i]); - - mfindx eindx = mfcompile_currentinstruction(c); - mfcompile_setbranch(c, bindx, eindx-bindx); - } - mfcompile_fail(c); - } else { // If more than two options, generate a branch table - varray_int btable; - varray_intinit(&btable); - for (int i=0; i<=max; i++) varray_intwrite(&btable, 0); - - // Insert the branch table instruction - mfinstruction table = MFINSTRUCTION_BRANCHNARG(btable, 0); - bindx = mfcompile_insertinstruction(c, table); - - // Immediately follow by a fail instruction if this falls through - mfindx fail = mfcompile_fail(c); - - // Compile the branch table - mfcompile_branchtable(c, set, bindx, &btable); - - // Insert variadic resolution into branch table if necessary - if (set->rlist[0].sig->varg) { - mfinstruction vargres = MFINSTRUCTION_RESOLVE(set->rlist[0].fn); - mfindx varg = mfcompile_insertinstruction(c, vargres)-1; - - int nmin = set->rlist[0].sig->types.count-1; // varg can match this many args or more - for (int i=nmin; icount==1) return mfcompile_resolve(c, set->rlist); - - int min, max; // Count the range of possible parameters - mfcompile_countparams(c, set, &min, &max); - - bool isvariadic = mfcompile_containsvariadic(c, set); - - // Dispatch on the number of parameters if it's in doubt - if (min!=max || (isvariadic && !c->varchecked)) { - c->varchecked=true; - return mfcompile_dispatchonnarg(c, set, min, max); - } - - // If just one parameter, dispatch on it - if (min==1 && !mfcompiler_ischecked(c, 0)) { - return mfcompile_dispatchonparam(c, set, 0); - } - - int best; - if (mfcompile_countoutcomes(c, set, &best)) return mfcompile_dispatchonparam(c, set, best); - - mfcompiler_error(c, METAFUNCTION_CMPLAMBGS); - return MFINSTRUCTION_EMPTY; -} +DEFINE_VARRAY(mfinstruction, mfinstruction); -/** Clears the compiled code from a given metafunction */ +/** Clears the compiled code from a given metafunction. */ void metafunction_clearinstructions(objectmetafunction *fn) { - for (int i=0; iresolver.count; i++) { - mfinstruction *mf = &fn->resolver.data[i]; - if (mf->opcode>=MF_BRANCHNARGS && mf->opcode<=MF_BRANCHINSTANCE) varray_intclear(&mf->data.btable); - } varray_mfinstructionclear(&fn->resolver); } -/** Compiles the resolver for a metafunction that is still being assembled */ +/** Compiles the resolver for a metafunction that is still being assembled. */ bool metafunction_compile(objectmetafunction *fn, error *err) { - mfset set; - set.count = fn->fns.count; - if (!set.count) return false; - - mfresult rlist[set.count]; - set.rlist=rlist; - for (int i=0; ifns.data[i]); - rlist[i].fn=fn->fns.data[i]; - } - - mfcompiler compiler; - mfcompiler_init(&compiler, fn); - - mfcompile_set(&compiler, &set); - //mfcompiler_disassemble(&compiler); - - bool success=!morpho_checkerror(&compiler.err); - if (!success && err) *err=compiler.err; - - mfcompiler_clear(&compiler, fn); - - return success; + return (fn->fns.count>0); } -/** Finalizes a metafunction, compiling its resolver once the implementation set is complete */ +/** Finalizes a metafunction. */ bool metafunction_finalize(objectmetafunction *fn, error *err) { if (fn->state==METAFUNCTION_FROZEN) return true; - if (!metafunction_compile(fn, err)) return false; fn->state=METAFUNCTION_FROZEN; - return true; } -/** Finalizes any metafunctions stored in a linked object list */ +/** Finalizes any metafunctions stored in a linked object list. */ bool metafunction_finalizelist(object *list, error *err) { for (object *obj=list; obj!=NULL; obj=obj->next) { if (obj->type==OBJECT_METAFUNCTION && @@ -847,102 +976,6 @@ bool metafunction_finalizelist(object *list, error *err) { return true; } -/** Attempt to find the desired class uid in the linearization of a given class */ -bool _finduidinlinearization(objectclass *klass, int uid) { - for (int k=0; klinearization.count; k++) { - if (MORPHO_GETCLASS(klass->linearization.data[k])->uid == uid) return true; - } - return false; -} - -/** Execute the resolver for a finalized metafunction. - @param[in] fn - the metafunction to resolve - @param[in] nargs - number of positional arguments - @param[in] args - positional arguments @warning: the first user-visible argument should be in the zero position - @param[out] err - error block to be filled out - @param[out] out - resolved function - @returns true if the metafunction was successfully resolved */ -bool metafunction_xresolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { - if (fn->state!=METAFUNCTION_FROZEN) { - if (err) morpho_writeerrorwithid(err, METAFUNCTION_UNFROZEN, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); - return false; - } - mfinstruction *pc = fn->resolver.data; - if (!pc) return false; - - do { - switch(pc->opcode) { - case MF_CHECKNARGSNEQ: - if (nargs!=pc->narg) pc+=pc->branch; - break; - case MF_CHECKNARGSLT: - if (nargsnarg) pc+=pc->branch; - break; - case MF_CHECKVALUE: { - if (!MORPHO_ISOBJECT(args[pc->narg])) { - int tindx = (int) MORPHO_GETORDEREDTYPE(args[pc->narg]); - if (pc->data.tindx!=tindx) pc+=pc->branch; - } else pc+=pc->branch; - } - break; - case MF_CHECKOBJECT: { - if (MORPHO_ISOBJECT(args[pc->narg])) { - int tindx = (int) MORPHO_GETOBJECTTYPE(args[pc->narg]); - if (pc->data.tindx!=tindx) pc+=pc->branch; - } else pc+=pc->branch; - } - break; - case MF_CHECKINSTANCE: { - if (MORPHO_ISINSTANCE(args[pc->narg])) { - objectclass *klass = MORPHO_GETINSTANCE(args[pc->narg])->klass; - - if (!(klass->uid==pc->data.tindx || - _finduidinlinearization(klass, pc->data.tindx))) { - pc+=pc->branch; - } - } else pc+=pc->branch; - } - break; - case MF_BRANCH: - pc+=pc->branch; - break; - case MF_BRANCHNARGS: - if (nargsdata.btable.count) { - pc+=pc->data.btable.data[nargs]; - } else pc+=pc->branch; - break; - case MF_BRANCHVALUETYPE: { - if (!MORPHO_ISOBJECT(args[pc->narg])) { - int type = (int) MORPHO_GETORDEREDTYPE(args[pc->narg]); - if (typedata.btable.count) pc+=pc->data.btable.data[type]; - } else pc+=pc->branch; - } - break; - case MF_BRANCHOBJECTTYPE: { - if (MORPHO_ISOBJECT(args[pc->narg])) { - int type = MORPHO_GETOBJECTTYPE(args[pc->narg]); - if (typedata.btable.count) pc+=pc->data.btable.data[type]; - } else pc+=pc->branch; - } - break; - case MF_BRANCHINSTANCE: { - if (MORPHO_ISINSTANCE(args[pc->narg])) { - // TODO: Check for btable bound - objectclass *klass = MORPHO_GETINSTANCE(args[pc->narg])->klass; - if (klass->uiddata.btable.count) pc+=pc->data.btable.data[klass->uid]; - } else pc+=pc->branch; - } - break; - case MF_RESOLVE: - *out = pc->data.resolvefn; - return true; - case MF_FAIL: - return false; - } - pc++; - } while(true); -} - /* ********************************************************************** * Metafunction base-case resolver * ********************************************************************** */ From d4ef841bf93ec0d064df5019ccdc717aac697391 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 22 Apr 2026 19:18:16 -0400 Subject: [PATCH 356/473] Reorganize code --- src/classes/metafunction.c | 152 +++++++++++++++++++++++-------------- 1 file changed, 93 insertions(+), 59 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index ecf41c5ba..e7de4b8e8 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -16,18 +16,9 @@ * ********************************************************************** */ enum { - MF_RESOLVE, - MF_FAIL, - MF_CHECKNARGSNEQ, - MF_CHECKNARGSLT, - MF_CHECKVALUE, - MF_CHECKOBJECT, - MF_CHECKINSTANCE, - MF_BRANCH, - MF_BRANCHNARGS, - MF_BRANCHVALUETYPE, - MF_BRANCHOBJECTTYPE, - MF_BRANCHINSTANCE + MFOP_SLOW, + MFOP_RESOLVE, + MFOP_FAIL }; /* ********************************************************************** @@ -48,7 +39,7 @@ void objectmetafunction_markfn(object *obj, void *v) { for (int i=0; iresolver.count; i++) { // Mark any functions in the resolver mfinstruction *instr = &f->resolver.data[i]; - if (instr->opcode==MF_RESOLVE) morpho_markvalue(v,instr->data.resolvefn); + if (instr->opcode==MFOP_RESOLVE) morpho_markvalue(v,instr->data.resolvefn); } } @@ -153,17 +144,6 @@ bool metafunction_matchset(objectmetafunction *fn, int n, value *fns) { return true; } -signature *metafunction_getsignature(value fn) { - if (MORPHO_ISFUNCTION(fn)) { - return &MORPHO_GETFUNCTION(fn)->sig; - } else if (MORPHO_ISBUILTINFUNCTION(fn)) { - return &MORPHO_GETBUILTINFUNCTION(fn)->sig; - } else if (MORPHO_ISCLOSURE(fn)) { - return &MORPHO_GETCLOSURE(fn)->func->sig; - } - return NULL; -} - /** Infer the return type from the contents of a metafunction, if known */ void metafunction_inferreturntype(objectmetafunction *fn, value *type) { value rtype = MORPHO_NIL; @@ -180,7 +160,43 @@ void metafunction_inferreturntype(objectmetafunction *fn, value *type) { *type=rtype; } -value _getname(value fn) { +/** Clears the compiled code from a given metafunction. */ +void metafunction_clearinstructions(objectmetafunction *fn) { + varray_mfinstructionclear(&fn->resolver); +} + +/** Finalizes a metafunction. */ +bool metafunction_finalize(objectmetafunction *fn, error *err) { + if (fn->state==METAFUNCTION_FROZEN) return true; + if (!metafunction_compile(fn, err)) return false; + fn->state=METAFUNCTION_FROZEN; + return true; +} + +/** Finalizes any metafunctions stored in a linked object list. */ +bool metafunction_finalizelist(object *list, error *err) { + for (object *obj=list; obj!=NULL; obj=obj->next) { + if (obj->type==OBJECT_METAFUNCTION && + !metafunction_finalize((objectmetafunction *) obj, err)) { + return false; + } + } + + return true; +} + +signature *metafunction_getsignature(value fn) { + if (MORPHO_ISFUNCTION(fn)) { + return &MORPHO_GETFUNCTION(fn)->sig; + } else if (MORPHO_ISBUILTINFUNCTION(fn)) { + return &MORPHO_GETBUILTINFUNCTION(fn)->sig; + } else if (MORPHO_ISCLOSURE(fn)) { + return &MORPHO_GETCLOSURE(fn)->func->sig; + } + return NULL; +} + +value metafunction_getname(value fn) { if (MORPHO_ISFUNCTION(fn)) { return MORPHO_GETFUNCTION(fn)->name; } else if (MORPHO_ISBUILTINFUNCTION(fn)) { @@ -944,38 +960,6 @@ value _getname(value fn) { // } // -DEFINE_VARRAY(mfinstruction, mfinstruction); - -/** Clears the compiled code from a given metafunction. */ -void metafunction_clearinstructions(objectmetafunction *fn) { - varray_mfinstructionclear(&fn->resolver); -} - -/** Compiles the resolver for a metafunction that is still being assembled. */ -bool metafunction_compile(objectmetafunction *fn, error *err) { - return (fn->fns.count>0); -} - -/** Finalizes a metafunction. */ -bool metafunction_finalize(objectmetafunction *fn, error *err) { - if (fn->state==METAFUNCTION_FROZEN) return true; - if (!metafunction_compile(fn, err)) return false; - fn->state=METAFUNCTION_FROZEN; - return true; -} - -/** Finalizes any metafunctions stored in a linked object list. */ -bool metafunction_finalizelist(object *list, error *err) { - for (object *obj=list; obj!=NULL; obj=obj->next) { - if (obj->type==OBJECT_METAFUNCTION && - !metafunction_finalize((objectmetafunction *) obj, err)) { - return false; - } - } - - return true; -} - /* ********************************************************************** * Metafunction base-case resolver * ********************************************************************** */ @@ -1146,7 +1130,7 @@ void mfresolutionset_filterbyspecificity(mfresolutionset *set, int nargs, value @param[out] err - error block to be filled out @param[out] out - resolved function @returns true if the metafunction was successfully resolved */ -bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { +static bool metafunction_resolveslow(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { if (fn->state!=METAFUNCTION_FROZEN) { if (err) error_writewithid(err, METAFUNCTION_UNFROZEN); return false; } @@ -1169,6 +1153,56 @@ bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error } } +/* ********************************************************************** + * Fast metafunction resolver + * ********************************************************************** */ + +DEFINE_VARRAY(mfinstruction, mfinstruction); + +#define MFINSTRUCTION_SLOW { .opcode=MFOP_SLOW } +#define MFINSTRUCTION_RESOLVE(fn) { .opcode=MFOP_RESOLVE, .data.resolvefn=fn } +#define MFINSTRUCTION_FAIL { .opcode=MFOP_FAIL } + +/* -------------------------- + * Fast resolver Compiler + * -------------------------- */ + +/** Compiles the resolver for a metafunction that is still being assembled. */ +bool metafunction_compile(objectmetafunction *fn, error *err) { + if (fn->fns.count<=0) return false; + metafunction_clearinstructions(fn); + mfinstruction instr = MFINSTRUCTION_SLOW; + return varray_mfinstructionwrite(&fn->resolver, instr)>=0; +} + +/* -------------------------- + * Fast resolver VM + * -------------------------- */ + +/** Execute the new resolver VM. */ +static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { + mfinstruction *pc = fn->resolver.data; + if (!pc) return metafunction_resolveslow(fn, nargs, args, err, out); + + while (true) { + switch (pc->opcode) { + case MFOP_SLOW: return metafunction_resolveslow(fn, nargs, args, err, out); + case MFOP_RESOLVE: if (out) *out=pc->data.resolvefn; return true; + case MFOP_FAIL: if (err) error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + } + pc++; + } +} + +/** Resolve a metafunction using the compiled resolver VM. */ +bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { + if (fn->state!=METAFUNCTION_FROZEN) { + if (err) error_writewithid(err, METAFUNCTION_UNFROZEN); return false; + } + + return metafunction_runresolver(fn, nargs, args, err, out); +} + /* ********************************************************************** * Metafunction veneer class * ********************************************************************** */ @@ -1179,7 +1213,7 @@ value metafunction_constructor(vm *v, int nargs, value *args) { if (nargs==0) return MORPHO_NIL; - value name = _getname(MORPHO_GETARG(args, 0)); + value name = metafunction_getname(MORPHO_GETARG(args, 0)); if (!MORPHO_ISSTRING(name)) return MORPHO_NIL; objectmetafunction *new = object_newmetafunction(name); From 7a73b851f2308f6bec6aee10895ded4ce0a649ae Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 22 Apr 2026 23:17:17 -0400 Subject: [PATCH 357/473] Minimal fast resolver --- src/classes/metafunction.c | 113 +++++++++++++++++++++++++++++-------- src/classes/metafunction.h | 17 ++---- 2 files changed, 95 insertions(+), 35 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index e7de4b8e8..01b70bc22 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -11,16 +11,6 @@ #include "classes.h" #include "common.h" -/* ********************************************************************** - * Metafunction opcodes - * ********************************************************************** */ - -enum { - MFOP_SLOW, - MFOP_RESOLVE, - MFOP_FAIL -}; - /* ********************************************************************** * objectmetafunction definitions * ********************************************************************** */ @@ -36,11 +26,6 @@ void objectmetafunction_markfn(object *obj, void *v) { objectmetafunction *f = (objectmetafunction *) obj; morpho_markvalue(v, f->name); // Mark the name morpho_markvarrayvalue(v, &f->fns); // Preserve implementations while building/frozen - - for (int i=0; iresolver.count; i++) { // Mark any functions in the resolver - mfinstruction *instr = &f->resolver.data[i]; - if (instr->opcode==MFOP_RESOLVE) morpho_markvalue(v,instr->data.resolvefn); - } } size_t objectmetafunction_sizefn(object *obj) { @@ -169,6 +154,7 @@ void metafunction_clearinstructions(objectmetafunction *fn) { bool metafunction_finalize(objectmetafunction *fn, error *err) { if (fn->state==METAFUNCTION_FROZEN) return true; if (!metafunction_compile(fn, err)) return false; + metafunction_disassemble(fn); fn->state=METAFUNCTION_FROZEN; return true; } @@ -1159,9 +1145,13 @@ static bool metafunction_resolveslow(objectmetafunction *fn, int nargs, value *a DEFINE_VARRAY(mfinstruction, mfinstruction); -#define MFINSTRUCTION_SLOW { .opcode=MFOP_SLOW } -#define MFINSTRUCTION_RESOLVE(fn) { .opcode=MFOP_RESOLVE, .data.resolvefn=fn } -#define MFINSTRUCTION_FAIL { .opcode=MFOP_FAIL } +/** Bytecodes */ +enum { + MFOP_SLOW, + MFOP_RESOLVE, + MFOP_FAIL, + MFOP_SPARSE +}; /* -------------------------- * Fast resolver Compiler @@ -1171,24 +1161,101 @@ DEFINE_VARRAY(mfinstruction, mfinstruction); bool metafunction_compile(objectmetafunction *fn, error *err) { if (fn->fns.count<=0) return false; metafunction_clearinstructions(fn); - mfinstruction instr = MFINSTRUCTION_SLOW; + mfinstruction instr = MFOP_SLOW; return varray_mfinstructionwrite(&fn->resolver, instr)>=0; } + +/* -------------------------- + * Disassembler + * -------------------------- */ + +/** Disassemble a RESOLVE instruction. */ +static mfindx metafunction_disassembleresolve(objectmetafunction *fn, mfindx pc) { + if (pc+1>=fn->resolver.count) { printf("resolve "); return pc+1; } + + int index=fn->resolver.data[pc+1]; + printf("resolve %i ", index); + if (index<0 || index>=fn->fns.count) printf(""); + else { + signature *sig = metafunction_getsignature(fn->fns.data[index]); + if (sig) signature_print(sig); + } + return pc+2; +} + +/** Disassemble a SPARSE instruction. */ +static mfindx metafunction_disassemblesparse(objectmetafunction *fn, mfindx pc) { + if (pc+2>=fn->resolver.count) { printf("sparse "); return fn->resolver.count; } + + int ncases=fn->resolver.data[pc+1]; + mfindx defaultpc=fn->resolver.data[pc+2]; + printf("sparse default -> %i", defaultpc); + + mfindx next=pc+3; + for (int k=0; k=fn->resolver.count) { printf(" "); return fn->resolver.count; } + printf(" %i -> %i", fn->resolver.data[next], fn->resolver.data[next+1]); + next+=2; + } + return next; +} + +/** Print a disassembly of the metafunction resolver bytecode. */ +void metafunction_disassemble(objectmetafunction *fn) { + printf("Resolver for "); + morpho_printvalue(NULL, MORPHO_OBJECT(fn)); + printf(":\n"); + + for (mfindx pc=0; pcresolver.count; ) { + printf("%5i : ", pc); + switch (fn->resolver.data[pc]) { + case MFOP_SLOW: printf("slow"); pc++; break; + case MFOP_FAIL: printf("fail"); pc++; break; + case MFOP_RESOLVE: pc=metafunction_disassembleresolve(fn, pc); break; + case MFOP_SPARSE: pc=metafunction_disassemblesparse(fn, pc); break; + default: + printf("unknown %i", fn->resolver.data[pc]); + pc++; + break; + } + printf("\n"); + } +} + + /* -------------------------- * Fast resolver VM * -------------------------- */ /** Execute the new resolver VM. */ static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { - mfinstruction *pc = fn->resolver.data; - if (!pc) return metafunction_resolveslow(fn, nargs, args, err, out); + mfinstruction *instructions = fn->resolver.data; + if (!instructions) return metafunction_resolveslow(fn, nargs, args, err, out); + + mfindx pc = 0; + int reg = nargs; // Single register initialized with nargs while (true) { - switch (pc->opcode) { + switch (instructions[pc]) { case MFOP_SLOW: return metafunction_resolveslow(fn, nargs, args, err, out); - case MFOP_RESOLVE: if (out) *out=pc->data.resolvefn; return true; + case MFOP_RESOLVE: { + pc++; *out=fn->fns.data[instructions[pc]]; + return true; + } case MFOP_FAIL: if (err) error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + case MFOP_SPARSE: { + int ncases=instructions[pc+1]; + mfindx cases=pc+3; + pc=instructions[pc+2]; // Default branch + for (int i=0; i<2*ncases; i+=2) { + if (instructions[cases+i]==reg) { // match + pc=instructions[cases+i+1]; + break; + } + } + continue; + } } pc++; } diff --git a/src/classes/metafunction.h b/src/classes/metafunction.h index d7d41e350..f74bb16d0 100644 --- a/src/classes/metafunction.h +++ b/src/classes/metafunction.h @@ -19,26 +19,18 @@ extern objecttype objectmetafunctiontype; /** Index type for metafunction resolver */ typedef int mfindx; -/** Compiled metafunction instruction set */ -typedef struct { - int opcode; - int narg; - union { - int tindx; - value resolvefn; - varray_int btable; - } data; - mfindx branch; /* Branch the pc by this amount on fail */ -} mfinstruction; +/** Compiled metafunction bytecode cell */ +typedef int mfinstruction; DECLARE_VARRAY(mfinstruction, mfinstruction); -/** A metafunction object */ +/** Metafunction status */ typedef enum { METAFUNCTION_BUILDING, METAFUNCTION_FROZEN } metafunctionstate; +/** A metafunction object */ typedef struct sobjectmetafunction { object obj; value name; @@ -93,6 +85,7 @@ bool metafunction_compile(objectmetafunction *fn, error *err); bool metafunction_finalize(objectmetafunction *fn, error *err); bool metafunction_finalizelist(object *list, error *err); void metafunction_clearinstructions(objectmetafunction *fn); +void metafunction_disassemble(objectmetafunction *fn); bool metafunction_resolve(objectmetafunction *f, int nargs, value *args, error *err, value *fn); From 0971973be76444ac9394778b83cd554be40af33b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 23 Apr 2026 00:02:10 -0400 Subject: [PATCH 358/473] First stage of compiler, the analyzer --- src/classes/metafunction.c | 75 +++++++++++++++++++++++++++++++++++++- 1 file changed, 73 insertions(+), 2 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 01b70bc22..30a14e9a6 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1157,15 +1157,86 @@ enum { * Fast resolver Compiler * -------------------------- */ +/** Candidate metadata used by the metafunction compiler. */ +typedef struct { + signature *sig; + int nparams; + int minarity; + int maxarity; + bool varg; + bool typed; +} mfcompileresolution; + +/** Compiler state for building a metafunction resolver. */ +typedef struct { + objectmetafunction *fn; + mfcompileresolution *resolutions; + int nresolutions; + bool hasvarg; + bool hastyped; +} mfcompiler; + +/** Initialize compiler state. */ +static void mfcompiler_init(mfcompiler *compiler, objectmetafunction *fn) { + compiler->fn = fn; + compiler->nresolutions = fn->fns.count; + compiler->hasvarg = false; + compiler->hastyped = false; + compiler->resolutions = malloc(sizeof(mfcompileresolution)*compiler->nresolutions); +} + +/** Clear compiler state. */ +static void mfcompiler_clear(mfcompiler *compiler) { + if (compiler->resolutions) free(compiler->resolutions); + compiler->resolutions = NULL; + compiler->nresolutions = 0; +} + +/** Analyze one candidate resolution. */ +static bool mfcompiler_analyzecandidate(mfcompiler *compiler, int i) { + if (!compiler->resolutions) return false; + + value fn = compiler->fn->fns.data[i]; + signature *sig = metafunction_getsignature(fn); + if (!sig) return false; + + mfcompileresolution *resolution = &compiler->resolutions[i]; + resolution->sig = sig; + resolution->nparams = signature_countparams(sig); + resolution->varg = signature_isvarg(sig); + resolution->typed = signature_istyped(sig); + resolution->minarity = (resolution->varg ? resolution->nparams-1 : resolution->nparams); + resolution->maxarity = (resolution->varg ? -1 : resolution->nparams); + + compiler->hasvarg = compiler->hasvarg || resolution->varg; + compiler->hastyped = compiler->hastyped || resolution->typed; + return true; +} + +/** Analyze the candidate set for a metafunction. */ +static bool mfcompiler_analyze(mfcompiler *compiler) { + for (int i=0; inresolutions; i++) { + if (!mfcompiler_analyzecandidate(compiler, i)) return false; + } + return true; +} + /** Compiles the resolver for a metafunction that is still being assembled. */ bool metafunction_compile(objectmetafunction *fn, error *err) { if (fn->fns.count<=0) return false; + + mfcompiler compiler; + mfcompiler_init(&compiler, fn); + mfcompiler_analyze(&compiler); + metafunction_clearinstructions(fn); mfinstruction instr = MFOP_SLOW; - return varray_mfinstructionwrite(&fn->resolver, instr)>=0; + bool success = varray_mfinstructionwrite(&fn->resolver, instr)>=0; + + mfcompiler_clear(&compiler); + return success; } - /* -------------------------- * Disassembler * -------------------------- */ From be3f4f5eb852c9b879a224ff4ed6d8495392df0c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 23 Apr 2026 08:21:00 -0400 Subject: [PATCH 359/473] Add index back in --- src/classes/metafunction.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 30a14e9a6..dcad577a8 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1159,6 +1159,7 @@ enum { /** Candidate metadata used by the metafunction compiler. */ typedef struct { + int fnindex; signature *sig; int nparams; int minarity; @@ -1201,6 +1202,7 @@ static bool mfcompiler_analyzecandidate(mfcompiler *compiler, int i) { if (!sig) return false; mfcompileresolution *resolution = &compiler->resolutions[i]; + resolution->fnindex = i; resolution->sig = sig; resolution->nparams = signature_countparams(sig); resolution->varg = signature_isvarg(sig); @@ -1227,7 +1229,7 @@ bool metafunction_compile(objectmetafunction *fn, error *err) { mfcompiler compiler; mfcompiler_init(&compiler, fn); - mfcompiler_analyze(&compiler); + mfcompiler_analyze(&compiler); metafunction_clearinstructions(fn); mfinstruction instr = MFOP_SLOW; From 8d855a067c2776cec1411f423de12ceb0254dda1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 25 Apr 2026 11:45:48 -0400 Subject: [PATCH 360/473] Workable arity compiler --- src/classes/metafunction.c | 91 +++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 7 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index dcad577a8..f37320df0 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -11,6 +11,8 @@ #include "classes.h" #include "common.h" +#define ERR_CHECK(expr, label) do { if (!(expr)) goto label; } while (0) + /* ********************************************************************** * objectmetafunction definitions * ********************************************************************** */ @@ -1223,20 +1225,95 @@ static bool mfcompiler_analyze(mfcompiler *compiler) { return true; } +/** Compare resolutions by arity for sorting. */ +static int mfcompiler_compareresolutionarity(const void *a, const void *b) { + int xi=((mfcompileresolution *) a)->nparams, yi=((mfcompileresolution *) b)->nparams; + return (xi > yi) - (xi < yi); // Ascending order +} + +/** Emit one instruction into the resolver. */ +static int mfcompiler_emit(mfcompiler *compiler, mfinstruction instruction) { + return varray_mfinstructionwrite(&compiler->fn->resolver, instruction); +} + +/** Emit a conservative exact-arity resolver directly into bytecode. */ +static bool mfcompiler_emitarityresolver(mfcompiler *compiler) { + if (compiler->hasvarg) return (mfcompiler_emit(compiler, MFOP_SLOW)>=0); + + mfcompileresolution resolutions[compiler->nresolutions]; + memcpy(resolutions, compiler->resolutions, sizeof(mfcompileresolution)*compiler->nresolutions); + qsort(resolutions, compiler->nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); + + int nmatches = 0; + for (int i=0; inresolutions; ) { + int count = 1; + while (i+countnresolutions && + resolutions[i+count].nparams==resolutions[i].nparams) count++; + nmatches++; + i += count; + } + + if (mfcompiler_emit(compiler, MFOP_SPARSE)<0) return false; + if (mfcompiler_emit(compiler, nmatches)<0) return false; + + int defaultpc = mfcompiler_emit(compiler, 0); + if (defaultpc<0) return false; + + int targetpc[nmatches]; + int match = 0; + for (int i=0; inresolutions; ) { + int arity = resolutions[i].nparams; + int count = 1; + while (i+countnresolutions && + resolutions[i+count].nparams==arity) count++; + if (mfcompiler_emit(compiler, arity)<0) return false; + targetpc[match] = mfcompiler_emit(compiler, 0); + if (targetpc[match]<0) return false; + match++; + i += count; + } + + compiler->fn->resolver.data[defaultpc] = compiler->fn->resolver.count; + if (mfcompiler_emit(compiler, MFOP_FAIL)<0) return false; + + match = 0; + for (int i=0; inresolutions; ) { + int count = 1; + while (i+countnresolutions && + resolutions[i+count].nparams==resolutions[i].nparams) count++; + + compiler->fn->resolver.data[targetpc[match]] = compiler->fn->resolver.count; + if (count==1 && !resolutions[i].typed) { + if (mfcompiler_emit(compiler, MFOP_RESOLVE)<0) return false; + if (mfcompiler_emit(compiler, resolutions[i].fnindex)<0) return false; + } else { + if (mfcompiler_emit(compiler, MFOP_SLOW)<0) return false; + } + + match++; + i += count; + } + + return true; +} + /** Compiles the resolver for a metafunction that is still being assembled. */ bool metafunction_compile(objectmetafunction *fn, error *err) { if (fn->fns.count<=0) return false; - + mfcompiler compiler; mfcompiler_init(&compiler, fn); - mfcompiler_analyze(&compiler); - metafunction_clearinstructions(fn); - mfinstruction instr = MFOP_SLOW; - bool success = varray_mfinstructionwrite(&fn->resolver, instr)>=0; - + + ERR_CHECK(mfcompiler_analyze(&compiler), metafunction_compile_cleanup); + ERR_CHECK(mfcompiler_emitarityresolver(&compiler), metafunction_compile_cleanup); mfcompiler_clear(&compiler); - return success; + return true; + +metafunction_compile_cleanup: + mfcompiler_clear(&compiler); + metafunction_clearinstructions(fn); + return false; } /* -------------------------- From 4c27a767ee178c965ef98ed411dc0559ab57514e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 25 Apr 2026 17:13:14 -0400 Subject: [PATCH 361/473] Simplify and clean arity checking --- src/classes/metafunction.c | 145 ++++++++++++++++++++++++------------- src/classes/metafunction.h | 1 + 2 files changed, 95 insertions(+), 51 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index f37320df0..2a886ad35 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -12,6 +12,7 @@ #include "common.h" #define ERR_CHECK(expr, label) do { if (!(expr)) goto label; } while (0) +#define ERR_CHECK_RETURN(expr) do { if (!(expr)) return false; } while (0) /* ********************************************************************** * objectmetafunction definitions @@ -64,6 +65,7 @@ objectmetafunction *object_newmetafunction(value name) { new->state=METAFUNCTION_BUILDING; varray_valueinit(&new->fns); varray_mfinstructioninit(&new->resolver); + new->entry=0; } return new; @@ -150,6 +152,7 @@ void metafunction_inferreturntype(objectmetafunction *fn, value *type) { /** Clears the compiled code from a given metafunction. */ void metafunction_clearinstructions(objectmetafunction *fn) { varray_mfinstructionclear(&fn->resolver); + fn->entry=0; } /** Finalizes a metafunction. */ @@ -1197,11 +1200,11 @@ static void mfcompiler_clear(mfcompiler *compiler) { /** Analyze one candidate resolution. */ static bool mfcompiler_analyzecandidate(mfcompiler *compiler, int i) { - if (!compiler->resolutions) return false; + ERR_CHECK_RETURN(compiler->resolutions); value fn = compiler->fn->fns.data[i]; signature *sig = metafunction_getsignature(fn); - if (!sig) return false; + ERR_CHECK_RETURN(sig); mfcompileresolution *resolution = &compiler->resolutions[i]; resolution->fnindex = i; @@ -1220,81 +1223,121 @@ static bool mfcompiler_analyzecandidate(mfcompiler *compiler, int i) { /** Analyze the candidate set for a metafunction. */ static bool mfcompiler_analyze(mfcompiler *compiler) { for (int i=0; inresolutions; i++) { - if (!mfcompiler_analyzecandidate(compiler, i)) return false; + ERR_CHECK_RETURN(mfcompiler_analyzecandidate(compiler, i)); } return true; } -/** Compare resolutions by arity for sorting. */ -static int mfcompiler_compareresolutionarity(const void *a, const void *b) { - int xi=((mfcompileresolution *) a)->nparams, yi=((mfcompileresolution *) b)->nparams; - return (xi > yi) - (xi < yi); // Ascending order +/** Emit one instruction into the resolver. */ +static bool mfcompiler_emit(mfcompiler *compiler, mfinstruction instruction, mfindx *entry) { + if (entry) *entry = compiler->fn->resolver.count; + return varray_mfinstructionadd(&compiler->fn->resolver, &instruction, 1); } -/** Emit one instruction into the resolver. */ -static int mfcompiler_emit(mfcompiler *compiler, mfinstruction instruction) { - return varray_mfinstructionwrite(&compiler->fn->resolver, instruction); +/** Emit multiple instructions into the resolver. */ +static bool mfcompiler_emitmulti(mfcompiler *compiler, int n, mfinstruction *instructions, mfindx *entry) { + if (entry) *entry = compiler->fn->resolver.count; + return varray_mfinstructionadd(&compiler->fn->resolver, instructions, n); } -/** Emit a conservative exact-arity resolver directly into bytecode. */ -static bool mfcompiler_emitarityresolver(mfcompiler *compiler) { - if (compiler->hasvarg) return (mfcompiler_emit(compiler, MFOP_SLOW)>=0); +/** Emit a resolver block that falls back to the slow path. */ +static bool mfcompiler_emitslow(mfcompiler *compiler, mfindx *entry) { + return mfcompiler_emit(compiler, MFOP_SLOW, entry); +} - mfcompileresolution resolutions[compiler->nresolutions]; - memcpy(resolutions, compiler->resolutions, sizeof(mfcompileresolution)*compiler->nresolutions); - qsort(resolutions, compiler->nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); +/** Emit a resolver block that fails dispatch. */ +static bool mfcompiler_emitfail(mfcompiler *compiler, mfindx *entry) { + return mfcompiler_emit(compiler, MFOP_FAIL, entry); +} - int nmatches = 0; - for (int i=0; inresolutions; ) { - int count = 1; - while (i+countnresolutions && - resolutions[i+count].nparams==resolutions[i].nparams) count++; - nmatches++; - i += count; +/** Emit a resolver block that resolves to a specific implementation. */ +static bool mfcompiler_emitresolve(mfcompiler *compiler, int fnindex, mfindx *entry) { + mfinstruction instructions[2] = { MFOP_RESOLVE, fnindex }; + return mfcompiler_emitmulti(compiler, 2, instructions, entry); +} + +/** One entry in a sparse branch table. */ +typedef struct { + int value; + mfindx target; +} mfcompilersparseentry; + +/** Emit a sparse branch over a table of value/target matches. */ +static bool mfcompiler_emitsparse(mfcompiler *compiler, int ncases, mfcompilersparseentry *table, mfindx deflt, mfindx *entry) { + mfinstruction header[3] = { MFOP_SPARSE, ncases, deflt }; + ERR_CHECK_RETURN(mfcompiler_emitmulti(compiler, 3, header, entry)); + + for (int i=0; inparams, yi=((mfcompileresolution *) b)->nparams; + return (xi > yi) - (xi < yi); // Ascending order +} - int defaultpc = mfcompiler_emit(compiler, 0); - if (defaultpc<0) return false; +/** Describes one exact-arity dispatch case. */ +typedef struct { + int arity; + bool resolve; + int fnindex; + mfindx entry; +} mfcompileraritycase; - int targetpc[nmatches]; +/** Builds exact-arity dispatch cases from a sorted resolution list. */ +static int mfcompiler_buildaritycases(mfcompiler *compiler, mfcompileresolution *resolutions, mfcompileraritycase *cases) { int match = 0; + for (int i=0; inresolutions; ) { int arity = resolutions[i].nparams; int count = 1; while (i+countnresolutions && resolutions[i+count].nparams==arity) count++; - if (mfcompiler_emit(compiler, arity)<0) return false; - targetpc[match] = mfcompiler_emit(compiler, 0); - if (targetpc[match]<0) return false; + + cases[match].arity = arity; + cases[match].resolve = (count==1 && !resolutions[i].typed); + cases[match].fnindex = (cases[match].resolve ? resolutions[i].fnindex : -1); + cases[match].entry = -1; match++; i += count; } - compiler->fn->resolver.data[defaultpc] = compiler->fn->resolver.count; - if (mfcompiler_emit(compiler, MFOP_FAIL)<0) return false; + return match; +} - match = 0; - for (int i=0; inresolutions; ) { - int count = 1; - while (i+countnresolutions && - resolutions[i+count].nparams==resolutions[i].nparams) count++; +/** Emit a conservative exact-arity resolver directly into bytecode. */ +static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { + if (compiler->hasvarg) return mfcompiler_emitslow(compiler, entry); - compiler->fn->resolver.data[targetpc[match]] = compiler->fn->resolver.count; - if (count==1 && !resolutions[i].typed) { - if (mfcompiler_emit(compiler, MFOP_RESOLVE)<0) return false; - if (mfcompiler_emit(compiler, resolutions[i].fnindex)<0) return false; - } else { - if (mfcompiler_emit(compiler, MFOP_SLOW)<0) return false; - } + // Sort resolutions by arity + mfcompileresolution resolutions[compiler->nresolutions]; + memcpy(resolutions, compiler->resolutions, sizeof(mfcompileresolution)*compiler->nresolutions); + qsort(resolutions, compiler->nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); - match++; - i += count; + mfcompileraritycase cases[compiler->nresolutions]; + int ncases = mfcompiler_buildaritycases(compiler, resolutions, cases); + + mfindx fail; + ERR_CHECK_RETURN(mfcompiler_emitfail(compiler, &fail)); + + for (int i=0; ientry), metafunction_compile_cleanup); mfcompiler_clear(&compiler); return true; @@ -1358,7 +1401,7 @@ void metafunction_disassemble(objectmetafunction *fn) { printf(":\n"); for (mfindx pc=0; pcresolver.count; ) { - printf("%5i : ", pc); + printf("%s%3i : ", (pc==fn->entry ? "->" : " "), pc); switch (fn->resolver.data[pc]) { case MFOP_SLOW: printf("slow"); pc++; break; case MFOP_FAIL: printf("fail"); pc++; break; @@ -1383,7 +1426,7 @@ static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *a mfinstruction *instructions = fn->resolver.data; if (!instructions) return metafunction_resolveslow(fn, nargs, args, err, out); - mfindx pc = 0; + mfindx pc = fn->entry; int reg = nargs; // Single register initialized with nargs while (true) { diff --git a/src/classes/metafunction.h b/src/classes/metafunction.h index f74bb16d0..c62ac38c2 100644 --- a/src/classes/metafunction.h +++ b/src/classes/metafunction.h @@ -38,6 +38,7 @@ typedef struct sobjectmetafunction { metafunctionstate state; varray_value fns; varray_mfinstruction resolver; + mfindx entry; // Entry point for the resolver } objectmetafunction; /** Gets an objectmetafunction from a value */ From 85013ff8f72891d01bcb39cb8c9457be9ceb5c9f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 25 Apr 2026 17:31:06 -0400 Subject: [PATCH 362/473] Simplify arity checking in mf compiler --- src/classes/metafunction.c | 60 ++++++++++---------------------------- 1 file changed, 16 insertions(+), 44 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 2a886ad35..4c4ed14dd 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -159,7 +159,7 @@ void metafunction_clearinstructions(objectmetafunction *fn) { bool metafunction_finalize(objectmetafunction *fn, error *err) { if (fn->state==METAFUNCTION_FROZEN) return true; if (!metafunction_compile(fn, err)) return false; - metafunction_disassemble(fn); + //metafunction_disassemble(fn); fn->state=METAFUNCTION_FROZEN; return true; } @@ -1281,35 +1281,6 @@ static int mfcompiler_compareresolutionarity(const void *a, const void *b) { return (xi > yi) - (xi < yi); // Ascending order } -/** Describes one exact-arity dispatch case. */ -typedef struct { - int arity; - bool resolve; - int fnindex; - mfindx entry; -} mfcompileraritycase; - -/** Builds exact-arity dispatch cases from a sorted resolution list. */ -static int mfcompiler_buildaritycases(mfcompiler *compiler, mfcompileresolution *resolutions, mfcompileraritycase *cases) { - int match = 0; - - for (int i=0; inresolutions; ) { - int arity = resolutions[i].nparams; - int count = 1; - while (i+countnresolutions && - resolutions[i+count].nparams==arity) count++; - - cases[match].arity = arity; - cases[match].resolve = (count==1 && !resolutions[i].typed); - cases[match].fnindex = (cases[match].resolve ? resolutions[i].fnindex : -1); - cases[match].entry = -1; - match++; - i += count; - } - - return match; -} - /** Emit a conservative exact-arity resolver directly into bytecode. */ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { if (compiler->hasvarg) return mfcompiler_emitslow(compiler, entry); @@ -1319,25 +1290,26 @@ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { memcpy(resolutions, compiler->resolutions, sizeof(mfcompileresolution)*compiler->nresolutions); qsort(resolutions, compiler->nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); - mfcompileraritycase cases[compiler->nresolutions]; - int ncases = mfcompiler_buildaritycases(compiler, resolutions, cases); - - mfindx fail; + mfindx fail; // Emit failure resolution ERR_CHECK_RETURN(mfcompiler_emitfail(compiler, &fail)); - for (int i=0; inresolutions]; + int ncases = 0; + for (int i=0; inresolutions; ) { // Loop over resolutions + int arity = resolutions[i].nparams, count = 1; + while (i+countnresolutions && + resolutions[i+count].nparams==arity) count++; // Count no. of resolutions with this arity - mfcompilersparseentry table[ncases]; - for (int i=0; i Date: Sat, 25 Apr 2026 18:07:31 -0400 Subject: [PATCH 363/473] Improve mf compiler error reporting --- src/classes/metafunction.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 4c4ed14dd..b77ff70ae 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1176,6 +1176,7 @@ typedef struct { /** Compiler state for building a metafunction resolver. */ typedef struct { objectmetafunction *fn; + error *err; mfcompileresolution *resolutions; int nresolutions; bool hasvarg; @@ -1183,8 +1184,9 @@ typedef struct { } mfcompiler; /** Initialize compiler state. */ -static void mfcompiler_init(mfcompiler *compiler, objectmetafunction *fn) { +static void mfcompiler_init(mfcompiler *compiler, objectmetafunction *fn, error *err) { compiler->fn = fn; + compiler->err = err; compiler->nresolutions = fn->fns.count; compiler->hasvarg = false; compiler->hastyped = false; @@ -1198,6 +1200,11 @@ static void mfcompiler_clear(mfcompiler *compiler) { compiler->nresolutions = 0; } +/** Write a compiler error. */ +static void mfcompiler_error(mfcompiler *compiler, errorid id) { + if (compiler->err) error_writewithid(compiler->err, id); +} + /** Analyze one candidate resolution. */ static bool mfcompiler_analyzecandidate(mfcompiler *compiler, int i) { ERR_CHECK_RETURN(compiler->resolutions); @@ -1228,6 +1235,20 @@ static bool mfcompiler_analyze(mfcompiler *compiler) { return true; } +/** Check for duplicate implementations that are unavoidably ambiguous. */ +static bool mfcompiler_checkduplicates(mfcompiler *compiler) { + for (int i=0; inresolutions; i++) { + for (int j=i+1; jnresolutions; j++) { + if (compiler->resolutions[i].varg==compiler->resolutions[j].varg && + signature_isequal(compiler->resolutions[i].sig, compiler->resolutions[j].sig)) { + mfcompiler_error(compiler, METAFUNCTION_CMPLAMBGS); + return false; + } + } + } + return true; +} + /** Emit one instruction into the resolver. */ static bool mfcompiler_emit(mfcompiler *compiler, mfinstruction instruction, mfindx *entry) { if (entry) *entry = compiler->fn->resolver.count; @@ -1317,10 +1338,11 @@ bool metafunction_compile(objectmetafunction *fn, error *err) { if (fn->fns.count<=0) return false; mfcompiler compiler; - mfcompiler_init(&compiler, fn); + mfcompiler_init(&compiler, fn, err); metafunction_clearinstructions(fn); ERR_CHECK(mfcompiler_analyze(&compiler), metafunction_compile_cleanup); + ERR_CHECK(mfcompiler_checkduplicates(&compiler), metafunction_compile_cleanup); ERR_CHECK(mfcompiler_emitarityresolver(&compiler, &fn->entry), metafunction_compile_cleanup); mfcompiler_clear(&compiler); return true; From ecd1043a693ec84dba832b6e66ef95c8b2f708b8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 09:44:29 -0400 Subject: [PATCH 364/473] getuid instruction, disassembly and emitter --- src/classes/metafunction.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index b77ff70ae..5390efc3e 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -159,7 +159,7 @@ void metafunction_clearinstructions(objectmetafunction *fn) { bool metafunction_finalize(objectmetafunction *fn, error *err) { if (fn->state==METAFUNCTION_FROZEN) return true; if (!metafunction_compile(fn, err)) return false; - //metafunction_disassemble(fn); + metafunction_disassemble(fn); fn->state=METAFUNCTION_FROZEN; return true; } @@ -1155,6 +1155,7 @@ enum { MFOP_SLOW, MFOP_RESOLVE, MFOP_FAIL, + MFOP_GETUID, MFOP_SPARSE }; @@ -1271,6 +1272,12 @@ static bool mfcompiler_emitfail(mfcompiler *compiler, mfindx *entry) { return mfcompiler_emit(compiler, MFOP_FAIL, entry); } +/** Emit a resolver block that loads the uid of a given argument. */ +static bool mfcompiler_emitgetuid(mfcompiler *compiler, int arg, mfindx *entry) { + mfinstruction instructions[2] = { MFOP_GETUID, arg }; + return mfcompiler_emitmulti(compiler, 2, instructions, entry); +} + /** Emit a resolver block that resolves to a specific implementation. */ static bool mfcompiler_emitresolve(mfcompiler *compiler, int fnindex, mfindx *entry) { mfinstruction instructions[2] = { MFOP_RESOLVE, fnindex }; @@ -1388,6 +1395,13 @@ static mfindx metafunction_disassemblesparse(objectmetafunction *fn, mfindx pc) return next; } +/** Disassemble a GETUID instruction. */ +static mfindx metafunction_disassemblegetuid(objectmetafunction *fn, mfindx pc) { + if (pc+1>=fn->resolver.count) { printf("getuid "); return pc+1; } + printf("getuid %i", fn->resolver.data[pc+1]); + return pc+2; +} + /** Print a disassembly of the metafunction resolver bytecode. */ void metafunction_disassemble(objectmetafunction *fn) { printf("Resolver for "); @@ -1400,6 +1414,7 @@ void metafunction_disassemble(objectmetafunction *fn) { case MFOP_SLOW: printf("slow"); pc++; break; case MFOP_FAIL: printf("fail"); pc++; break; case MFOP_RESOLVE: pc=metafunction_disassembleresolve(fn, pc); break; + case MFOP_GETUID: pc=metafunction_disassemblegetuid(fn, pc); break; case MFOP_SPARSE: pc=metafunction_disassemblesparse(fn, pc); break; default: printf("unknown %i", fn->resolver.data[pc]); @@ -1425,12 +1440,23 @@ static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *a while (true) { switch (instructions[pc]) { - case MFOP_SLOW: return metafunction_resolveslow(fn, nargs, args, err, out); + case MFOP_SLOW: + return metafunction_resolveslow(fn, nargs, args, err, out); case MFOP_RESOLVE: { pc++; *out=fn->fns.data[instructions[pc]]; return true; } - case MFOP_FAIL: if (err) error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + case MFOP_FAIL: + error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + case MFOP_GETUID: { + int arg = instructions[++pc]; + value type; + if (value_type(args[arg], &type) && MORPHO_ISCLASS(type)) { + reg = MORPHO_GETCLASS(type)->uid; + break; + } + error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + } case MFOP_SPARSE: { int ncases=instructions[pc+1]; mfindx cases=pc+3; @@ -1451,7 +1477,7 @@ static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *a /** Resolve a metafunction using the compiled resolver VM. */ bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { if (fn->state!=METAFUNCTION_FROZEN) { - if (err) error_writewithid(err, METAFUNCTION_UNFROZEN); return false; + error_writewithid(err, METAFUNCTION_UNFROZEN); return false; } return metafunction_runresolver(fn, nargs, args, err, out); From 56599cddccbdea741e95e18b4fc075650b010afb Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 13:08:28 -0400 Subject: [PATCH 365/473] Separate out arity case emission --- src/classes/metafunction.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 5390efc3e..8c9f9e501 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1309,6 +1309,15 @@ static int mfcompiler_compareresolutionarity(const void *a, const void *b) { return (xi > yi) - (xi < yi); // Ascending order } +/** Emit a resolver block for one exact-arity candidate set. */ +static bool mfcompiler_emitaritycase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { + if (nresolutions==1 && !resolutions[0].typed) { + return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); + } + + return mfcompiler_emitslow(compiler, entry); +} + /** Emit a conservative exact-arity resolver directly into bytecode. */ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { if (compiler->hasvarg) return mfcompiler_emitslow(compiler, entry); @@ -1329,9 +1338,7 @@ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { resolutions[i+count].nparams==arity) count++; // Count no. of resolutions with this arity table[ncases].value = arity; // Generate code for this arity - if (count==1 && !resolutions[i].typed) { - ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, resolutions[i].fnindex, &table[ncases].target)); - } else ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &table[ncases].target)); + ERR_CHECK_RETURN(mfcompiler_emitaritycase(compiler, count, &resolutions[i], &table[ncases].target)); ncases++; i += count; From 3d8faadd400be02db28dc226aec97c1c36318e47 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 20:20:58 -0400 Subject: [PATCH 366/473] Typed dispatch --- src/classes/clss.c | 6 +- src/classes/metafunction.c | 136 ++++++++++++++++++++++++++++++++++++- src/core/compile.c | 2 +- 3 files changed, 140 insertions(+), 4 deletions(-) diff --git a/src/classes/clss.c b/src/classes/clss.c index c43e0d2da..ef8a1fdb0 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -46,6 +46,8 @@ objecttypedefn objectclassdefn = { .cmpfn=NULL }; +static int objectclassuid = 0; + objectclass *object_newclass(value name) { objectclass *newclass = (objectclass *) object_new(sizeof(objectclass), OBJECT_CLASS); @@ -56,7 +58,7 @@ objectclass *object_newclass(value name) { varray_valueinit(&newclass->children); varray_valueinit(&newclass->linearization); newclass->superclass=NULL; - newclass->uid=0; + newclass->uid=objectclassuid++; } return newclass; @@ -220,7 +222,7 @@ void class_initialize(void) { value classclass=builtin_addclass(CLASS_CLASSNAME, MORPHO_GETCLASSDEFINITION(Class), objclass); object_setveneerclass(OBJECT_CLASS, classclass); - // No constructor function; classes are generated by the compiler + // No constructor function; classes are created internally // Class error messages } diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 8c9f9e501..f4a3f63fb 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -159,7 +159,7 @@ void metafunction_clearinstructions(objectmetafunction *fn) { bool metafunction_finalize(objectmetafunction *fn, error *err) { if (fn->state==METAFUNCTION_FROZEN) return true; if (!metafunction_compile(fn, err)) return false; - metafunction_disassemble(fn); + //metafunction_disassemble(fn); fn->state=METAFUNCTION_FROZEN; return true; } @@ -1303,6 +1303,135 @@ static bool mfcompiler_emitsparse(mfcompiler *compiler, int ncases, mfcompilersp return true; } +/** Check if any resolutions in a candidate set use typed parameters. */ +static bool mfcompiler_hastypedresolutions(int nresolutions, mfcompileresolution *resolutions) { + for (int i=0; icases); + plan->defaultfnindex = -1; +} + +/** Choose a typed argument to branch on, if one exists. */ +static bool mfcompiler_choosetypeparam(int nresolutions, mfcompileresolution *resolutions, int *param) { + int bestparam = -1, bestcount = 1; + + for (int i=0; ibestcount) { bestcount = count; bestparam = i; } + } + + *param = bestparam; + return (bestparam>=0); +} + +/** Build a typed dispatch plan for one argument. */ +static bool mfcompiler_buildtypeplan(int nresolutions, mfcompileresolution *resolutions, int param, mfcompilertypeplan *plan) { + value types[nresolutions]; + + varray_mfcompilertypecaseinit(&plan->cases); + plan->defaultfnindex = -1; + + for (int i=0; idefaultfnindex<0, mfcompiler_buildtypeplan_cleanup); + plan->defaultfnindex = resolutions[i].fnindex; + continue; + } else if (!MORPHO_ISCLASS(type)) goto mfcompiler_buildtypeplan_cleanup; + + for (int j=0; jcases.count; j++) { + int uid = MORPHO_GETCLASS(type)->uid; + ERR_CHECK(MORPHO_GETCLASS(type)->uid != plan->cases.data[j].uid, mfcompiler_buildtypeplan_cleanup); + ERR_CHECK(!value_typematch(type, types[j]) && !value_typematch(types[j], type), mfcompiler_buildtypeplan_cleanup); + } + + types[plan->cases.count] = type; + mfcompilertypecase newcase = { .uid = MORPHO_GETCLASS(type)->uid, .fnindex = resolutions[i].fnindex }; + ERR_CHECK(varray_mfcompilertypecaseadd(&plan->cases, &newcase, 1), mfcompiler_buildtypeplan_cleanup); + } + + return (plan->cases.count>0); + +mfcompiler_buildtypeplan_cleanup: + mfcompiler_cleartypeplan(plan); + return false; +} + +/** Emit bytecode for a typed dispatch plan. */ +static bool mfcompiler_emittypeplan(mfcompiler *compiler, mfcompilertypeplan *plan, mfindx *entry) { + mfindx deflt; + // If a default resolution exists, generate a resolution + if (plan->defaultfnindex>=0) ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, plan->defaultfnindex, &deflt)); + else ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &deflt)); + + mfcompilersparseentry table[plan->cases.count]; // Generate resolutions compile table + for (int i=0; icases.count; i++) { + table[i].value = plan->cases.data[i].uid; + ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, plan->cases.data[i].fnindex, &table[i].target)); + } + + // Output bytecode for the branch + ERR_CHECK_RETURN(mfcompiler_emitgetuid(compiler, plan->arg, entry)); + return mfcompiler_emitsparse(compiler, plan->cases.count, table, deflt, NULL); +} + +/** Try to emit typed dispatch for one exact-arity candidate set. */ +static bool mfcompiler_emittypedcase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { + int param; + mfcompilertypeplan plan = { .arg=-1, .defaultfnindex=-1 }; + varray_mfcompilertypecaseinit(&plan.cases); + + ERR_CHECK(mfcompiler_choosetypeparam(nresolutions, resolutions, ¶m), mfcompiler_emittypedcase_cleanup); + ERR_CHECK(mfcompiler_buildtypeplan(nresolutions, resolutions, param, &plan), mfcompiler_emittypedcase_cleanup); + + plan.arg = param; + ERR_CHECK(mfcompiler_emittypeplan(compiler, &plan, entry), mfcompiler_emittypedcase_cleanup); + mfcompiler_cleartypeplan(&plan); + return true; + +mfcompiler_emittypedcase_cleanup: + mfcompiler_cleartypeplan(&plan); + return false; +} + /** Compare resolutions by arity for sorting. */ static int mfcompiler_compareresolutionarity(const void *a, const void *b) { int xi=((mfcompileresolution *) a)->nparams, yi=((mfcompileresolution *) b)->nparams; @@ -1315,6 +1444,11 @@ static bool mfcompiler_emitaritycase(mfcompiler *compiler, int nresolutions, mfc return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); } + if (mfcompiler_hastypedresolutions(nresolutions, resolutions) && + mfcompiler_emittypedcase(compiler, nresolutions, resolutions, entry)) { + return true; + } + return mfcompiler_emitslow(compiler, entry); } diff --git a/src/core/compile.c b/src/core/compile.c index 811264283..86d1520ac 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -368,7 +368,7 @@ static objectclass *compiler_getcurrentclass(compiler *c) { /** Adds an objectclass to the compilers dictionary of classes */ void compiler_addclass(compiler *c, objectclass *klass) { - klass->uid = program_addclass(c->out, MORPHO_OBJECT(klass)); + program_addclass(c->out, MORPHO_OBJECT(klass)); dictionary_insert(&c->classes, klass->name, MORPHO_OBJECT(klass)); } From 6dbeca1cf4346747aea47a6fa80edce5dbb2fcee Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 21:30:53 -0400 Subject: [PATCH 367/473] Fix resolvetypecase --- src/classes/metafunction.c | 99 ++++++++++++++++++++++++++++++++------ 1 file changed, 85 insertions(+), 14 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index f4a3f63fb..b8e0cae98 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1320,7 +1320,7 @@ static int mfcompiler_counttypesforparam(int nresolutions, mfcompileresolution * MORPHO_ISCLASS(type)) dictionary_insert(&dict, type, MORPHO_NIL); else wildcard=true; } - int count = dict.count + (wildcard ? 1 : 0); + int count = dict.count + ((dict.count>0 && wildcard) ? 1 : 0); dictionary_clear(&dict); return count; } @@ -1349,7 +1349,7 @@ static void mfcompiler_cleartypeplan(mfcompilertypeplan *plan) { /** Choose a typed argument to branch on, if one exists. */ static bool mfcompiler_choosetypeparam(int nresolutions, mfcompileresolution *resolutions, int *param) { - int bestparam = -1, bestcount = 1; + int bestparam = -1, bestcount = 0; for (int i=0; i=0); } +/** Insert a class and all of its descendants into a dictionary. */ +static bool mfcompiler_insertchildren(dictionary *dict, value type) { + if (!MORPHO_ISCLASS(type) || dictionary_get(dict, type, NULL)) return true; + + ERR_CHECK_RETURN(dictionary_insert(dict, type, MORPHO_NIL)); + objectclass *klass = MORPHO_GETCLASS(type); + for (int i=0; ichildren.count; i++) { + ERR_CHECK_RETURN(mfcompiler_insertchildren(dict, klass->children.data[i])); + } + + return true; +} + +/** Choose the best resolution for a given runtime class at one parameter. */ +static bool mfcompiler_resolvetypecase(int nresolutions, mfcompileresolution *resolutions, int param, value actual, int *fnindex) { + int best = -1, bestrank = INT_MAX, bestcount = 0, rank; + + for (int i=0; icases); plan->defaultfnindex = -1; + + dictionary children; + dictionary_init(&children); // Maintain dictionary of resolution classes and their children - for (int i=0; idefaultfnindex<0, mfcompiler_buildtypeplan_cleanup); plan->defaultfnindex = resolutions[i].fnindex; continue; - } else if (!MORPHO_ISCLASS(type)) goto mfcompiler_buildtypeplan_cleanup; + } else ERR_CHECK(MORPHO_ISCLASS(type), mfcompiler_buildtypeplan_cleanup); + ERR_CHECK(mfcompiler_insertchildren(&children, type), mfcompiler_buildtypeplan_cleanup); + } - for (int j=0; jcases.count; j++) { - int uid = MORPHO_GETCLASS(type)->uid; - ERR_CHECK(MORPHO_GETCLASS(type)->uid != plan->cases.data[j].uid, mfcompiler_buildtypeplan_cleanup); - ERR_CHECK(!value_typematch(type, types[j]) && !value_typematch(types[j], type), mfcompiler_buildtypeplan_cleanup); - } + for (unsigned int i=0; idefaultfnindex) continue; - types[plan->cases.count] = type; - mfcompilertypecase newcase = { .uid = MORPHO_GETCLASS(type)->uid, .fnindex = resolutions[i].fnindex }; + mfcompilertypecase newcase = { .uid = MORPHO_GETCLASS(type)->uid, .fnindex = fnindex }; ERR_CHECK(varray_mfcompilertypecaseadd(&plan->cases, &newcase, 1), mfcompiler_buildtypeplan_cleanup); } + dictionary_clear(&children); return (plan->cases.count>0); mfcompiler_buildtypeplan_cleanup: + dictionary_clear(&children); mfcompiler_cleartypeplan(plan); return false; } @@ -1405,7 +1475,8 @@ static bool mfcompiler_emittypeplan(mfcompiler *compiler, mfcompilertypeplan *pl mfcompilersparseentry table[plan->cases.count]; // Generate resolutions compile table for (int i=0; icases.count; i++) { table[i].value = plan->cases.data[i].uid; - ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, plan->cases.data[i].fnindex, &table[i].target)); + if (plan->cases.data[i].fnindex>=0) ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, plan->cases.data[i].fnindex, &table[i].target)); + else ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &table[i].target)); } // Output bytecode for the branch From 8fe087c4552096e39c7c777cf68ffd1fe261fb6b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 21:45:18 -0400 Subject: [PATCH 368/473] Basic varg support --- src/classes/metafunction.c | 54 ++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index b8e0cae98..92cec6d20 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1509,12 +1509,32 @@ static int mfcompiler_compareresolutionarity(const void *a, const void *b) { return (xi > yi) - (xi < yi); // Ascending order } +/** Emit an untyped exact-arity case if a unique arity-specific winner exists. */ +static bool mfcompiler_emituntypedcase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { + int winner = -1; + + for (int i=0; i=0) return false; + winner = i; + } + + if (winner>=0) return mfcompiler_emitresolve(compiler, resolutions[winner].fnindex, entry); + if (nresolutions==1) return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); + return false; +} + /** Emit a resolver block for one exact-arity candidate set. */ static bool mfcompiler_emitaritycase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { if (nresolutions==1 && !resolutions[0].typed) { return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); } + if (!mfcompiler_hastypedresolutions(nresolutions, resolutions) && + mfcompiler_emituntypedcase(compiler, nresolutions, resolutions, entry)) { + return true; + } + if (mfcompiler_hastypedresolutions(nresolutions, resolutions) && mfcompiler_emittypedcase(compiler, nresolutions, resolutions, entry)) { return true; @@ -1525,31 +1545,43 @@ static bool mfcompiler_emitaritycase(mfcompiler *compiler, int nresolutions, mfc /** Emit a conservative exact-arity resolver directly into bytecode. */ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { - if (compiler->hasvarg) return mfcompiler_emitslow(compiler, entry); - // Sort resolutions by arity mfcompileresolution resolutions[compiler->nresolutions]; memcpy(resolutions, compiler->resolutions, sizeof(mfcompileresolution)*compiler->nresolutions); qsort(resolutions, compiler->nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); - mfindx fail; // Emit failure resolution - ERR_CHECK_RETURN(mfcompiler_emitfail(compiler, &fail)); + mfindx deflt; // Emit default resolution + if (compiler->hasvarg) ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &deflt)); + else ERR_CHECK_RETURN(mfcompiler_emitfail(compiler, &deflt)); mfcompilersparseentry table[compiler->nresolutions]; int ncases = 0; for (int i=0; inresolutions; ) { // Loop over resolutions - int arity = resolutions[i].nparams, count = 1; - while (i+countnresolutions && - resolutions[i+count].nparams==arity) count++; // Count no. of resolutions with this arity + if (resolutions[i].varg) { + i++; + continue; + } - table[ncases].value = arity; // Generate code for this arity - ERR_CHECK_RETURN(mfcompiler_emitaritycase(compiler, count, &resolutions[i], &table[ncases].target)); + int arity = resolutions[i].nparams; + while (inresolutions && + !resolutions[i].varg && + resolutions[i].nparams==arity) i++; + + mfcompileresolution bucket[compiler->nresolutions]; + int count = 0; + for (int j=0; jnresolutions; j++) { + if (resolutions[j].minarity<=arity && + (resolutions[j].maxarity<0 || arity<=resolutions[j].maxarity)) { + bucket[count++] = resolutions[j]; + } + } + table[ncases].value = arity; // Generate code for this arity + ERR_CHECK_RETURN(mfcompiler_emitaritycase(compiler, count, bucket, &table[ncases].target)); ncases++; - i += count; } - return mfcompiler_emitsparse(compiler, ncases, table, fail, entry); // Emit the sparse table + return mfcompiler_emitsparse(compiler, ncases, table, deflt, entry); // Emit the sparse table } /** Compiles the resolver for a metafunction that is still being assembled. */ From 3d4823effe73d35f2a1fd1401480d799805c5fea Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 21:51:04 -0400 Subject: [PATCH 369/473] Remove old resolver --- src/classes/metafunction.c | 753 ------------------------------------- 1 file changed, 753 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 92cec6d20..91bbed51f 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -198,759 +198,6 @@ value metafunction_getname(value fn) { return MORPHO_NIL; } -/* ********************************************************************** - * Fast metafunction resolver - * ********************************************************************** */ - -// DEFINE_VARRAY(mfinstruction, mfinstruction); -// -// #define MFINSTRUCTION_EMPTY -1 -// -// #define MFINSTRUCTION_FAIL { .opcode=MF_FAIL, .branch=MFINSTRUCTION_EMPTY } -// #define MFINSTRUCTION_RESOLVE(fn) { .opcode=MF_RESOLVE, .data.resolvefn=fn, .branch=MFINSTRUCTION_EMPTY } -// #define MFINSTRUCTION_OPTARGS { .opcode=MF_OPTARGS, .branch=MFINSTRUCTION_EMPTY } -// #define MFINSTRUCTION_CHECKNARGS(op, n, brnch) { .opcode=op, .narg=n, .branch=brnch } -// #define MFINSTRUCTION_CHECKTYPE(op, n, t, brnch) { .opcode=op, .data.tindx=t, .narg=n, .branch=brnch } -// #define MFINSTRUCTION_BRANCH(brnch) { .opcode=MF_BRANCH, .branch=brnch } -// #define MFINSTRUCTION_BRANCHNARG(table, brnch) { .opcode=MF_BRANCHNARGS, .data.btable=table, .branch=brnch } -// #define MFINSTRUCTION_BRANCHTABLE(op, n, table, brnch) { .opcode=op, .narg=n, .data.btable=table, .branch=brnch } -// -// typedef struct { -// signature *sig; /** Signature of the target */ -// value fn; /** The target */ -// int indx; /** Used to sort */ -// } mfresult; -// -// typedef struct { -// int count; -// mfresult *rlist; -// } mfset; -// -// /** Static intiializer for the mfset */ -// #define MFSET(c, l) { .count=c, .rlist=l } -// -// DECLARE_VARRAY(mfset, mfset) -// DEFINE_VARRAY(mfset, mfset) -// -// typedef struct { -// objectmetafunction *fn; -// varray_int checked; // Stack of checked parameters -// bool varchecked; // Have we checked for a variadic function? -// error err; -// } mfcompiler; -// -// /** Initialize the metafunction compiler */ -// void mfcompiler_init(mfcompiler *c, objectmetafunction *fn) { -// c->fn=fn; -// varray_intinit(&c->checked); -// error_init(&c->err); -// c->varchecked=false; -// } -// -// /** Clear the metafunction compiler */ -// void mfcompiler_clear(mfcompiler *c, objectmetafunction *fn) { -// varray_intclear(&c->checked); -// error_clear(&c->err); -// } -// -// /** Report an error during metafunction compilation */ -// void mfcompiler_error(mfcompiler *c, errorid id) { -// morpho_writeerrorwithid(&c->err, id, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); -// } -// -// /** Pushes a parameter check onto the stack*/ -// void mfcompiler_pushcheck(mfcompiler *c, int i) { -// varray_intwrite(&c->checked, i); -// } -// -// /** Pops a parameter check from the stack*/ -// int mfcompiler_popcheck(mfcompiler *c) { -// c->checked.count--; -// return c->checked.data[c->checked.count]; -// } -// -// /** Tests if a parameter has been checked according to the check stack */ -// bool mfcompiler_ischecked(mfcompiler *c, int i) { -// for (int j=0; jchecked.count; j++) if (i==c->checked.data[j]) return true; -// return false; -// } -// -// void _mfcompiler_disassemblebranchtable(mfinstruction *instr, mfindx i) { -// for (int k=0; kdata.btable.count; k++) { -// printf(" %i -> %i\n", k, i+instr->data.btable.data[k]+1); -// } -// } -// -// /** Disassemble */ -// void mfcompiler_disassemble(mfcompiler *c) { -// int ninstr = c->fn->resolver.count; -// morpho_printvalue(NULL, MORPHO_OBJECT(c->fn)); -// printf(":\n"); -// for (int i=0; ifn->resolver.data[i]; -// printf("%5i : ", i) ; -// switch(instr->opcode) { -// case MF_CHECKNARGSNEQ: { -// printf("checknargsneq %i -> (%i)", instr->narg, i+instr->branch+1); -// break; -// } -// case MF_CHECKNARGSLT: { -// printf("checknargslt %i -> (%i)", instr->narg, i+instr->branch+1); -// break; -// } -// case MF_CHECKVALUE: { -// objectclass *klass=value_veneerclassfromtype(instr->data.tindx); -// printf("checkvalue (%i) [%s] -> (%i)", instr->narg, MORPHO_GETCSTRING(klass->name), i+instr->branch+1); -// break; -// } -// case MF_CHECKOBJECT: { -// objectclass *klass=object_getveneerclass(instr->data.tindx); -// printf("checkobject (%i) [%s] -> (%i)", instr->narg, MORPHO_GETCSTRING(klass->name), i+instr->branch+1); -// break; -// } -// case MF_CHECKINSTANCE: { -// printf("checkinstance (%i) [%i] -> (%i)", instr->narg, instr->data.tindx, i+instr->branch+1); -// break; -// } -// case MF_BRANCH: { -// printf("branch -> (%i)", i+instr->branch+1); -// break; -// } -// case MF_BRANCHNARGS: { -// printf("branchnargs (%i) -> (%i)\n", instr->narg, i+instr->branch+1); -// _mfcompiler_disassemblebranchtable(instr, i); -// break; -// } -// case MF_BRANCHVALUETYPE: { -// printf("branchvalue (%i) -> (%i)\n", instr->narg, i+instr->branch+1); -// for (int k=0; kdata.btable.count; k++) { -// if (instr->data.btable.data[k]==0) continue; -// objectclass *klass=value_veneerclassfromtype(k); -// printf(" %i [%s] -> %i\n", k, (klass ? MORPHO_GETCSTRING(klass->name) : ""), i+instr->data.btable.data[k]+1); -// } -// break; -// } -// case MF_BRANCHOBJECTTYPE: { -// printf("branchobjtype (%i) -> (%i)\n", instr->narg, i+instr->branch+1); -// for (int k=0; kdata.btable.count; k++) { -// if (instr->data.btable.data[k]==0) continue; -// objectclass *klass=object_getveneerclass(k); -// printf(" %i [%s] -> %i\n", k, (klass ? MORPHO_GETCSTRING(klass->name) : ""), i+instr->data.btable.data[k]+1); -// } -// break; -// } -// case MF_BRANCHINSTANCE: { -// printf("branchinstance (%i) -> (%i)\n", instr->narg, i+instr->branch+1); -// _mfcompiler_disassemblebranchtable(instr, i); -// break; -// } -// case MF_RESOLVE: { -// printf("resolve "); -// signature *sig = metafunction_getsignature(instr->data.resolvefn); -// printf(" "); -// if (sig) signature_print(sig); -// break; -// } -// case MF_FAIL: printf("fail"); break; -// } -// printf("\n"); -// } -// } -// -// /** Counts the range of parameters for the function call */ -// void mfcompile_countparams(mfcompiler *c, mfset *set, int *min, int *max) { -// int imin=INT_MAX, imax=INT_MIN; -// for (int i=0; icount; i++) { -// int nparams; -// signature_paramlist(set->rlist[i].sig, &nparams, NULL); -// if (nparamsimax) imax=nparams; -// } -// if (min) *min = imin; -// if (max) *max = imax; -// } -// -// /** Check if a set contains a variadic */ -// bool mfcompile_containsvariadic(mfcompiler *c, mfset *set) { -// for (int i=0; icount; i++) { -// if (signature_isvarg(set->rlist[i].sig)) return true; -// } -// return false; -// } -// -// /** Places the various outcomes for a parameter into a dictionary */ -// bool mfcompile_outcomes(mfcompiler *c, mfset *set, int i, dictionary *out) { -// for (int k=0; kcount; k++) { // Loop over outcomes -// value type; -// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) continue; -// if (!dictionary_insert(out, (MORPHO_ISNIL(type) ? MORPHO_FALSE : type), MORPHO_NIL)) return false; -// } -// return true; -// } -// -// /** Find the parameter number that has most variety in types */ -// bool mfcompile_countoutcomes(mfcompiler *c, mfset *set, int *best) { -// varray_int count; -// varray_intinit(&count); -// -// dictionary dict; -// dictionary_init(&dict); -// -// // Loop over parameters, counting the number of outcomes. -// while (true) { -// mfcompile_outcomes(c, set, count.count, &dict); -// if (!dict.count) break; -// varray_intwrite(&count, dict.count); -// dictionary_clear(&dict); // Not needed if dict.count was zero -// }; -// -// // Find the parameter that has most variability that has not already been checked -// int max=0, maxindx=-1; -// for (int i=0; imax) { max=count.data[i]; maxindx=i; } -// } -// -// varray_intclear(&count); -// -// if (maxindx<0) return false; -// if (best) *best = maxindx; -// -// return true; -// } -// -// mfindx mfcompile_insertinstruction(mfcompiler *c, mfinstruction instr) { -// return varray_mfinstructionwrite(&c->fn->resolver, instr); -// } -// -// mfindx mfcompile_currentinstruction(mfcompiler *c) { -// return c->fn->resolver.count-1; -// } -// -// mfindx mfcompile_nextinstruction(mfcompiler *c) { -// return c->fn->resolver.count; -// } -// -// void mfcompile_setbranch(mfcompiler *c, mfindx i, mfindx branch) { -// if (i>=c->fn->resolver.count) return; -// c->fn->resolver.data[i].branch=branch; -// } -// -// void mfcompile_replaceinstruction(mfcompiler *c, mfindx i, mfinstruction instr) { -// if (i>=c->fn->resolver.count) return; -// c->fn->resolver.data[i] = instr; -// } -// -// enum { -// MF_VENEERVALUE, -// MF_INSTANCE, -// MF_VENEEROBJECT, -// MF_ANY -// }; -// -// /** Detects the kind of type */ -// int _detecttype(value type, int *tindx) { -// if (MORPHO_ISCLASS(type)) { -// objectclass *klass = MORPHO_GETCLASS(type); -// if (object_veneerclasstotype(klass, tindx)) { -// return MF_VENEEROBJECT; -// } else if (value_veneerclasstotype(klass, tindx)) { -// return MF_VENEERVALUE; -// } else { -// if (tindx) *tindx=klass->uid; -// return MF_INSTANCE; -// } -// } -// return MF_ANY; -// } -// -// mfindx mfcompile_fail(mfcompiler *c); -// mfindx mfcompile_resolve(mfcompiler *c, mfresult *res); -// mfindx mfcompile_dispatchonparam(mfcompiler *c, mfset *set, int i); -// mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max); -// mfindx mfcompile_set(mfcompiler *c, mfset *set); -// -// /** Inserts a fail instruction */ -// mfindx mfcompile_fail(mfcompiler *c) { -// mfinstruction fail = MFINSTRUCTION_FAIL; -// return mfcompile_insertinstruction(c, fail); -// } -// -// /** Checks a parameter i for type */ -// mfindx mfcompile_check(mfcompiler *c, int i, value type) { -// int tindx; -// int opcode[MF_ANY] = { MF_CHECKVALUE, MF_CHECKINSTANCE, MF_CHECKOBJECT }; -// int k=_detecttype(type, &tindx); -// -// if (k==MF_ANY) return MFINSTRUCTION_EMPTY; -// -// mfinstruction check = MFINSTRUCTION_CHECKTYPE(opcode[k], i, tindx, 0); -// return mfcompile_insertinstruction(c, check); -// } -// -// /** Compiles a single result */ -// mfindx mfcompile_resolve(mfcompiler *c, mfresult *res) { -// mfindx start = mfcompile_nextinstruction(c); -// -// // Check all arguments have been resolved -// signature *sig = res->sig; -// for (int i=0; itypes.count; i++) { -// if (MORPHO_ISNIL(sig->types.data[i]) || -// mfcompiler_ischecked(c, i)) continue; -// -// mfcompile_check(c, i, sig->types.data[i]); -// } -// -// mfindx end = mfcompile_nextinstruction(c); -// -// mfinstruction instr = MFINSTRUCTION_RESOLVE(res->fn); -// mfcompile_insertinstruction(c, instr); -// -// if (start!=end) { -// mfindx fail = mfcompile_fail(c); -// for (mfindx i=start; icount && set->rlist[k].indx<0) k++; -// -// // Deal with each outcome -// while (kcount) { -// int indx=set->rlist[k].indx, n=0; -// while (k+ncount && set->rlist[k+n].indx==indx) n++; -// -// mfset out = MFSET(n, &set->rlist[k]); -// -// // Set the branch point -// btable->data[indx]=mfcompile_currentinstruction(c)-bindx; -// mfcompile_set(c, &out); -// -// k+=n; -// } -// } -// -// void _insertchildren(dictionary *dict, value v) { -// if (!MORPHO_ISCLASS(v) || -// dictionary_get(dict, v, NULL)) return; -// -// dictionary_insert(dict, v, MORPHO_NIL); // Insert the class -// objectclass *klass = MORPHO_GETCLASS(v); // and its children -// for (int i=0; ichildren.count; i++) _insertchildren(dict, klass->children.data[i]); -// } -// -// bool _resolve(objectclass *klass, dictionary *types, value *out) { -// for (int k=0; klinearization.count; k++) { -// if (dictionary_get(types, klass->linearization.data[k], NULL)) { -// *out = klass->linearization.data[k]; -// return true; -// } -// } -// return false; -// } -// -// int _maxindx(dictionary *dict) { -// int indx=0, maxindx=0; -// for (int i=0; icapacity; i++) { -// _detecttype(dict->contents[i].key, &indx); -// if (indx>maxindx) maxindx=indx; -// } -// return maxindx; -// } -// -// int _mfresultsortfn (const void *a, const void *b) { -// mfresult *aa = (mfresult *) a, *bb = (mfresult *) b; -// -// int ai = aa->indx, bi = bb->indx; -// if (aa->sig->varg) ai=-1; // Ensure vargs end up first -// if (bb->sig->varg) bi=-1; -// -// return ai-bi; -// } -// -// /** Constructs a dispatch table from the set of implementations */ -// mfindx mfcompile_dispatchtable(mfcompiler *c, mfset *set, int i, int otype, int opcode) { -// dictionary types, children; -// dictionary_init(&types); // Keep track of the available types provided by the implementation -// dictionary_init(&children); // and all of their children -// -// // Extract the type index for each member of the set -// for (int k=0; kcount; k++) { -// value type; -// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) UNREACHABLE("Incorrect parameter type"); -// if (_detecttype(type, &set->rlist[k].indx)==otype) { -// dictionary_insert(&types, type, MORPHO_NIL); -// _insertchildren(&children, type); -// } else set->rlist[k].indx=-1; // Exclude from the branch table -// } -// -// // Sort the set on the type index -// qsort(set->rlist, set->count, sizeof(mfresult), _mfresultsortfn); -// -// // Create the branch table -// int maxindx=_maxindx(&children); -// varray_int btable; -// varray_intinit(&btable); -// for (int i=0; i<=maxindx; i++) varray_intwrite(&btable, 0); -// -// // Insert the branch instruction -// mfinstruction instr = MFINSTRUCTION_BRANCHTABLE(opcode, i, btable, 0); -// mfindx bindx = mfcompile_insertinstruction(c, instr); -// -// // Fail if an object type isn't in the table -// mfcompile_fail(c); -// -// // Compile the branch table -// mfcompile_branchtable(c, set, bindx, &btable); -// -// // Fix branch table to include child classes -// for (int i=0; icount]; -// int n=0; -// -// // Find implementations that accept any type -// for (int k=0; kcount; k++) { -// value type; -// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) return MFINSTRUCTION_EMPTY; -// if (_detecttype(type, &set->rlist[k].indx)==MF_ANY) { -// rlist[n] = set->rlist[k]; n++; -// } -// } -// -// mfindx bindx = mfcompile_nextinstruction(c); -// -// mfset anyset = MFSET(n, rlist); -// mfcompile_set(c, &anyset); -// -// return bindx; -// } -// -// /** Fixes a fallthrough fail */ -// void mfcompile_fixfallthrough(mfcompiler *c, mfindx i, mfindx branchto) { -// mfinstruction instr = MFINSTRUCTION_BRANCH(branchto-i-1); -// mfcompile_replaceinstruction(c, i, instr); -// } -// -// typedef mfindx (mfcompile_dispatchfn) (mfcompiler *c, mfset *set, int i); -// -// /** Attempts to dispatch based on a parameter i */ -// mfindx mfcompile_dispatchonparam(mfcompiler *c, mfset *set, int i) { -// mfcompiler_pushcheck(c, i); -// int typecount[MF_ANY+1] = { 0, 0, 0, 0}; -// -// // Determine what types are present -// for (int k=0; kcount; k++) { -// value type; -// if (!signature_getparamtype(set->rlist[k].sig, i, &type)) continue; -// typecount[_detecttype(type, NULL)]++; -// } -// -// mfindx bindx[MF_ANY+1]; -// mfcompile_dispatchfn *dfn[MF_ANY+1] = { mfcompile_dispatchveneervalue, -// mfcompile_dispatchinstance, -// mfcompile_dispatchveneerobj, -// mfcompile_dispatchany}; -// -// // Cycle through all value types, building a chain of branchtables -// int n=0; -// for (int j=0; j<=MF_ANY; j++) { -// if (typecount[j] && dfn[j]) { -// bindx[n]=(dfn[j]) (c, set, i); -// if (n>0) mfcompile_setbranch(c, bindx[n-1], bindx[n]-bindx[n-1]-1); -// n++; -// } -// } -// -// if (typecount[MF_ANY]) { // Fix branch table fallthroughs to point to any -// for (int j=0; jsig) ? MF_CHECKNARGSLT : MF_CHECKNARGSNEQ ), signature_countparams(res->sig), 0); -// mfindx bindx = mfcompile_insertinstruction(c, instr); // Write the check nargs instruction -// -// mfcompile_resolve(c, res); -// -// return bindx; -// } -// -// /** Attempts to dispatch based on the number of arguments */ -// mfindx mfcompile_dispatchonnarg(mfcompiler *c, mfset *set, int min, int max) { -// mfindx bindx = MFINSTRUCTION_EMPTY; -// -// // Sort the set into order given by number of parameters; resolution with varg is always first -// for (int k=0; kcount; k++) { -// set->rlist[k].indx=signature_countparams(set->rlist[k].sig); -// } -// qsort(set->rlist, set->count, sizeof(mfresult), _mfresultsortfn); -// -// if (set->count==2) { -// for (int i=1; i>=0; i--) { -// bindx = mfcompile_checknarg(c, &set->rlist[i]); -// -// mfindx eindx = mfcompile_currentinstruction(c); -// mfcompile_setbranch(c, bindx, eindx-bindx); -// } -// mfcompile_fail(c); -// } else { // If more than two options, generate a branch table -// varray_int btable; -// varray_intinit(&btable); -// for (int i=0; i<=max; i++) varray_intwrite(&btable, 0); -// -// // Insert the branch table instruction -// mfinstruction table = MFINSTRUCTION_BRANCHNARG(btable, 0); -// bindx = mfcompile_insertinstruction(c, table); -// -// // Immediately follow by a fail instruction if this falls through -// mfindx fail = mfcompile_fail(c); -// -// // Compile the branch table -// mfcompile_branchtable(c, set, bindx, &btable); -// -// // Insert variadic resolution into branch table if necessary -// if (set->rlist[0].sig->varg) { -// mfinstruction vargres = MFINSTRUCTION_RESOLVE(set->rlist[0].fn); -// mfindx varg = mfcompile_insertinstruction(c, vargres)-1; -// -// int nmin = set->rlist[0].sig->types.count-1; // varg can match this many args or more -// for (int i=nmin; icount==1) return mfcompile_resolve(c, set->rlist); -// -// int min, max; // Count the range of possible parameters -// mfcompile_countparams(c, set, &min, &max); -// -// bool isvariadic = mfcompile_containsvariadic(c, set); -// -// // Dispatch on the number of parameters if it's in doubt -// if (min!=max || (isvariadic && !c->varchecked)) { -// c->varchecked=true; -// return mfcompile_dispatchonnarg(c, set, min, max); -// } -// -// // If just one parameter, dispatch on it -// if (min==1 && !mfcompiler_ischecked(c, 0)) { -// return mfcompile_dispatchonparam(c, set, 0); -// } -// -// int best; -// if (mfcompile_countoutcomes(c, set, &best)) return mfcompile_dispatchonparam(c, set, best); -// -// mfcompiler_error(c, METAFUNCTION_CMPLAMBGS); -// return MFINSTRUCTION_EMPTY; -// } -// -// /** Clears the compiled code from a given metafunction */ -// void metafunction_clearinstructions(objectmetafunction *fn) { -// for (int i=0; iresolver.count; i++) { -// mfinstruction *mf = &fn->resolver.data[i]; -// if (mf->opcode>=MF_BRANCHNARGS && mf->opcode<=MF_BRANCHINSTANCE) varray_intclear(&mf->data.btable); -// } -// varray_mfinstructionclear(&fn->resolver); -// } -// -// /** Compiles the resolver for a metafunction that is still being assembled */ -// bool metafunction_compile(objectmetafunction *fn, error *err) { -// mfset set; -// set.count = fn->fns.count; -// if (!set.count) return false; -// -// mfresult rlist[set.count]; -// set.rlist=rlist; -// for (int i=0; ifns.data[i]); -// rlist[i].fn=fn->fns.data[i]; -// } -// -// mfcompiler compiler; -// mfcompiler_init(&compiler, fn); -// -// mfcompile_set(&compiler, &set); -// //mfcompiler_disassemble(&compiler); -// -// bool success=!morpho_checkerror(&compiler.err); -// if (!success && err) *err=compiler.err; -// -// mfcompiler_clear(&compiler, fn); -// -// return success; -// } -// -// /** Finalizes a metafunction, compiling its resolver once the implementation set is complete */ -// bool metafunction_finalize(objectmetafunction *fn, error *err) { -// if (fn->state==METAFUNCTION_FROZEN) return true; -// -// if (!metafunction_compile(fn, err)) return false; -// fn->state=METAFUNCTION_FROZEN; -// -// return true; -// } -// -// /** Finalizes any metafunctions stored in a linked object list */ -// bool metafunction_finalizelist(object *list, error *err) { -// for (object *obj=list; obj!=NULL; obj=obj->next) { -// if (obj->type==OBJECT_METAFUNCTION && -// !metafunction_finalize((objectmetafunction *) obj, err)) { -// return false; -// } -// } -// -// return true; -// } -// -// /** Attempt to find the desired class uid in the linearization of a given class */ -// bool _finduidinlinearization(objectclass *klass, int uid) { -// for (int k=0; klinearization.count; k++) { -// if (MORPHO_GETCLASS(klass->linearization.data[k])->uid == uid) return true; -// } -// return false; -// } -// -// /** Execute the resolver for a finalized metafunction. -// @param[in] fn - the metafunction to resolve -// @param[in] nargs - number of positional arguments -// @param[in] args - positional arguments @warning: the first user-visible argument should be in the zero position -// @param[out] err - error block to be filled out -// @param[out] out - resolved function -// @returns true if the metafunction was successfully resolved */ -// bool metafunction_xresolve(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { -// if (fn->state!=METAFUNCTION_FROZEN) { -// if (err) morpho_writeerrorwithid(err, METAFUNCTION_UNFROZEN, NULL, ERROR_POSNUNIDENTIFIABLE, ERROR_POSNUNIDENTIFIABLE); -// return false; -// } -// mfinstruction *pc = fn->resolver.data; -// if (!pc) return false; -// -// do { -// switch(pc->opcode) { -// case MF_CHECKNARGSNEQ: -// if (nargs!=pc->narg) pc+=pc->branch; -// break; -// case MF_CHECKNARGSLT: -// if (nargsnarg) pc+=pc->branch; -// break; -// case MF_CHECKVALUE: { -// if (!MORPHO_ISOBJECT(args[pc->narg])) { -// int tindx = (int) MORPHO_GETORDEREDTYPE(args[pc->narg]); -// if (pc->data.tindx!=tindx) pc+=pc->branch; -// } else pc+=pc->branch; -// } -// break; -// case MF_CHECKOBJECT: { -// if (MORPHO_ISOBJECT(args[pc->narg])) { -// int tindx = (int) MORPHO_GETOBJECTTYPE(args[pc->narg]); -// if (pc->data.tindx!=tindx) pc+=pc->branch; -// } else pc+=pc->branch; -// } -// break; -// case MF_CHECKINSTANCE: { -// if (MORPHO_ISINSTANCE(args[pc->narg])) { -// objectclass *klass = MORPHO_GETINSTANCE(args[pc->narg])->klass; -// -// if (!(klass->uid==pc->data.tindx || -// _finduidinlinearization(klass, pc->data.tindx))) { -// pc+=pc->branch; -// } -// } else pc+=pc->branch; -// } -// break; -// case MF_BRANCH: -// pc+=pc->branch; -// break; -// case MF_BRANCHNARGS: -// if (nargsdata.btable.count) { -// pc+=pc->data.btable.data[nargs]; -// } else pc+=pc->branch; -// break; -// case MF_BRANCHVALUETYPE: { -// if (!MORPHO_ISOBJECT(args[pc->narg])) { -// int type = (int) MORPHO_GETORDEREDTYPE(args[pc->narg]); -// if (typedata.btable.count) pc+=pc->data.btable.data[type]; -// } else pc+=pc->branch; -// } -// break; -// case MF_BRANCHOBJECTTYPE: { -// if (MORPHO_ISOBJECT(args[pc->narg])) { -// int type = MORPHO_GETOBJECTTYPE(args[pc->narg]); -// if (typedata.btable.count) pc+=pc->data.btable.data[type]; -// } else pc+=pc->branch; -// } -// break; -// case MF_BRANCHINSTANCE: { -// if (MORPHO_ISINSTANCE(args[pc->narg])) { -// // TODO: Check for btable bound -// objectclass *klass = MORPHO_GETINSTANCE(args[pc->narg])->klass; -// if (klass->uiddata.btable.count) pc+=pc->data.btable.data[klass->uid]; -// } else pc+=pc->branch; -// } -// break; -// case MF_RESOLVE: -// *out = pc->data.resolvefn; -// return true; -// case MF_FAIL: -// return false; -// } -// pc++; -// } while(true); -// } -// - /* ********************************************************************** * Metafunction base-case resolver * ********************************************************************** */ From 62c840f48001da79a8ec192de17ccb67e6482b61 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 26 Apr 2026 22:17:40 -0400 Subject: [PATCH 370/473] Improvements to varg support --- src/classes/metafunction.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 91bbed51f..a9cf16e3e 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -712,18 +712,22 @@ static bool mfcompiler_buildtypeplan(int nresolutions, mfcompileresolution *reso return false; } +/** Emit bytecode for a typed dispatch plan. */ +static bool mfcompiler_emitbranchtarget(mfcompiler *compiler, int fnindex, mfindx *entry) { + if (fnindex>=0) return mfcompiler_emitresolve(compiler, fnindex, entry); + return mfcompiler_emitslow(compiler, entry); +} + /** Emit bytecode for a typed dispatch plan. */ static bool mfcompiler_emittypeplan(mfcompiler *compiler, mfcompilertypeplan *plan, mfindx *entry) { mfindx deflt; // If a default resolution exists, generate a resolution - if (plan->defaultfnindex>=0) ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, plan->defaultfnindex, &deflt)); - else ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &deflt)); + ERR_CHECK_RETURN(mfcompiler_emitbranchtarget(compiler, plan->defaultfnindex, &deflt)); mfcompilersparseentry table[plan->cases.count]; // Generate resolutions compile table for (int i=0; icases.count; i++) { table[i].value = plan->cases.data[i].uid; - if (plan->cases.data[i].fnindex>=0) ERR_CHECK_RETURN(mfcompiler_emitresolve(compiler, plan->cases.data[i].fnindex, &table[i].target)); - else ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &table[i].target)); + ERR_CHECK_RETURN(mfcompiler_emitbranchtarget(compiler, plan->cases.data[i].fnindex, &table[i].target)); } // Output bytecode for the branch @@ -756,8 +760,8 @@ static int mfcompiler_compareresolutionarity(const void *a, const void *b) { return (xi > yi) - (xi < yi); // Ascending order } -/** Emit an untyped exact-arity case if a unique arity-specific winner exists. */ -static bool mfcompiler_emituntypedcase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { +/** Emit an untyped exact-arity case if a unique fixed-arity winner exists. */ +static bool mfcompiler_emitfixedaritywinner(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { int winner = -1; for (int i=0; i Date: Tue, 28 Apr 2026 21:32:54 -0400 Subject: [PATCH 371/473] Recursive metafunction compiler --- src/classes/metafunction.c | 517 ++++++++++++++++++++++++------------- 1 file changed, 338 insertions(+), 179 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index a9cf16e3e..0ea998263 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -427,8 +427,6 @@ typedef struct { error *err; mfcompileresolution *resolutions; int nresolutions; - bool hasvarg; - bool hastyped; } mfcompiler; /** Initialize compiler state. */ @@ -436,8 +434,6 @@ static void mfcompiler_init(mfcompiler *compiler, objectmetafunction *fn, error compiler->fn = fn; compiler->err = err; compiler->nresolutions = fn->fns.count; - compiler->hasvarg = false; - compiler->hastyped = false; compiler->resolutions = malloc(sizeof(mfcompileresolution)*compiler->nresolutions); } @@ -469,9 +465,6 @@ static bool mfcompiler_analyzecandidate(mfcompiler *compiler, int i) { resolution->typed = signature_istyped(sig); resolution->minarity = (resolution->varg ? resolution->nparams-1 : resolution->nparams); resolution->maxarity = (resolution->varg ? -1 : resolution->nparams); - - compiler->hasvarg = compiler->hasvarg || resolution->varg; - compiler->hastyped = compiler->hastyped || resolution->typed; return true; } @@ -556,55 +549,74 @@ static bool mfcompiler_hastypedresolutions(int nresolutions, mfcompileresolution return false; } -/** Count number of possible types per parameter. */ -static int mfcompiler_counttypesforparam(int nresolutions, mfcompileresolution *resolutions, int param) { - bool wildcard=false; - dictionary dict; - dictionary_init(&dict); - for (int j=0; jmax) max = resolutions[i].nparams; } - int count = dict.count + ((dict.count>0 && wildcard) ? 1 : 0); - dictionary_clear(&dict); - return count; + return max; } -/** One typed branch in a compiled dispatch plan. */ -typedef struct { - int uid; - int fnindex; -} mfcompilertypecase; +/** Check if a resolution matches a known exact arity. */ +static bool mfcompiler_matcharity(mfcompileresolution *resolution, int arity) { + return (resolution->minarity<=arity && + (resolution->maxarity<0 || arity<=resolution->maxarity)); +} -DECLARE_VARRAY(mfcompilertypecase, mfcompilertypecase) -DEFINE_VARRAY(mfcompilertypecase, mfcompilertypecase) +/** Check if a resolution matches the known runtime classes on this path. */ +static bool mfcompiler_matchknown(mfcompileresolution *resolution, int nparams, value *known) { + for (int i=0; inparams; i++) { + value type = MORPHO_NIL; + if (MORPHO_ISNIL(known[i])) continue; + if (!signature_getparamtype(resolution->sig, i, &type)) return false; + if (!mfresolution_rankparamtype(known[i], type, &(int) { 0 })) return false; + } + return true; +} -/** A compiled plan for typed dispatch on one argument. */ -typedef struct { - int arg; - int defaultfnindex; - varray_mfcompilertypecase cases; -} mfcompilertypeplan; +/** Count the number of distinct arities in a candidate set. */ +static int mfcompiler_countarities(int nresolutions, mfcompileresolution *resolutions) { + dictionary seen; + dictionary_init(&seen); -/** Clear a typed dispatch plan. */ -static void mfcompiler_cleartypeplan(mfcompilertypeplan *plan) { - varray_mfcompilertypecaseclear(&plan->cases); - plan->defaultfnindex = -1; + for (int i=0; ibestcount) { bestcount = count; bestparam = i; } +/** Check if a parameter's runtime class is already known. */ +static inline bool mfcompiler_paramisknown(value *known, int param) { + return (known && !MORPHO_ISNIL(known[param])); +} + +/** Count possible runtime types for a parameter. */ +static int mfcompiler_paramtypecount(int nresolutions, mfcompileresolution *resolutions, int param, value *known) { + if (mfcompiler_paramisknown(known, param)) return 0; + + bool wildcard = false; + dictionary dict; + dictionary_init(&dict); + for (int j=0; j=0); + int count = dict.count + ((dict.count>0 && wildcard) ? 1 : 0); + dictionary_clear(&dict); + return count; } /** Insert a class and all of its descendants into a dictionary. */ @@ -620,138 +632,188 @@ static bool mfcompiler_insertchildren(dictionary *dict, value type) { return true; } -/** Choose the best resolution for a given runtime class at one parameter. */ -static bool mfcompiler_resolvetypecase(int nresolutions, mfcompileresolution *resolutions, int param, value actual, int *fnindex) { - int best = -1, bestrank = INT_MAX, bestcount = 0, rank; - +/** Collect all runtime classes reachable from a parameter's declared types. */ +static bool mfcompiler_paramchildren(int nresolutions, mfcompileresolution *resolutions, + int param, dictionary *children) { for (int i=0; i=0 && !mfcompiler_matcharity(&resolutions[i], knownarity)) continue; + if (!mfcompiler_matchknown(&resolutions[i], nparams, known)) continue; + out[count++] = resolutions[i]; } - if (best<0 || bestcount!=1) return true; + return count; +} - for (int i=0; inparams; i++) { value type = MORPHO_NIL; - if (i==param) continue; - if (!signature_getparamtype(resolutions[best].sig, i, &type)) return true; - if (!MORPHO_ISNIL(type)) return true; + if (!signature_getparamtype(resolution->sig, i, &type)) return false; + if (!MORPHO_ISNIL(type) && MORPHO_ISNIL(known[i])) return false; + } + + return true; +} + +/** Check for any remaining unchecked typed parameter. */ +static bool mfcompiler_haspendingtypes(int nresolutions, mfcompileresolution *resolutions, + int nparams, value *known) { + for (int i=0; i0) return true; } return false; } -/** Build a typed dispatch plan for one argument. */ -static bool mfcompiler_buildtypeplan(int nresolutions, mfcompileresolution *resolutions, int param, mfcompilertypeplan *plan) { - varray_mfcompilertypecaseinit(&plan->cases); - plan->defaultfnindex = -1; - - dictionary children; - dictionary_init(&children); // Maintain dictionary of resolution classes and their children +/** Compare two resolutions using the runtime classes already known on this path. */ +static int mfcompiler_compareknownspecificity(mfcompileresolution *a, mfcompileresolution *b, int nparams, value *known) { + int ncheck = _min(a->nparams, b->nparams, nparams); + int firstsign = 0; - for (int i=0; idefaultfnindex<0, mfcompiler_buildtypeplan_cleanup); - plan->defaultfnindex = resolutions[i].fnindex; - continue; - } else ERR_CHECK(MORPHO_ISCLASS(type), mfcompiler_buildtypeplan_cleanup); - ERR_CHECK(mfcompiler_insertchildren(&children, type), mfcompiler_buildtypeplan_cleanup); + for (int i=0; isig, i, &atype) || + !signature_getparamtype(b->sig, i, &btype)) return 0; + if (!mfresolution_compareparamtypes(known[i], atype, btype, &cmp)) return 0; + if (cmp!=0) { + if (firstsign==0) firstsign = _sign(cmp); + else if (firstsign!=_sign(cmp)) return 0; + } } - for (unsigned int i=0; ivarg==b->varg) return 0; + return (a->varg ? 1 : -1); +} + +/** Resolve a subset directly if known path facts determine all typed parameters. */ +static bool mfcompiler_resolveknownsubset(int nresolutions, mfcompileresolution *resolutions, + int nparams, value *known, int *fnindex) { + for (int i=0; idefaultfnindex) continue; + bool alive[nresolutions]; + for (int i=0; iuid, .fnindex = fnindex }; - ERR_CHECK(varray_mfcompilertypecaseadd(&plan->cases, &newcase, 1), mfcompiler_buildtypeplan_cleanup); + for (int i=0; i0) { + alive[i] = false; + break; + } + } + } } - dictionary_clear(&children); - return (plan->cases.count>0); + int winner = -1; + for (int i=0; i=0) return false; + winner = i; + } + } -mfcompiler_buildtypeplan_cleanup: - dictionary_clear(&children); - mfcompiler_cleartypeplan(plan); - return false; + if (winner<0) return false; + *fnindex = resolutions[winner].fnindex; + return true; } -/** Emit bytecode for a typed dispatch plan. */ -static bool mfcompiler_emitbranchtarget(mfcompiler *compiler, int fnindex, mfindx *entry) { - if (fnindex>=0) return mfcompiler_emitresolve(compiler, fnindex, entry); - return mfcompiler_emitslow(compiler, entry); +/** Check if a surviving subset is worth recursing into. */ +static bool mfcompiler_subsetisuseful(int nresolutions, mfcompileresolution *resolutions, + int nparams, value *known) { + int winner; + + if (nresolutions<=0) return false; + if (nresolutions==1 && mfcompiler_resolutionisterminal(&resolutions[0], nparams, known)) return true; + if (mfcompiler_resolveknownsubset(nresolutions, resolutions, nparams, known, &winner)) return true; + return mfcompiler_haspendingtypes(nresolutions, resolutions, nparams, known); } -/** Emit bytecode for a typed dispatch plan. */ -static bool mfcompiler_emittypeplan(mfcompiler *compiler, mfcompilertypeplan *plan, mfindx *entry) { - mfindx deflt; - // If a default resolution exists, generate a resolution - ERR_CHECK_RETURN(mfcompiler_emitbranchtarget(compiler, plan->defaultfnindex, &deflt)); +/** Count useful runtime-class branches for a parameter. */ +static int mfcompiler_parambranchcount(int nresolutions, mfcompileresolution *resolutions, + int knownarity, int nparams, value *known, int param) { + if (mfcompiler_paramisknown(known, param)) return 0; + + int useful = 0; + dictionary children; + dictionary_init(&children); + if (!mfcompiler_paramchildren(nresolutions, resolutions, param, &children)) { + dictionary_clear(&children); + return 0; + } - mfcompilersparseentry table[plan->cases.count]; // Generate resolutions compile table - for (int i=0; icases.count; i++) { - table[i].value = plan->cases.data[i].uid; - ERR_CHECK_RETURN(mfcompiler_emitbranchtarget(compiler, plan->cases.data[i].fnindex, &table[i].target)); + value childknown[nparams]; + mfcompileresolution subset[nresolutions]; + for (unsigned int i=0; i0 && (countarg, entry)); - return mfcompiler_emitsparse(compiler, plan->cases.count, table, deflt, NULL); + dictionary_clear(&children); + return useful; } -/** Try to emit typed dispatch for one exact-arity candidate set. */ -static bool mfcompiler_emittypedcase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { - int param; - mfcompilertypeplan plan = { .arg=-1, .defaultfnindex=-1 }; - varray_mfcompilertypecaseinit(&plan.cases); +/** Choose a typed parameter to branch on. */ +static bool mfcompiler_choosetypeparam(int nresolutions, mfcompileresolution *resolutions, + int knownarity, int nparams, value *known, int *param) { + int bestparam = -1; + int bestuseful = 0; + int bestcount = 0; - ERR_CHECK(mfcompiler_choosetypeparam(nresolutions, resolutions, ¶m), mfcompiler_emittypedcase_cleanup); - ERR_CHECK(mfcompiler_buildtypeplan(nresolutions, resolutions, param, &plan), mfcompiler_emittypedcase_cleanup); + for (int i=0; ibestuseful || (useful==bestuseful && count>bestcount)) { + bestuseful = useful; + bestcount = count; + bestparam = i; + } + } - plan.arg = param; - ERR_CHECK(mfcompiler_emittypeplan(compiler, &plan, entry), mfcompiler_emittypedcase_cleanup); - mfcompiler_cleartypeplan(&plan); - return true; + *param = bestparam; + return (bestparam>=0 && bestuseful>0); +} -mfcompiler_emittypedcase_cleanup: - mfcompiler_cleartypeplan(&plan); - return false; +static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, + int knownarity, int nparams, value *known, mfindx *entry); + +/** Compile the resolver entry point. */ +static bool mfcompiler_compileentry(mfcompiler *compiler, mfindx *entry) { + int nparams = mfcompiler_maxparams(compiler->nresolutions, compiler->resolutions); + if (nparams<1) nparams = 1; + + value known[nparams]; + for (int i=0; inresolutions, compiler->resolutions, -1, nparams, known, entry); } /** Compare resolutions by arity for sorting. */ @@ -775,65 +837,163 @@ static bool mfcompiler_emitfixedaritywinner(mfcompiler *compiler, int nresolutio return false; } -/** Emit a resolver block for one exact-arity candidate set. */ -static bool mfcompiler_emitaritycase(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { - bool hastyped = mfcompiler_hastypedresolutions(nresolutions, resolutions); +/** Collect wildcard resolutions for a typed split. */ +static bool mfcompiler_defaultsubset(int nresolutions, mfcompileresolution *resolutions, + int param, mfcompileresolution *subset, int *count) { + int ndefault = 0; - if (nresolutions==1 && !resolutions[0].typed) { - return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); + for (int i=0; icapacity; i++) { + value actual = children->contents[i].key; + if (MORPHO_ISNIL(actual)) continue; + + memcpy(childknown, known, sizeof(value)*nparams); + childknown[param] = actual; + + int nsubset = mfcompiler_collectsubset(nresolutions, resolutions, knownarity, nparams, childknown, subset); + if (nsubset<=0) continue; + + table[count].value = MORPHO_GETCLASS(actual)->uid; + ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nsubset, subset, knownarity, nparams, childknown, &table[count].target)); + count++; } - return mfcompiler_emitslow(compiler, entry); + *ncases = count; + return true; } -/** Emit a conservative exact-arity resolver directly into bytecode. */ -static bool mfcompiler_emitarityresolver(mfcompiler *compiler, mfindx *entry) { - // Sort resolutions by arity - mfcompileresolution resolutions[compiler->nresolutions]; - memcpy(resolutions, compiler->resolutions, sizeof(mfcompileresolution)*compiler->nresolutions); - qsort(resolutions, compiler->nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); +/** Emit a typed resolver for one exact-arity candidate set. */ +static bool mfcompiler_emittypedresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, + int knownarity, int nparams, value *known, mfindx *entry) { + int param, defaultcount, ncases; + dictionary children; + mfcompileresolution defaultsubset[nresolutions]; + mfindx deflt; + + dictionary_init(&children); - mfindx deflt; // Emit default resolution - if (compiler->hasvarg) ERR_CHECK_RETURN(mfcompiler_emitslow(compiler, &deflt)); + ERR_CHECK(mfcompiler_choosetypeparam(nresolutions, resolutions, knownarity, nparams, known, ¶m), mfcompiler_emittypedresolver_cleanup); + ERR_CHECK(mfcompiler_paramchildren(nresolutions, resolutions, param, &children), mfcompiler_emittypedresolver_cleanup); + + { + /* Branch count is bounded by reachable runtime classes, not declared resolutions. */ + mfcompilersparseentry table[children.count]; + + ERR_CHECK(mfcompiler_defaultsubset(nresolutions, resolutions, param, defaultsubset, &defaultcount), mfcompiler_emittypedresolver_cleanup); + if (defaultcount>0) { + ERR_CHECK(mfcompiler_emitresolver(compiler, defaultcount, defaultsubset, knownarity, nparams, known, &deflt), mfcompiler_emittypedresolver_cleanup); + } else ERR_CHECK(mfcompiler_emitslow(compiler, &deflt), mfcompiler_emittypedresolver_cleanup); + + ERR_CHECK(mfcompiler_emitchildcases(compiler, nresolutions, resolutions, knownarity, nparams, + known, param, &children, table, &ncases), mfcompiler_emittypedresolver_cleanup); + if (ncases<=0) goto mfcompiler_emittypedresolver_cleanup; + ERR_CHECK(mfcompiler_emitgetuid(compiler, param, entry), mfcompiler_emittypedresolver_cleanup); + ERR_CHECK(mfcompiler_emitsparse(compiler, ncases, table, deflt, NULL), mfcompiler_emittypedresolver_cleanup); + } + + dictionary_clear(&children); + return true; + +mfcompiler_emittypedresolver_cleanup: + dictionary_clear(&children); + return false; +} + +/** Emit an arity-first resolver for a candidate set. */ +static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, + int nparams, value *known, mfindx *entry) { + mfcompileresolution sorted[nresolutions]; + memcpy(sorted, resolutions, sizeof(mfcompileresolution)*nresolutions); + qsort(sorted, nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); + + mfindx deflt; + bool hasvarg = false; + for (int i=0; inresolutions]; + mfcompilersparseentry table[nresolutions]; int ncases = 0; - for (int i=0; inresolutions; ) { // Loop over resolutions - if (resolutions[i].varg) { - i++; - continue; - } + for (int i=0; inresolutions && - !resolutions[i].varg && - resolutions[i].nparams==arity) i++; + int arity = sorted[i].nparams; + while (inresolutions]; + mfcompileresolution bucket[nresolutions]; int count = 0; - for (int j=0; jnresolutions; j++) { - if (resolutions[j].minarity<=arity && - (resolutions[j].maxarity<0 || arity<=resolutions[j].maxarity)) { - bucket[count++] = resolutions[j]; + for (int j=0; j=0) { + if (mfcompiler_emitfixedaritywinner(compiler, nresolutions, resolutions, entry)) return true; + } + + /* Known path facts may already determine the winner. */ + if (knownarity>=0) { + int fnindex; + if (mfcompiler_resolveknownsubset(nresolutions, resolutions, nparams, known, &fnindex)) { + return mfcompiler_emitresolve(compiler, fnindex, entry); + } + } + + /* Split by arity before considering typed dispatch. */ + if (knownarity<0 && (mfcompiler_countarities(nresolutions, resolutions)>1 || mfcompiler_hasvargresolutions(nresolutions, resolutions))) { + return mfcompiler_emitarityresolver(compiler, nresolutions, resolutions, nparams, known, entry); + } + + /* Otherwise try a typed split on the current exact-arity subset. */ + if (hastyped) { + if (mfcompiler_emittypedresolver(compiler, nresolutions, resolutions, knownarity, nparams, known, entry)) return true; + } + + /* Fall back to the runtime resolver when no fast split is worthwhile. */ + return mfcompiler_emitslow(compiler, entry); } -/** Compiles the resolver for a metafunction that is still being assembled. */ +/** Compile a resolver for a metafunction being assembled. */ bool metafunction_compile(objectmetafunction *fn, error *err) { if (fn->fns.count<=0) return false; @@ -843,7 +1003,7 @@ bool metafunction_compile(objectmetafunction *fn, error *err) { ERR_CHECK(mfcompiler_analyze(&compiler), metafunction_compile_cleanup); ERR_CHECK(mfcompiler_checkduplicates(&compiler), metafunction_compile_cleanup); - ERR_CHECK(mfcompiler_emitarityresolver(&compiler, &fn->entry), metafunction_compile_cleanup); + ERR_CHECK(mfcompiler_compileentry(&compiler, &fn->entry), metafunction_compile_cleanup); mfcompiler_clear(&compiler); return true; @@ -918,7 +1078,6 @@ void metafunction_disassemble(objectmetafunction *fn) { } } - /* -------------------------- * Fast resolver VM * -------------------------- */ From ae0cc6d98341b8454e285890b8bc3801fc55c623 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 28 Apr 2026 21:58:28 -0400 Subject: [PATCH 372/473] metafunction_reduce --- src/classes/metafunction.c | 70 ++++++++++++++++++++++++++++++++++++++ src/classes/metafunction.h | 1 + 2 files changed, 71 insertions(+) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 0ea998263..11d96050e 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -346,6 +346,36 @@ void mfresolutionset_filterbytypes(mfresolutionset *set, int nargs, value *args) mfresolutionset_collapse(set); } +/** @brief Filter the resolution set by known argument types. */ +void mfresolutionset_filterbyknowntypes(mfresolutionset *set, int nargs, value *args) { + for (int i=0; icount; i++) { + if (!set->data[i].sig) continue; + for (int j=0; jdata[i].sig, j, &type) || + !mfresolution_rankparamtype(actual, type, &(int) { 0 })) { + set->data[i].sig = NULL; + break; + } + } + } + mfresolutionset_collapse(set); +} + +/** @brief Check whether known argument types fully determine a signature. */ +static bool mfresolution_isterminal(signature *sig, int nargs, value *args) { + int nparams = signature_countparams(sig); + + for (int i=0; icount; i++) { // Compare all possible pairs and remove resolutions dominated by at least one other candidate @@ -1135,6 +1165,46 @@ bool metafunction_resolve(objectmetafunction *fn, int nargs, value *args, error return metafunction_runresolver(fn, nargs, args, err, out); } +/* ********************************************************************** + * Specialize a metafunction given type information + * ********************************************************************** */ + +/** Reduce a metafunction using known argument types. */ +bool metafunction_reduce(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { + int nres = fn->fns.count; + mfresolutionset set; + mfresolution res[nres]; + objectmetafunction *reduced = NULL; + + mfresolutionset_init(&set, res, fn); + mfresolutionset_filterbyarity(&set, nargs); + mfresolutionset_filterbyknowntypes(&set, nargs, args); + + if (set.count<=0) { // No resolutions left + error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; + } else if (set.count==1 && + mfresolution_isterminal(set.data[0].sig, nargs, args)) { // Resolution is completely specified + *out = set.data[0].fn; return true; + } else if (set.count==fn->fns.count) { // Resolution set is unchanged + *out = MORPHO_OBJECT(fn); return true; + } + + ERR_CHECK(reduced = object_newmetafunction(fn->name), metafunction_reduce_cleanup); + + metafunction_setclass(reduced, metafunction_class(fn)); + for (int i=0; i Date: Tue, 28 Apr 2026 23:26:45 -0400 Subject: [PATCH 373/473] Compiler specialization of metafunctions --- src/classes/function.c | 1 + src/classes/function.h | 1 + src/core/compile.c | 64 ++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/classes/function.c b/src/classes/function.c index fb097ee2e..f4eeab964 100644 --- a/src/classes/function.c +++ b/src/classes/function.c @@ -56,6 +56,7 @@ void object_functioninit(objectfunction *func) { func->nopt=0; func->parent=NULL; func->creg=-1; + func->isrecursive=false; func->nregs=0; varray_valueinit(&func->konst); varray_varray_upvalueinit(&func->prototype); diff --git a/src/classes/function.h b/src/classes/function.h index 64d9329fb..688c709c5 100644 --- a/src/classes/function.h +++ b/src/classes/function.h @@ -34,6 +34,7 @@ typedef struct sobjectfunction { value name; indx entry; int creg; // Closure register + bool isrecursive; struct sobjectfunction *parent; int nregs; objectclass *klass; // Parent class for methods diff --git a/src/core/compile.c b/src/core/compile.c index 86d1520ac..813526f6a 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -3692,6 +3692,52 @@ static bool compiler_isinvocation(compiler *c, syntaxtreenode *call) { return isinvocation; } +static bool compiler_functionisrecursive(value fn) { + if (MORPHO_ISFUNCTION(fn)) return MORPHO_GETFUNCTION(fn)->isrecursive; + if (MORPHO_ISCLOSURE(fn)) return MORPHO_GETCLOSUREFUNCTION(fn)->isrecursive; + return false; +} + +static bool compiler_metafunctionhasrecursiveimplementation(objectmetafunction *metafunction) { + for (int i=0; ifns.count; i++) { + if (compiler_functionisrecursive(metafunction->fns.data[i])) return true; + } + + return false; +} + +/** Attempt to specialize a constant metafunction call using current argument types. */ +static bool compiler_specializemetafunctioncall(compiler *c, syntaxtreenode *node, codeinfo *func, + instructionindx selectorload, int nargs, value selector, value *rtype) { + if (!MORPHO_ISMETAFUNCTION(selector)) return false; + + objectmetafunction *metafunction = MORPHO_GETMETAFUNCTION(selector); + if (metafunction->state!=METAFUNCTION_FROZEN || + compiler_metafunctionhasrecursiveimplementation(metafunction)) return false; + + value argtypes[nargs]; + for (int i=0; idest+i+1, &type) && MORPHO_ISCLASS(type)) ? type : MORPHO_NIL; + } + + value reduced = MORPHO_NIL; + error err; + error_init(&err); + bool success = metafunction_reduce(metafunction, nargs, argtypes, &err, &reduced); + error_clear(&err); + if (!success) return false; + + registerindx ctarget = compiler_addconstant(c, node, reduced, true, false); + if (ctarget==REGISTER_UNALLOCATED) return false; + + compiler_setinstruction(c, selectorload, ENCODE_LONG(OP_LCT, func->dest, ctarget)); + compiler_getreturntype(c, reduced, rtype); + if (MORPHO_ISOBJECT(reduced)) program_bindobject(c->out, MORPHO_GETOBJECT(reduced)); + + return true; +} + /** Compiles a function call */ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx reqout) { unsigned int ninstructions=0; @@ -3712,6 +3758,9 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re value rtype=MORPHO_NIL; if (selnode->type==NODE_SYMBOL) { // A regular call from a symbol compiler_findtype(c, selnode->content, &rtype); + + objectfunction *current = compiler_getcurrentfunction(c); + if (current && MORPHO_ISEQUAL(current->name, selnode->content)) current->isrecursive=true; } else if (selnode->type==NODE_DOT) { // An constructor in a namespace? syntaxtreenode *nsnode = compiler_getnode(c, selnode->left); syntaxtreenode *snode = compiler_getnode(c, selnode->right); @@ -3735,9 +3784,12 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re codeinfo func = compiler_nodetobytecode(c, node->left, rCallReq); // Attempt to infer return type - if (func.returntype==CONSTANT && MORPHO_ISNIL(rtype)) { - value target=MORPHO_NIL; + bool constantselector = (func.returntype==CONSTANT); + value target=MORPHO_NIL; + if (constantselector) { target=compiler_getconstant(c, func.dest); + } + if (constantselector && MORPHO_ISNIL(rtype)) { compiler_getreturntype(c, target, &rtype); } @@ -3745,13 +3797,17 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re if (selnode->type==NODE_SYMBOL && compiler_catch(c, COMPILE_SYMBOLNOTDEFINED)) { syntaxtreenode *symbol=compiler_getnode(c, node->left); func=compiler_addforwardreference(c, symbol, symbol->content); + constantselector=false; + target=MORPHO_NIL; } ninstructions+=func.ninstructions; /* Move selector into a temporary register unless we already have one that's at the top of the stack */ + instructionindx selectorload = -1; if (!compiler_iscodeinfotop(c, func)) { registerindx otop = compiler_regalloctop(c); + if (constantselector) selectorload = compiler_currentinstructionindex(c); func=compiler_movetoregister(c, node, func, otop); ninstructions+=func.ninstructions; } @@ -3775,6 +3831,10 @@ static codeinfo compiler_call(compiler *c, syntaxtreenode *node, registerindx re /* Generate the call instruction */ int nposn=0, nopt=0; compiler_regcountargs(c, func.dest+1, lastarg, &nposn, &nopt); + if (constantselector && nopt==0 && + selectorload>=0) { + compiler_specializemetafunctioncall(c, node, &func, selectorload, nposn, target, &rtype); + } compiler_addinstruction(c, ENCODE(OP_CALL, func.dest, nposn, nopt), node); ninstructions++; From 9ad8dc29d5653fadd8278a0ef8d64cf682404591 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 29 Apr 2026 06:46:18 -0400 Subject: [PATCH 374/473] Harden signatures --- src/classes/array.c | 18 +++++----- src/classes/file.c | 84 +++++++++++++++++++++------------------------ src/classes/list.c | 21 +++++------- src/classes/tuple.c | 2 +- 4 files changed, 58 insertions(+), 67 deletions(-) diff --git a/src/classes/array.c b/src/classes/array.c index 6d0f02010..202e55368 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -565,19 +565,17 @@ value Array_dimensions(vm *v, int nargs, value *args) { } /** Enumerate members of an array */ -value Array_enumerate(vm *v, int nargs, value *args) { +value Array_enumerate__int(vm *v, int nargs, value *args) { objectarray *slf = MORPHO_GETARRAY(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (n<0) { - out=MORPHO_INTEGER(slf->nelements); - } else if (nnelements) { - out=slf->values[n]; - } else morpho_runtimeerror(v, VM_OUTOFBOUNDS); - } else MORPHO_RAISE(v, ENUMERATE_ARGS); + if (n<0) { + out=MORPHO_INTEGER(slf->nelements); + } else if (nnelements) { + out=slf->values[n]; + } else morpho_runtimeerror(v, VM_OUTOFBOUNDS); return out; } @@ -602,7 +600,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Array_count, BUILTIN_FLAG MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Array_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Array_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (_)", Array_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Array_enumerate__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Array ()", Array_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/file.c b/src/classes/file.c index d21fce8e1..53ae4e33b 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -383,17 +383,15 @@ MORPHO_ENDCLASS * ********************************************************************** */ /** Detect whether a resource is a folder */ -value Folder_isfolder(vm *v, int nargs, value *args) { +value Folder_isfolder__string(vm *v, int nargs, value *args) { value ret = MORPHO_FALSE; - if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - varray_char name; - varray_charinit(&name); - file_relativepath(MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &name); - - if (platform_isdirectory(name.data)) ret=MORPHO_TRUE; - - varray_charclear(&name); - } else morpho_runtimeerror(v, FOLDER_EXPCTPATH); + varray_char name; + varray_charinit(&name); + file_relativepath(MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &name); + + if (platform_isdirectory(name.data)) ret=MORPHO_TRUE; + + varray_charclear(&name); return ret; } @@ -413,38 +411,36 @@ value Folder_normalizepath(vm *v, int nargs, value *args) { /** Return the contents of a folder */ value Folder_contents(vm *v, int nargs, value *args) { value ret = MORPHO_NIL; - if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - varray_char name; - varray_charinit(&name); - file_relativepath(MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &name); + varray_char name; + varray_charinit(&name); + file_relativepath(MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), &name); + + size_t size = platform_maxpathsize(); + char buffer[size]; + + MorphoDirContents contents; + if (platform_directorycontentsinit(&contents, name.data)) { + varray_value list; + varray_valueinit(&list); + + while (platform_directorycontents(&contents, buffer, size)) { + value entry = object_stringfromcstring(buffer, strlen(buffer)); + if (MORPHO_ISSTRING(entry)) varray_valuewrite(&list, entry); + }; + + platform_directorycontentsclear(&contents); + + objectlist *clist = object_newlist(list.count, list.data); + if (clist) { + ret = MORPHO_OBJECT(clist); + varray_valuewrite(&list, ret); + morpho_bindobjects(v, list.count, list.data); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + + varray_valueclear(&list); + } else morpho_runtimeerror(v, FOLDER_NTFLDR); - size_t size = platform_maxpathsize(); - char buffer[size]; - - MorphoDirContents contents; - if (platform_directorycontentsinit(&contents, name.data)) { - varray_value list; - varray_valueinit(&list); - - while (platform_directorycontents(&contents, buffer, size)) { - value entry = object_stringfromcstring(buffer, strlen(buffer)); - if (MORPHO_ISSTRING(entry)) varray_valuewrite(&list, entry); - }; - - platform_directorycontentsclear(&contents); - - objectlist *clist = object_newlist(list.count, list.data); - if (clist) { - ret = MORPHO_OBJECT(clist); - varray_valuewrite(&list, ret); - morpho_bindobjects(v, list.count, list.data); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - - varray_valueclear(&list); - } else morpho_runtimeerror(v, FOLDER_NTFLDR); - - varray_charclear(&name); - } else morpho_runtimeerror(v, FOLDER_EXPCTPATH); + varray_charclear(&name); return ret; } @@ -465,10 +461,10 @@ value Folder_createrecursive(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Folder) -MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (_)", Folder_isfolder, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER_DEPRECATED, "Bool (_)", Folder_isfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (String)", Folder_isfolder__string, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER_DEPRECATED, "Bool (String)", Folder_isfolder__string, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(FOLDER_NORMALIZEPATH, "String (String)", Folder_normalizepath, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (_)", Folder_contents, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (String)", Folder_contents, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(FOLDER_CREATE, "(String)", Folder_create, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(FOLDER_CREATERECURSIVE, "(String)", Folder_createrecursive, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/list.c b/src/classes/list.c index f72ba2b53..47dfc9489 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -581,20 +581,17 @@ value List_clone(vm *v, int nargs, value *args) { } /** Joins two lists together */ -value List_join(vm *v, int nargs, value *args) { +value List_join__list(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); value out = MORPHO_NIL; - if (nargs==1 && MORPHO_ISLIST(MORPHO_GETARG(args, 0))) { - objectlist *operand = MORPHO_GETLIST(MORPHO_GETARG(args, 0)); - objectlist *new = list_concatenate(slf, operand); + objectlist *operand = MORPHO_GETLIST(MORPHO_GETARG(args, 0)); + objectlist *new = list_concatenate(slf, operand); - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - - } else morpho_runtimeerror(v, LIST_ADDARGS); + if (new) { + out = MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } return out; } @@ -684,10 +681,10 @@ MORPHO_METHOD(LIST_TUPLES_METHOD, List_tuples, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_SETS_METHOD, List_sets, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, BUILTIN_FLAGSEMPTY), //MORPHO_METHOD(MORPHO_ADD_METHOD, List_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (_)", List_join, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (List)", List_join__list, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ROLL_METHOD, List_roll, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "()", List_sort, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "(_)", List_sort_fn, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "(Callable)", List_sort_fn, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_ORDER_METHOD, List_order, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_REVERSE_METHOD, List_reverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY), diff --git a/src/classes/tuple.c b/src/classes/tuple.c index 5afc52746..b21bb6336 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -422,7 +422,7 @@ MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (_)", Tuple_join, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (_)", Tuple_roll, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (_)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (Callable)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), From 37e65b196543d8509667297a32fc7c91d130fd6b Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 29 Apr 2026 07:05:21 -0400 Subject: [PATCH 375/473] Harden Complex signatures --- src/classes/cmplx.c | 28 +++++++++++-------- .../types/type_complex_add_violation.morpho | 2 +- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index a38e93a3a..f63a4bb7d 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -402,19 +402,21 @@ value Complex_print(vm *v, int nargs, value *args) { } /** Complex add */ -value Complex_add(vm *v, int nargs, value *args) { +value Complex_add__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); + objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + + objectcomplex *new = object_newcomplex(0, 0); + if (new) complex_add(a, b, new); + + return morpho_wrapandbind(v, (object *) new); +} + +value Complex_add__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISCOMPLEX(MORPHO_GETARG(args, 0))) { - objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); - - objectcomplex *new = object_newcomplex(0, 0); - if (new) { - out=MORPHO_OBJECT(new); - complex_add(a, b, new); - } - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_newcomplex(0,0); @@ -672,11 +674,13 @@ value Complex_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexNum) MORPHO_METHOD(MORPHO_PRINT_METHOD, Complex_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (...)", Complex_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (...)", Complex_sub, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (...)", Complex_mul, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (...)", Complex_div, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (...)", Complex_add, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Complex (...)", Complex_subr, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (...)", Complex_mul, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "Complex (...)", Complex_divr, BUILTIN_FLAGSEMPTY), diff --git a/test/complex/types/type_complex_add_violation.morpho b/test/complex/types/type_complex_add_violation.morpho index d33979aa5..3bf3e091d 100644 --- a/test/complex/types/type_complex_add_violation.morpho +++ b/test/complex/types/type_complex_add_violation.morpho @@ -3,4 +3,4 @@ Complex a = 1im var b = 1 -Float c = a + b // expect error 'TypeErr' +Float c = a + b // expect error 'TypeChk' From c9e84774eb2e7b347f95b86d182f522ac9629de3 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 29 Apr 2026 07:45:14 -0400 Subject: [PATCH 376/473] Harden complex numbers through clearer signatures --- src/classes/cmplx.c | 182 +++++++++--------- .../types/type_complex_power_violation.morpho | 2 +- 2 files changed, 89 insertions(+), 95 deletions(-) diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index f63a4bb7d..85cb23fce 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -362,33 +362,17 @@ value complex_constructor(vm *v, int nargs, value *args) { /** Gets the real part of a complex number */ value Complex_getreal(vm *v, int nargs, value *args) { objectcomplex *c=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); - - value out = MORPHO_NIL; - if (nargs>0){ - morpho_runtimeerror(v, COMPLEX_INVLDNARG); - return out; - } - double real; complex_getreal(c, &real); - out = MORPHO_FLOAT(real); - return out; + return MORPHO_FLOAT(real); } /** Gets the imaginary part of a complex number */ value Complex_getimag(vm *v, int nargs, value *args) { objectcomplex *c=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); - - value out = MORPHO_NIL; - if (nargs>0){ - morpho_runtimeerror(v, COMPLEX_INVLDNARG); - return out; - } - double imag; complex_getimag(c, &imag); - out = MORPHO_FLOAT(imag); - return out; + return MORPHO_FLOAT(imag); } /** Prints a complex */ @@ -433,19 +417,21 @@ value Complex_add__x(vm *v, int nargs, value *args) { } /** Complex subtract */ -value Complex_sub(vm *v, int nargs, value *args) { +value Complex_sub__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); + objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + + objectcomplex *new = object_newcomplex(0, 0); + if (new) complex_sub(a, b, new); + + return morpho_wrapandbind(v, (object *) new); +} + +value Complex_sub__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISCOMPLEX(MORPHO_GETARG(args, 0))) { - objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); - - objectcomplex *new = object_newcomplex(0, 0); - if (new) { - out=MORPHO_OBJECT(new); - complex_sub(a, b, new); - } - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_newcomplex(0,0); @@ -462,11 +448,11 @@ value Complex_sub(vm *v, int nargs, value *args) { } /** Right subtract */ -value Complex_subr(vm *v, int nargs, value *args) { +value Complex_subr__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_clonecomplex(a); @@ -485,19 +471,21 @@ value Complex_subr(vm *v, int nargs, value *args) { } /** Complex multiply */ -value Complex_mul(vm *v, int nargs, value *args) { +value Complex_mul__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); + objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + + objectcomplex *new = object_newcomplex(0, 0); + if (new) complex_mul(a, b, new); + + return morpho_wrapandbind(v, (object *) new); +} + +value Complex_mul__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISCOMPLEX(MORPHO_GETARG(args, 0))) { - objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); - - objectcomplex *new = object_newcomplex(0, 0); - if (new) { - out=MORPHO_OBJECT(new); - complex_mul(a, b, new); - } - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_newcomplex(0,0); @@ -514,19 +502,21 @@ value Complex_mul(vm *v, int nargs, value *args) { } /** Complex divide */ -value Complex_div(vm *v, int nargs, value *args) { +value Complex_div__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); + objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + + objectcomplex *new = object_newcomplex(0, 0); + if (new) complex_div(a, b, new); + + return morpho_wrapandbind(v, (object *) new); +} + +value Complex_div__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISCOMPLEX(MORPHO_GETARG(args, 0))) { - objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); - - objectcomplex *new = object_newcomplex(0, 0); - if (new) { - out=MORPHO_OBJECT(new); - complex_div(a, b, new); - } - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_newcomplex(0,0); @@ -543,12 +533,11 @@ value Complex_div(vm *v, int nargs, value *args) { } /** Complex right divide */ -value Complex_divr(vm *v, int nargs, value *args) { - // this gets called when we divide a nonobject (number) by a complex number +value Complex_divr__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { @@ -567,21 +556,21 @@ value Complex_divr(vm *v, int nargs, value *args) { } /** Complex exponentiation */ -value Complex_power(vm *v, int nargs, value *args) { +value Complex_power__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); + objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + + objectcomplex *new = object_newcomplex(0, 0); + if (new) complex_cpower(a, b, new); + + return morpho_wrapandbind(v, (object *) new); +} + +value Complex_power__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISCOMPLEX(MORPHO_GETARG(args, 0))) { - // raise a complex number to a complex power - objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); - - objectcomplex *new = object_newcomplex(0, 0); - if (new) { - out=MORPHO_OBJECT(new); - complex_cpower(a, b, new); - } - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - // raise complex power to a number + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_newcomplex(0,0); @@ -590,7 +579,7 @@ value Complex_power(vm *v, int nargs, value *args) { complex_power(a, val, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -598,21 +587,21 @@ value Complex_power(vm *v, int nargs, value *args) { } /** Complex right exponentiation */ -value Complex_powerr(vm *v, int nargs, value *args) { +value Complex_powerr__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); + objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + + objectcomplex *new = object_newcomplex(0, 0); + if (new) complex_cpower(a, b, new); + + return morpho_wrapandbind(v, (object *) new); +} + +value Complex_powerr__x(vm *v, int nargs, value *args) { objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_SELF(args)); value out=MORPHO_NIL; - if (nargs==1 && MORPHO_ISCOMPLEX(MORPHO_GETARG(args, 0))) { - // raise a complex number to a complex power - objectcomplex *b=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); - - objectcomplex *new = object_newcomplex(0, 0); - if (new) { - out=MORPHO_OBJECT(new); - complex_cpower(a, b, new); - } - } else if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - // raise a number to a complex power + if (MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { double val; if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { objectcomplex *new = object_newcomplex(val,0); @@ -621,12 +610,11 @@ value Complex_powerr(vm *v, int nargs, value *args) { complex_cpower(new, a, new); } } - } else morpho_runtimeerror(v, COMPLEX_ARITHARGS); + } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); return out; - } /** Angle of a complex number */ @@ -676,21 +664,27 @@ MORPHO_BEGINCLASS(ComplexNum) MORPHO_METHOD(MORPHO_PRINT_METHOD, Complex_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (...)", Complex_sub, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (...)", Complex_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (...)", Complex_div, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (Complex)", Complex_sub__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (_)", Complex_sub__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (Complex)", Complex_mul__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (_)", Complex_mul__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (Complex)", Complex_div__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (_)", Complex_div__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Complex (...)", Complex_subr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (...)", Complex_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "Complex (...)", Complex_divr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (...)", Complex_power, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (...)", Complex_powerr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_ANGLE_METHOD, "Float (...)", Complex_angle, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex (...)", Complex_conjugate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Float (...)", Complex_getreal, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Float (...)", Complex_getimag, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_ABS_METHOD, "Float (...)", Complex_abs, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Complex (_)", Complex_subr__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (Complex)", Complex_mul__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (_)", Complex_mul__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "Complex (_)", Complex_divr__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (Complex)", Complex_power__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (_)", Complex_power__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (Complex)", Complex_powerr__complex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (_)", Complex_powerr__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_ANGLE_METHOD, "Float ()", Complex_angle, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex ()", Complex_conjugate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Float ()", Complex_getreal, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Float ()", Complex_getimag, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(COMPLEX_ABS_METHOD, "Float ()", Complex_abs, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS @@ -703,7 +697,7 @@ void complex_initialize(void) { objectcomplextype=object_addtype(&objectcomplexdefn); // Complex constructor function - morpho_addfunction(COMPLEX_CLASSNAME, COMPLEX_CLASSNAME " (...)", complex_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(COMPLEX_CLASSNAME, COMPLEX_CLASSNAME " (_,_)", complex_constructor, MORPHO_FN_CONSTRUCTOR, NULL); value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); diff --git a/test/complex/types/type_complex_power_violation.morpho b/test/complex/types/type_complex_power_violation.morpho index f0100ecac..cbcffe427 100644 --- a/test/complex/types/type_complex_power_violation.morpho +++ b/test/complex/types/type_complex_power_violation.morpho @@ -3,5 +3,5 @@ Complex Z = 1 + 2im { - Float a = Z^2 // expect error 'TypeErr' + Float a = Z^2 // expect error 'TypeChk' } From d45bec8fa8d1ec1320838f37959151f57b5d11ca Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 29 Apr 2026 22:58:19 -0400 Subject: [PATCH 377/473] Type hardening of builtin --- src/builtin/functiondefs.c | 223 ++++++++++++++++++------------------- src/classes/metafunction.c | 3 +- test/builtin/mod.morpho | 15 ++- 3 files changed, 124 insertions(+), 117 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 4285b4c92..5f49adae2 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -328,53 +328,56 @@ value builtin_arctan(vm *v, int nargs, value *args) { } /** Remainder */ -value builtin_mod(vm *v, int nargs, value *args) { - value out = MORPHO_NIL; - if (nargs==2) { - value a = MORPHO_GETARG(args, 0); - value b = MORPHO_GETARG(args, 1); - - if (MORPHO_ISINTEGER(a) && MORPHO_ISINTEGER(b)) { - out=MORPHO_INTEGER(MORPHO_GETINTEGERVALUE(a) % MORPHO_GETINTEGERVALUE(b)); - } else { - if (MORPHO_ISINTEGER(a)) a=MORPHO_INTEGERTOFLOAT(a); - if (MORPHO_ISINTEGER(b)) b=MORPHO_INTEGERTOFLOAT(b); - - if (MORPHO_ISFLOAT(a) && MORPHO_ISFLOAT(b)) { - out=MORPHO_FLOAT(fmod(MORPHO_GETFLOATVALUE(a), MORPHO_GETFLOATVALUE(b))); - } else morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_INT); - } - } else morpho_runtimeerror(v, VM_INVALIDARGS, 2, nargs); - return out; +value builtin_mod__int_int(vm *v, int nargs, value *args) { + value a = MORPHO_GETARG(args, 0); + value b = MORPHO_GETARG(args, 1); + return MORPHO_INTEGER(MORPHO_GETINTEGERVALUE(a) % MORPHO_GETINTEGERVALUE(b)); +} + +value builtin_mod__float_float(vm *v, int nargs, value *args) { + value a = MORPHO_GETARG(args, 0); + value b = MORPHO_GETARG(args, 1); + return MORPHO_FLOAT(fmod(MORPHO_GETFLOATVALUE(a), MORPHO_GETFLOATVALUE(b))); +} + +value builtin_mod__int_float(vm *v, int nargs, value *args) { + return MORPHO_FLOAT(fmod((double) MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)), + MORPHO_GETFLOATVALUE(MORPHO_GETARG(args, 1)))); +} + +value builtin_mod__float_int(vm *v, int nargs, value *args) { + return MORPHO_FLOAT(fmod(MORPHO_GETFLOATVALUE(MORPHO_GETARG(args, 0)), + (double) MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)))); +} + +value builtin_mod__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, VM_INVALIDARGS, 2, nargs); + return MORPHO_NIL; } /** find the sign of a number */ -static value builtin_sign(vm *v, int nargs, value *args){ - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - if (MORPHO_ISFLOAT(arg)) { - - if (MORPHO_GETFLOATVALUE(arg)>0) { - return MORPHO_FLOAT(1); - } - else if (MORPHO_GETFLOATVALUE(arg)<0){ - return MORPHO_FLOAT(-1); - } - else return MORPHO_FLOAT(0); - - } else if (MORPHO_ISINTEGER(arg)) { - if (MORPHO_GETINTEGERVALUE(arg)>0) { - return MORPHO_FLOAT(1); - } - else if (MORPHO_GETINTEGERVALUE(arg)<0){ - return MORPHO_FLOAT(-1); - } - else return MORPHO_FLOAT(0); - } else { - morpho_runtimeerror(v, MATH_ARGS,FUNCTION_SIGN); - } +static value builtin_sign__value(vm *v, int nargs, value *args){ + double val; + if (!morpho_valuetofloat(MORPHO_GETARG(args, 0), &val)) { + morpho_runtimeerror(v, MATH_ARGS, FUNCTION_SIGN); + return MORPHO_NIL; } - morpho_runtimeerror(v, MATH_NUMARGS,FUNCTION_SIGN); + + if (val>0) return MORPHO_FLOAT(1); + if (val<0) return MORPHO_FLOAT(-1); + return MORPHO_FLOAT(0); +} + +static value builtin_sign__float(vm *v, int nargs, value *args){ + return builtin_sign__value(v, nargs, args); +} + +static value builtin_sign__int(vm *v, int nargs, value *args){ + return builtin_sign__value(v, nargs, args); +} + +static value builtin_sign__err(vm *v, int nargs, value *args){ + morpho_runtimeerror(v, MATH_NUMARGS, FUNCTION_SIGN); return MORPHO_NIL; } @@ -382,78 +385,56 @@ static value builtin_sign(vm *v, int nargs, value *args){ * Elementary complex functions * *************************************/ -value builtin_real(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - if (MORPHO_ISNUMBER(arg)) { - return arg; - } else if (MORPHO_ISCOMPLEX(arg)) { - objectcomplex *c=MORPHO_GETCOMPLEX(arg); - double val; - complex_getreal(c,&val); - return MORPHO_FLOAT(val); - } - } - morpho_runtimeerror(v, MATH_NUMARGS, "real"); - return MORPHO_NIL; +value builtin_real__number(vm *v, int nargs, value *args) { + return MORPHO_GETARG(args, 0); } -value builtin_imag(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - if (MORPHO_ISNUMBER(arg)) { - return MORPHO_FLOAT(0); - } else if (MORPHO_ISCOMPLEX(arg)) { - objectcomplex *c=MORPHO_GETCOMPLEX(arg); - double val; - complex_getimag(c,&val); - return MORPHO_FLOAT(val); - } - } - morpho_runtimeerror(v, MATH_NUMARGS, "imag"); - return MORPHO_NIL; +value builtin_real__complex(vm *v, int nargs, value *args) { + objectcomplex *c=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + double val; + complex_getreal(c,&val); + return MORPHO_FLOAT(val); } -value builtin_angle(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - if (MORPHO_ISNUMBER(arg)) { - double val; - morpho_valuetofloat(arg,&val); - if (val>=0) { - return MORPHO_FLOAT(0); - } - else return MORPHO_FLOAT(M_PI); - } else if (MORPHO_ISCOMPLEX(arg)) { - objectcomplex *c=MORPHO_GETCOMPLEX(arg); - double val; - complex_angle(c,&val); - return MORPHO_FLOAT(val); - } - } - morpho_runtimeerror(v, MATH_NUMARGS, "angle"); - return MORPHO_NIL; +value builtin_imag__number(vm *v, int nargs, value *args) { + return MORPHO_FLOAT(0); } -value builtin_conj(vm *v, int nargs, value *args) { - if (nargs==1) { - value arg = MORPHO_GETARG(args, 0); - if (MORPHO_ISNUMBER(arg)) { - return arg; - } else if (MORPHO_ISCOMPLEX(arg)) { - objectcomplex *a=MORPHO_GETCOMPLEX(arg); - value out=MORPHO_NIL; - objectcomplex *new = object_newcomplex(0,0); - if (new) { - complex_conj(a, new); - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } - return out; - } +value builtin_imag__complex(vm *v, int nargs, value *args) { + objectcomplex *c=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + double val; + complex_getimag(c,&val); + return MORPHO_FLOAT(val); +} + +value builtin_angle__number(vm *v, int nargs, value *args) { + double val; + morpho_valuetofloat(MORPHO_GETARG(args, 0), &val); + if (val>=0) return MORPHO_FLOAT(0); + return MORPHO_FLOAT(M_PI); +} + +value builtin_angle__complex(vm *v, int nargs, value *args) { + objectcomplex *c=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + double val; + complex_angle(c,&val); + return MORPHO_FLOAT(val); +} + +value builtin_conj__number(vm *v, int nargs, value *args) { + return MORPHO_GETARG(args, 0); +} + +value builtin_conj__complex(vm *v, int nargs, value *args) { + objectcomplex *a=MORPHO_GETCOMPLEX(MORPHO_GETARG(args, 0)); + value out=MORPHO_NIL; + objectcomplex *new = object_newcomplex(0,0); + if (new) { + complex_conj(a, new); + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); } - morpho_runtimeerror(v, MATH_NUMARGS, "conj"); - return MORPHO_NIL; + return out; } /* ************************************ @@ -698,14 +679,28 @@ void functiondefs_initialize(void) { // Math functions with special cases builtin_addfunction(FUNCTION_ARCTAN, builtin_arctan, BUILTIN_FLAGSEMPTY); BUILTIN_MATH_OLD2(sqrt); - builtin_addfunction(FUNCTION_MOD, builtin_mod, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_SIGN, builtin_sign, BUILTIN_FLAGSEMPTY); + morpho_addfunction(FUNCTION_MOD, "Int (Int,Int)", builtin_mod__int_int, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (Float,Float)", builtin_mod__float_float, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (Int,Float)", builtin_mod__int_float, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (Float,Int)", builtin_mod__float_int, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (...)", builtin_mod__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_SIGN, "Float (Int)", builtin_sign__int, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_SIGN, "Float (Float)", builtin_sign__float, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_SIGN, "Float (...)", builtin_sign__err, BUILTIN_FLAGSEMPTY, NULL); // Complex - builtin_addfunction(FUNCTION_REAL, builtin_real, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_IMAG, builtin_imag, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_ANGLE, builtin_angle, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_CONJ, builtin_conj, BUILTIN_FLAGSEMPTY); + morpho_addfunction(FUNCTION_REAL, "Float (Complex)", builtin_real__complex, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_REAL, "Int (Int)", builtin_real__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_REAL, "Float (Float)", builtin_real__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_IMAG, "Float (Complex)", builtin_imag__complex, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_IMAG, "Float (Int)", builtin_imag__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_IMAG, "Float (Float)", builtin_imag__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ANGLE, "Float (Complex)", builtin_angle__complex, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ANGLE, "Float (Int)", builtin_angle__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ANGLE, "Float (Float)", builtin_angle__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_CONJ, "Complex (Complex)", builtin_conj__complex, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_CONJ, "Int (Int)", builtin_conj__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_CONJ, "Float (Float)", builtin_conj__number, BUILTIN_FLAGSEMPTY, NULL); // Min/max builtin_addfunction(FUNCTION_BOUNDS, builtin_bounds, BUILTIN_FLAGSEMPTY); diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 11d96050e..42529d2fc 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -970,7 +970,8 @@ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution bucket[nresolutions]; int count = 0; for (int j=0; j Date: Thu, 30 Apr 2026 07:13:06 -0400 Subject: [PATCH 378/473] Arctan --- src/builtin/functiondefs.c | 72 ++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 5f49adae2..2dae7f406 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -289,42 +289,30 @@ value builtin_sqrt(vm *v, int nargs, value *args) { } /** The arctan function is special; it can either take one or two arguments */ -value builtin_arctan(vm *v, int nargs, value *args) { - bool useComplex = false; - for (unsigned int i=0; i Date: Thu, 30 Apr 2026 21:31:10 -0400 Subject: [PATCH 379/473] Metafunctionized apply --- src/builtin/builtin.c | 9 ---- src/builtin/builtin.h | 2 - src/builtin/functiondefs.c | 78 ++++++++++++++++++---------- src/classes/clss.c | 6 +-- src/classes/metafunction.c | 104 ++++++++++++++++++++++--------------- test/builtin/apply.morpho | 2 +- test/builtin/veneer.morpho | 4 +- 7 files changed, 119 insertions(+), 86 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 9408e37fc..6607854f5 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -126,15 +126,6 @@ bool builtin_options(vm *v, int nargs, value *args, int *nfixed, int noptions, . return true; } -/** Tests whether an object is callable */ -bool builtin_iscallable(value val) { - return (MORPHO_ISOBJECT(val) && (MORPHO_ISFUNCTION(val) || - MORPHO_ISCLOSURE(val) || - MORPHO_ISINVOCATION(val) || - MORPHO_ISBUILTINFUNCTION(val) || - MORPHO_ISMETAFUNCTION(val))); -} - /* ********************************************************************** * object_builtinfunction definition * ********************************************************************** */ diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index e9c106fdd..5ed14e7eb 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -139,8 +139,6 @@ value builtin_internsymbolascstring(char *symbol); bool builtin_checksymbol(value symbol); bool builtin_options(vm *v, int nargs, value *args, int *nfixed, int noptions, ...); -bool builtin_iscallable(value val); - bool builtin_enumerateloop(vm *v, value obj, builtin_loopfunction fn, void *ref); /* ------------------------------------------------------- diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 2dae7f406..62a96d70f 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -55,35 +55,32 @@ value builtin_clock(vm *v, int nargs, value *args) { * Apply * *************************************/ +static value builtin_apply__tuple(vm *v, int nargs, value *args) { + value ret = MORPHO_NIL; + objecttuple *t = MORPHO_GETTUPLE(MORPHO_GETARG(args, 1)); + morpho_call(v, MORPHO_GETARG(args, 0), tuple_length(t), t->tuple, &ret); + return ret; +} + +static value builtin_apply__list(vm *v, int nargs, value *args) { + value ret = MORPHO_NIL; + objectlist *lst = MORPHO_GETLIST(MORPHO_GETARG(args, 1)); + morpho_call(v, MORPHO_GETARG(args, 0), list_length(lst), lst->val.data, &ret); + return ret; +} + /** Apply a function to a list of arguments */ value builtin_apply(vm *v, int nargs, value *args) { value ret = MORPHO_NIL; - - if (nargs<2) morpho_runtimeerror(v, APPLY_ARGS); - - value fn = MORPHO_GETARG(args, 0); - value x = MORPHO_GETARG(args, 1); - - if (!morpho_iscallable(fn)) { - morpho_runtimeerror(v, APPLY_NOTCALLABLE); - return MORPHO_NIL; - } - - if (nargs==2 && MORPHO_ISTUPLE(x)) { - objecttuple *t = MORPHO_GETTUPLE(x); - - morpho_call(v, fn, t->length, t->tuple, &ret); - } else if (nargs==2 && MORPHO_ISLIST(x)) { - objectlist *lst = MORPHO_GETLIST(x); - - morpho_call(v, fn, lst->val.count, lst->val.data, &ret); - } else { - morpho_call(v, fn, nargs-1, &MORPHO_GETARG(args, 1), &ret); - } - + morpho_call(v, MORPHO_GETARG(args, 0), nargs-1, &MORPHO_GETARG(args, 1), &ret); return ret; } +static value builtin_apply__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, APPLY_ARGS); + return MORPHO_NIL; +} + /* ************************************ * Random numbers * *************************************/ @@ -499,6 +496,11 @@ static value builtin_bounds(vm *v, int nargs, value *args) { return out; } +static value builtin_bounds__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MAX_ARGS, FUNCTION_BOUNDS); + return MORPHO_NIL; +} + /** Find the minimum value in an enumerable object */ static value builtin_min(vm *v, int nargs, value *args) { value m[nargs+1]; @@ -512,6 +514,11 @@ static value builtin_min(vm *v, int nargs, value *args) { return out; } +static value builtin_min__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MAX_ARGS, FUNCTION_MIN); + return MORPHO_NIL; +} + /** Find the maximum value in an enumerable object */ static value builtin_max(vm *v, int nargs, value *args) { value m[nargs+1]; @@ -525,6 +532,11 @@ static value builtin_max(vm *v, int nargs, value *args) { return out; } +static value builtin_max__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, MAX_ARGS, FUNCTION_MAX); + return MORPHO_NIL; +} + /* ************************************ * Type checking and conversion * *************************************/ @@ -575,7 +587,7 @@ BUILTIN_TYPECHECK(isfield, MORPHO_ISFIELD) /** Check if something is callable */ value builtin_iscallablefunction(vm *v, int nargs, value *args) { - if (builtin_iscallable(MORPHO_GETARG(args, 0))) return MORPHO_TRUE; + if (MORPHO_ISCALLABLE(MORPHO_GETARG(args, 0))) return MORPHO_TRUE; return MORPHO_FALSE; } @@ -617,7 +629,11 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, BUILTIN_FLAGSEMPTY, NULL); // Apply - builtin_addfunction(FUNCTION_APPLY, builtin_apply, BUILTIN_FLAGSEMPTY); + morpho_addfunction(FUNCTION_APPLY, "(Callable,Tuple)", builtin_apply__tuple, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_APPLY, "(Callable,List)", builtin_apply__list, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_APPLY, "(Callable,_,...)", builtin_apply, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_APPLY, "()", builtin_apply__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_APPLY, "(_)", builtin_apply__err, BUILTIN_FLAGSEMPTY, NULL); // Random numbers morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, BUILTIN_FLAGSEMPTY, NULL); @@ -701,9 +717,15 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_CONJ, "Float (Float)", builtin_conj__number, BUILTIN_FLAGSEMPTY, NULL); // Min/max - builtin_addfunction(FUNCTION_BOUNDS, builtin_bounds, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_MIN, builtin_min, BUILTIN_FLAGSEMPTY); - builtin_addfunction(FUNCTION_MAX, builtin_max, BUILTIN_FLAGSEMPTY); + morpho_addfunction(FUNCTION_BOUNDS, "List (_)", builtin_bounds, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOUNDS, "List (_,...)", builtin_bounds, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOUNDS, "List ()", builtin_bounds__err, BUILTIN_FLAGSEMPTY, NULL); + //morpho_addfunction(FUNCTION_MIN, "(_)", builtin_min, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MIN, "(_,...)", builtin_min, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MIN, "()", builtin_min__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MAX, "(_)", builtin_max, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MAX, "(_,...)", builtin_max, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MAX, "()", builtin_max__err, BUILTIN_FLAGSEMPTY, NULL); // Type checking BUILTIN_TYPECHECK(isnil) diff --git a/src/classes/clss.c b/src/classes/clss.c index ef8a1fdb0..4abecfe9a 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -216,10 +216,10 @@ objecttype objectclasstype; void class_initialize(void) { // objectclass is a core type so is intialized earlier - // Locate the Object class to use as the parent class of Class - value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); + // Locate the Callable class to use as the parent class of Class + value callableclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); - value classclass=builtin_addclass(CLASS_CLASSNAME, MORPHO_GETCLASSDEFINITION(Class), objclass); + value classclass=builtin_addclass(CLASS_CLASSNAME, MORPHO_GETCLASSDEFINITION(Class), callableclass); object_setveneerclass(OBJECT_CLASS, classclass); // No constructor function; classes are created internally diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 42529d2fc..3cd8690c8 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -459,6 +459,14 @@ typedef struct { int nresolutions; } mfcompiler; +/** Path-local facts accumulated while compiling one resolver branch. */ +typedef struct { + int knownarity; + bool aritychecked; + int nparams; + value *known; +} mfcompilerpath; + /** Initialize compiler state. */ static void mfcompiler_init(mfcompiler *compiler, objectmetafunction *fn, error *err) { compiler->fn = fn; @@ -832,8 +840,7 @@ static bool mfcompiler_choosetypeparam(int nresolutions, mfcompileresolution *re return (bestparam>=0 && bestuseful>0); } -static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, - int knownarity, int nparams, value *known, mfindx *entry); +static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfcompilerpath *path, mfindx *entry); /** Compile the resolver entry point. */ static bool mfcompiler_compileentry(mfcompiler *compiler, mfindx *entry) { @@ -843,7 +850,8 @@ static bool mfcompiler_compileentry(mfcompiler *compiler, mfindx *entry) { value known[nparams]; for (int i=0; inresolutions, compiler->resolutions, -1, nparams, known, entry); + mfcompilerpath path = { .knownarity = -1, .aritychecked = false, .nparams = nparams, .known = known }; + return mfcompiler_emitresolver(compiler, compiler->nresolutions, compiler->resolutions, &path, entry); } /** Compare resolutions by arity for sorting. */ @@ -852,8 +860,8 @@ static int mfcompiler_compareresolutionarity(const void *a, const void *b) { return (xi > yi) - (xi < yi); // Ascending order } -/** Emit an untyped exact-arity case if a unique fixed-arity winner exists. */ -static bool mfcompiler_emitfixedaritywinner(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfindx *entry) { +/** Emit an exact-arity case if a unique winner is already fully determined. */ +static bool mfcompiler_emitfixedaritywinner(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, int nparams, value *known, mfindx *entry) { int winner = -1; for (int i=0; i=0) return mfcompiler_emitresolve(compiler, resolutions[winner].fnindex, entry); - if (nresolutions==1) return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); + if (winner>=0 && mfcompiler_resolutionisterminal(&resolutions[winner], nparams, known)) { + return mfcompiler_emitresolve(compiler, resolutions[winner].fnindex, entry); + } else if (nresolutions==1 && mfcompiler_resolutionisterminal(&resolutions[0], nparams, known)) { + return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); + } return false; } /** Collect wildcard resolutions for a typed split. */ -static bool mfcompiler_defaultsubset(int nresolutions, mfcompileresolution *resolutions, - int param, mfcompileresolution *subset, int *count) { +static bool mfcompiler_defaultsubset(int nresolutions, mfcompileresolution *resolutions, int param, mfcompileresolution *subset, int *count) { int ndefault = 0; for (int i=0; inparams]; mfcompileresolution subset[nresolutions]; int count = 0; @@ -894,14 +902,16 @@ static bool mfcompiler_emitchildcases(mfcompiler *compiler, int nresolutions, mf value actual = children->contents[i].key; if (MORPHO_ISNIL(actual)) continue; - memcpy(childknown, known, sizeof(value)*nparams); + memcpy(childknown, path->known, sizeof(value)*path->nparams); childknown[param] = actual; + mfcompilerpath childpath = *path; + childpath.known = childknown; - int nsubset = mfcompiler_collectsubset(nresolutions, resolutions, knownarity, nparams, childknown, subset); + int nsubset = mfcompiler_collectsubset(nresolutions, resolutions, path->knownarity, path->nparams, childknown, subset); if (nsubset<=0) continue; table[count].value = MORPHO_GETCLASS(actual)->uid; - ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nsubset, subset, knownarity, nparams, childknown, &table[count].target)); + ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nsubset, subset, &childpath, &table[count].target)); count++; } @@ -910,8 +920,7 @@ static bool mfcompiler_emitchildcases(mfcompiler *compiler, int nresolutions, mf } /** Emit a typed resolver for one exact-arity candidate set. */ -static bool mfcompiler_emittypedresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, - int knownarity, int nparams, value *known, mfindx *entry) { +static bool mfcompiler_emittypedresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfcompilerpath *path, mfindx *entry) { int param, defaultcount, ncases; dictionary children; mfcompileresolution defaultsubset[nresolutions]; @@ -919,7 +928,7 @@ static bool mfcompiler_emittypedresolver(mfcompiler *compiler, int nresolutions, dictionary_init(&children); - ERR_CHECK(mfcompiler_choosetypeparam(nresolutions, resolutions, knownarity, nparams, known, ¶m), mfcompiler_emittypedresolver_cleanup); + ERR_CHECK(mfcompiler_choosetypeparam(nresolutions, resolutions, path->knownarity, path->nparams, path->known, ¶m), mfcompiler_emittypedresolver_cleanup); ERR_CHECK(mfcompiler_paramchildren(nresolutions, resolutions, param, &children), mfcompiler_emittypedresolver_cleanup); { @@ -928,11 +937,11 @@ static bool mfcompiler_emittypedresolver(mfcompiler *compiler, int nresolutions, ERR_CHECK(mfcompiler_defaultsubset(nresolutions, resolutions, param, defaultsubset, &defaultcount), mfcompiler_emittypedresolver_cleanup); if (defaultcount>0) { - ERR_CHECK(mfcompiler_emitresolver(compiler, defaultcount, defaultsubset, knownarity, nparams, known, &deflt), mfcompiler_emittypedresolver_cleanup); + ERR_CHECK(mfcompiler_emitresolver(compiler, defaultcount, defaultsubset, path, &deflt), mfcompiler_emittypedresolver_cleanup); } else ERR_CHECK(mfcompiler_emitslow(compiler, &deflt), mfcompiler_emittypedresolver_cleanup); - ERR_CHECK(mfcompiler_emitchildcases(compiler, nresolutions, resolutions, knownarity, nparams, - known, param, &children, table, &ncases), mfcompiler_emittypedresolver_cleanup); + ERR_CHECK(mfcompiler_emitchildcases(compiler, nresolutions, resolutions, path, + param, &children, table, &ncases), mfcompiler_emittypedresolver_cleanup); if (ncases<=0) goto mfcompiler_emittypedresolver_cleanup; ERR_CHECK(mfcompiler_emitgetuid(compiler, param, entry), mfcompiler_emittypedresolver_cleanup); ERR_CHECK(mfcompiler_emitsparse(compiler, ncases, table, deflt, NULL), mfcompiler_emittypedresolver_cleanup); @@ -947,17 +956,27 @@ static bool mfcompiler_emittypedresolver(mfcompiler *compiler, int nresolutions, } /** Emit an arity-first resolver for a candidate set. */ -static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, - int nparams, value *known, mfindx *entry) { +static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfcompilerpath *path, mfindx *entry) { mfcompileresolution sorted[nresolutions]; + mfcompileresolution vargsubset[nresolutions]; memcpy(sorted, resolutions, sizeof(mfcompileresolution)*nresolutions); qsort(sorted, nresolutions, sizeof(mfcompileresolution), mfcompiler_compareresolutionarity); mfindx deflt; - bool hasvarg = false; - for (int i=0; inparams, path->known)) { + vargsubset[nvarg++] = sorted[i]; + } + } + if (nvarg<=0) { + ERR_CHECK_RETURN(mfcompiler_emitfail(compiler, &deflt)); + } else { + mfcompilerpath defltpath = *path; + defltpath.aritychecked = true; + ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nvarg, vargsubset, &defltpath, &deflt)); + } mfcompilersparseentry table[nresolutions]; int ncases = 0; @@ -972,13 +991,16 @@ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, for (int j=0; jnparams, path->known)) { bucket[count++] = sorted[j]; } } table[ncases].value = arity; - ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, count, bucket, arity, nparams, known, &table[ncases].target)); + mfcompilerpath bucketpath = *path; + bucketpath.knownarity = arity; + bucketpath.aritychecked = true; + ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, count, bucket, &bucketpath, &table[ncases].target)); ncases++; } @@ -986,38 +1008,38 @@ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, } /** Emit a resolver block for a filtered candidate set. */ -static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, - int knownarity, int nparams, value *known, mfindx *entry) { +static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfcompilerpath *path, mfindx *entry) { /* No candidates remain on this path. */ if (nresolutions<=0) return mfcompiler_emitfail(compiler, entry); /* A single fully-determined resolution can be emitted directly. */ - if (nresolutions==1 && mfcompiler_resolutionisterminal(&resolutions[0], nparams, known)) { + if (nresolutions==1 && mfcompiler_resolutionisterminal(&resolutions[0], path->nparams, path->known)) { return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); } bool hastyped = mfcompiler_hastypedresolutions(nresolutions, resolutions); /* For exact arity without typed params, emit the lone fixed-arity winner. */ - if (!hastyped && knownarity>=0) { - if (mfcompiler_emitfixedaritywinner(compiler, nresolutions, resolutions, entry)) return true; + if (!hastyped && path->knownarity>=0) { + if (mfcompiler_emitfixedaritywinner(compiler, nresolutions, resolutions, path->nparams, path->known, entry)) return true; } /* Known path facts may already determine the winner. */ - if (knownarity>=0) { + if (path->aritychecked) { int fnindex; - if (mfcompiler_resolveknownsubset(nresolutions, resolutions, nparams, known, &fnindex)) { + if (mfcompiler_resolveknownsubset(nresolutions, resolutions, path->nparams, path->known, &fnindex)) { return mfcompiler_emitresolve(compiler, fnindex, entry); } } /* Split by arity before considering typed dispatch. */ - if (knownarity<0 && (mfcompiler_countarities(nresolutions, resolutions)>1 || mfcompiler_hasvargresolutions(nresolutions, resolutions))) { - return mfcompiler_emitarityresolver(compiler, nresolutions, resolutions, nparams, known, entry); + if (!path->aritychecked && + (mfcompiler_countarities(nresolutions, resolutions)>1 || mfcompiler_hasvargresolutions(nresolutions, resolutions))) { + return mfcompiler_emitarityresolver(compiler, nresolutions, resolutions, path, entry); } - /* Otherwise try a typed split on the current exact-arity subset. */ + /* Otherwise try a typed split on the current arity-filtered subset. */ if (hastyped) { - if (mfcompiler_emittypedresolver(compiler, nresolutions, resolutions, knownarity, nparams, known, entry)) return true; + if (mfcompiler_emittypedresolver(compiler, nresolutions, resolutions, path, entry)) return true; } /* Fall back to the runtime resolver when no fast split is worthwhile. */ diff --git a/test/builtin/apply.morpho b/test/builtin/apply.morpho index 605e7f467..54ead034c 100644 --- a/test/builtin/apply.morpho +++ b/test/builtin/apply.morpho @@ -14,4 +14,4 @@ apply(f, 1,2,3) // expect: 6 apply([1,2,3], f) -// expect error 'ApplyNtCllble' \ No newline at end of file +// expect error 'MltplDsptchFld' diff --git a/test/builtin/veneer.morpho b/test/builtin/veneer.morpho index 3f7df1b46..5d7b94e40 100644 --- a/test/builtin/veneer.morpho +++ b/test/builtin/veneer.morpho @@ -1,6 +1,6 @@ // Veneer class for builtin functions -print apply.clss() // expect: @CFunction +print apply.clss() // expect: @Metafunction print apply.tostring() -// expect: \ No newline at end of file +// expect: From 65e5ea8c62a054c6452b2a3942405fa88ae24e5a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 08:26:59 -0400 Subject: [PATCH 380/473] Improve clarity of metafunction compiler --- src/classes/metafunction.c | 161 ++++++++++++++++++++++++++++++------- 1 file changed, 133 insertions(+), 28 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 3cd8690c8..b928b5016 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -568,6 +568,14 @@ typedef struct { mfindx target; } mfcompilersparseentry; +/** One emitted child subtree that can be reused by later sparse cases. */ +typedef struct { + int nsubset; + value *known; + mfcompileresolution *subset; + mfindx target; +} mfcompileremittedcase; + /** Emit a sparse branch over a table of value/target matches. */ static bool mfcompiler_emitsparse(mfcompiler *compiler, int ncases, mfcompilersparseentry *table, mfindx deflt, mfindx *entry) { mfinstruction header[3] = { MFOP_SPARSE, ncases, deflt }; @@ -718,6 +726,93 @@ static bool mfcompiler_haspendingtypes(int nresolutions, mfcompileresolution *re return false; } +/** Count distinct declared non-wildcard types for one parameter in a subset. */ +static int mfcompiler_countparamtypes(int nresolutions, mfcompileresolution *resolutions, int param) { + value seen[nresolutions]; + int count = 0; + + for (int i=0; inparams, b->nparams, nparams); @@ -791,30 +886,25 @@ static bool mfcompiler_subsetisuseful(int nresolutions, mfcompileresolution *res /** Count useful runtime-class branches for a parameter. */ static int mfcompiler_parambranchcount(int nresolutions, mfcompileresolution *resolutions, int knownarity, int nparams, value *known, int param) { + int useful = 0; if (mfcompiler_paramisknown(known, param)) return 0; - int useful = 0; + value childknown[nparams]; + mfcompileresolution subset[nresolutions]; dictionary children; dictionary_init(&children); - if (!mfcompiler_paramchildren(nresolutions, resolutions, param, &children)) { - dictionary_clear(&children); - return 0; - } + ERR_CHECK(mfcompiler_paramchildren(nresolutions, resolutions, param, &children), mfcompiler_parambranchcount_cleanup); - value childknown[nparams]; - mfcompileresolution subset[nresolutions]; for (unsigned int i=0; i0 && (count0 && (count=0 && mfcompiler_resolutionisterminal(&resolutions[winner], nparams, known)) { - return mfcompiler_emitresolve(compiler, resolutions[winner].fnindex, entry); - } else if (nresolutions==1 && mfcompiler_resolutionisterminal(&resolutions[0], nparams, known)) { - return mfcompiler_emitresolve(compiler, resolutions[0].fnindex, entry); + if (winner<0) { + if (nresolutions!=1) return false; + winner = 0; } - return false; + if (!mfcompiler_resolutionisterminal(&resolutions[winner], nparams, known)) return false; + return mfcompiler_emitresolve(compiler, resolutions[winner].fnindex, entry); } /** Collect wildcard resolutions for a typed split. */ @@ -894,24 +982,41 @@ static bool mfcompiler_defaultsubset(int nresolutions, mfcompileresolution *reso /** Emit typed child branches for one split parameter. */ static bool mfcompiler_emitchildcases(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfcompilerpath *path, int param, dictionary *children, mfcompilersparseentry *table, int *ncases) { - value childknown[path->nparams]; + value childknown[children->count][path->nparams]; + value canonknown[children->count][path->nparams]; mfcompileresolution subset[nresolutions]; - int count = 0; + mfcompileremittedcase emitted[children->count]; + mfcompileresolution emittedsubset[children->count][nresolutions]; + int count = 0, nemitted = 0; for (unsigned int i=0; icapacity; i++) { value actual = children->contents[i].key; if (MORPHO_ISNIL(actual)) continue; - memcpy(childknown, path->known, sizeof(value)*path->nparams); - childknown[param] = actual; + value *known = childknown[count]; + value *canon = canonknown[count]; mfcompilerpath childpath = *path; - childpath.known = childknown; + childpath.known = known; - int nsubset = mfcompiler_collectsubset(nresolutions, resolutions, path->knownarity, path->nparams, childknown, subset); + int nsubset = mfcompiler_collectchildsubset(nresolutions, resolutions, path->knownarity, path->nparams, + path->known, known, param, actual, subset, canon); if (nsubset<=0) continue; table[count].value = MORPHO_GETCLASS(actual)->uid; - ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nsubset, subset, &childpath, &table[count].target)); + + int match = mfcompiler_findemittedcase(nemitted, emitted, nsubset, subset, path->nparams, canon); + if (match>=0) { + table[count].target = emitted[match].target; + } else { + ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nsubset, subset, &childpath, &table[count].target)); + memcpy(emittedsubset[nemitted], subset, sizeof(mfcompileresolution)*nsubset); + emitted[nemitted].nsubset = nsubset; + emitted[nemitted].known = canon; + emitted[nemitted].subset = emittedsubset[nemitted]; + emitted[nemitted].target = table[count].target; + nemitted++; + } + count++; } From a26c9b9909e159c4922546d47373fa84faa0c735 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 09:45:04 -0400 Subject: [PATCH 381/473] Improve constructor metafunction signatures --- src/builtin/functiondefs.c | 17 +++++---- src/classes/file.c | 74 ++++++++++++++++++++++++-------------- src/classes/invocation.c | 50 +++++++++++++------------- src/classes/metafunction.c | 2 +- 4 files changed, 83 insertions(+), 60 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 62a96d70f..3054b99c0 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -507,8 +507,7 @@ static value builtin_min(vm *v, int nargs, value *args) { value out = MORPHO_NIL; if (builtin_minmaxargs(v, nargs, args, m, NULL, FUNCTION_MIN)) { - if (nargs>0) value_minmax(nargs, m, &out, NULL); - else morpho_runtimeerror(v, MAX_ARGS, FUNCTION_MIN); + value_minmax(nargs, m, &out, NULL); } return out; @@ -525,8 +524,7 @@ static value builtin_max(vm *v, int nargs, value *args) { value out = MORPHO_NIL; if (builtin_minmaxargs(v, nargs, args, NULL, m, FUNCTION_MAX)) { - if (nargs>0) value_minmax(nargs, m, NULL, &out); - else morpho_runtimeerror(v, MAX_ARGS, FUNCTION_MAX); + value_minmax(nargs, m, NULL, &out); } return out; @@ -619,7 +617,8 @@ value builtin_iscallablefunction_err(vm *v, int nargs, value *args) { #define BUILTIN_TYPECHECK(function) \ morpho_addfunction(#function, "Bool (_)", builtin_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(#function, "Bool (_,...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(#function, "Bool ()", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(#function, "Bool (_,_,...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); void functiondefs_initialize(void) { // System @@ -653,7 +652,8 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_FLOAT, "Float (...)", builtin_float__err, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_BOOL, "Bool (_)", builtin_bool, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_BOOL, "Bool (_,...)", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOOL, "Bool ()", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOOL, "Bool (_,_,...)", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); // Math functions BUILTIN_VARMATH(FUNCTION_ABS, fabs) @@ -720,10 +720,8 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_BOUNDS, "List (_)", builtin_bounds, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_BOUNDS, "List (_,...)", builtin_bounds, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_BOUNDS, "List ()", builtin_bounds__err, BUILTIN_FLAGSEMPTY, NULL); - //morpho_addfunction(FUNCTION_MIN, "(_)", builtin_min, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_MIN, "(_,...)", builtin_min, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_MIN, "()", builtin_min__err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MAX, "(_)", builtin_max, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_MAX, "(_,...)", builtin_max, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_MAX, "()", builtin_max__err, BUILTIN_FLAGSEMPTY, NULL); @@ -757,7 +755,8 @@ void functiondefs_initialize(void) { #endif morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_)", builtin_iscallablefunction, MORPHO_FN_PUREFN, NULL); - morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_,...)", builtin_iscallablefunction_err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ISCALLABLE, "Bool ()", builtin_iscallablefunction_err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_,_,...)", builtin_iscallablefunction_err, BUILTIN_FLAGSEMPTY, NULL); /* Define errors */ morpho_defineerror(MATH_ARGS, ERROR_HALT, MATH_ARGS_MSG); diff --git a/src/classes/file.c b/src/classes/file.c index 53ae4e33b..fe9d66fa7 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -185,34 +185,12 @@ value file_readlineusingvarray(FILE *f, varray_char *string) { * File class * ********************************************************************** */ -/** File constructor - * In: 1. a file name - * 2. (optional) a string giving the requested status, e.g. "wr+" - */ -value file_constructor(vm *v, int nargs, value *args) { +/** Open a file using an already-validated name and mode string. */ +static value file_open(vm *v, value filenamearg, char *cmode) { objectfile *new=NULL; value out=MORPHO_NIL; value filename=MORPHO_NIL; - char *fname=NULL; - char *cmode = "r"; - - if (nargs>0) { - if (MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - fname=MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); - } else MORPHO_RAISE(v, FILE_FILENAMEARG); - - if (nargs>1) { - if (MORPHO_ISSTRING(MORPHO_GETARG(args, 1))) { - char *mode=MORPHO_GETCSTRING(MORPHO_GETARG(args, 1)); - switch (mode[0]) { - case 'r': cmode="r"; break; - case 'w': cmode="w"; break; - case 'a': cmode="a"; break; - default: MORPHO_RAISE(v, FILE_MODE); - } - } else MORPHO_RAISE(v, FILE_MODE); - } - } else MORPHO_RAISE(v, FILE_NEEDSFILENAME); + char *fname=MORPHO_GETCSTRING(filenamearg); if (fname) { FILE *f = file_openrelative(fname, cmode); @@ -231,6 +209,45 @@ value file_constructor(vm *v, int nargs, value *args) { return out; } +/** File constructor: File(String) */ +value file_constructor__string(vm *v, int nargs, value *args) { + return file_open(v, MORPHO_GETARG(args, 0), "r"); +} + +/** File constructor: File(String,String) */ +value file_constructor__string_string(vm *v, int nargs, value *args) { + char *cmode = "r"; + char *mode=MORPHO_GETCSTRING(MORPHO_GETARG(args, 1)); + + switch (mode[0]) { + case 'r': cmode="r"; break; + case 'w': cmode="w"; break; + case 'a': cmode="a"; break; + default: MORPHO_RAISE(v, FILE_MODE); + } + + return file_open(v, MORPHO_GETARG(args, 0), cmode); +} + +/** File constructor missing filename error */ +value file_constructor__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, FILE_NEEDSFILENAME); + return MORPHO_NIL; +} + +/** File constructor bad filename argument */ +value file_constructor__filenamearg(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, FILE_FILENAMEARG); + return MORPHO_NIL; +} + +/** File constructor bad two-argument call */ +value file_constructor__args(vm *v, int nargs, value *args) { + if (!MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) morpho_runtimeerror(v, FILE_FILENAMEARG); + else morpho_runtimeerror(v, FILE_MODE); + return MORPHO_NIL; +} + /** Close a file */ value File_close(vm *v, int nargs, value *args) { FILE *f=file_getfile(MORPHO_SELF(args)); @@ -480,7 +497,12 @@ void file_initialize(void) { value objclass = builtin_findclassfromcstring(OBJECT_CLASSNAME); - morpho_addfunction(FILE_CLASSNAME, FILE_CLASSNAME " (...)", file_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(FILE_CLASSNAME, "File (String)", file_constructor__string, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(FILE_CLASSNAME, "File (_)", file_constructor__filenamearg, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(FILE_CLASSNAME, "File (String,String)", file_constructor__string_string, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(FILE_CLASSNAME, "File (_,_)", file_constructor__args, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(FILE_CLASSNAME, "File ()", file_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(FILE_CLASSNAME, "File (_,_,...)", file_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); value fileclass=builtin_addclass(FILE_CLASSNAME, MORPHO_GETCLASSDEFINITION(File), objclass); object_setveneerclass(OBJECT_FILE, fileclass); diff --git a/src/classes/invocation.c b/src/classes/invocation.c index 204adc567..374f61434 100644 --- a/src/classes/invocation.c +++ b/src/classes/invocation.c @@ -62,34 +62,35 @@ objectinvocation *object_newinvocation(value receiver, value method) { /** Creates a new invocation object */ value invocation_constructor(vm *v, int nargs, value *args) { value out=MORPHO_NIL; + value receiver = MORPHO_GETARG(args, 0); + value selector = MORPHO_GETARG(args, 1); + + if (!MORPHO_ISOBJECT(receiver) || !MORPHO_ISSTRING(selector)) { + morpho_runtimeerror(v, INVOCATION_ARGS); + return MORPHO_NIL; + } + + value method = MORPHO_NIL; + objectclass *klass=morpho_lookupclass(receiver); + + if (dictionary_get(&klass->methods, selector, &method)) { + objectinvocation *new = object_newinvocation(receiver, method); - if (nargs==2) { - value receiver = MORPHO_GETARG(args, 0); - value selector = MORPHO_GETARG(args, 1); - - if (!MORPHO_ISOBJECT(receiver) || !MORPHO_ISSTRING(selector)) { - morpho_runtimeerror(v, INVOCATION_ARGS); - return MORPHO_NIL; - } - - value method = MORPHO_NIL; - - objectclass *klass=morpho_lookupclass(receiver); - - if (dictionary_get(&klass->methods, selector, &method)) { - objectinvocation *new = object_newinvocation(receiver, method); - - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - } - - } else morpho_runtimeerror(v, INVOCATION_ARGS); + if (new) { + out = MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + } return out; } +/** Raises a constructor error */ +value invocation_constructor__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, INVOCATION_ARGS); + return MORPHO_NIL; +} + /** Converts to a string for string interpolation */ value Invocation_tostring(vm *v, int nargs, value *args) { objectinvocation *inv=MORPHO_GETINVOCATION(MORPHO_SELF(args)); @@ -148,7 +149,8 @@ void invocation_initialize(void) { value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); // Invocation constructor function - morpho_addfunction(INVOCATION_CLASSNAME, INVOCATION_CLASSNAME " (...)", invocation_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(INVOCATION_CLASSNAME, "Invocation (_,_)", invocation_constructor, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(INVOCATION_CLASSNAME, "Invocation (...)", invocation_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); // Create invocation veneer class value invocationclass=builtin_addclass(INVOCATION_CLASSNAME, MORPHO_GETCLASSDEFINITION(Invocation), objclass); diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index b928b5016..530a185d1 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1406,7 +1406,7 @@ void metafunction_initialize(void) { // Create function object type objectmetafunctiontype=object_addtype(&objectmetafunctiondefn); - // Locate the Object class to use as the parent class of Metafunction + // Locate the Callable class to use as the parent class of Metafunction value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); // Metafunction constructor function From 351b97278df2f6c428fda073b19067e1d0ea45f0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 10:05:12 -0400 Subject: [PATCH 382/473] Tighten JSON methods --- src/classes/json.c | 47 ++++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/classes/json.c b/src/classes/json.c index 6468b1750..ae2a2a30d 100644 --- a/src/classes/json.c +++ b/src/classes/json.c @@ -566,39 +566,46 @@ bool json_tostring(vm *v, value in, value *out) { value JSON_parse(vm *v, int nargs, value *args) { value out = MORPHO_NIL; - if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - char *src = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); - varray_value objects; - varray_valueinit(&objects); - error err; - error_init(&err); - - if (json_parse(src, &err, &out, &objects)) { - morpho_bindobjects(v, objects.count, objects.data); - } else { - morpho_runtimeerror(v, err.id); - } - varray_valueclear(&objects); - } else morpho_runtimeerror(v, JSON_PRSARGS); + char *src = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); + varray_value objects; + varray_valueinit(&objects); + error err; + error_init(&err); + + if (json_parse(src, &err, &out, &objects)) { + morpho_bindobjects(v, objects.count, objects.data); + } else { + morpho_runtimeerror(v, err.id); + } + varray_valueclear(&objects); return out; } +value JSON_parse__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, JSON_PRSARGS); + return MORPHO_NIL; +} + value JSON_tostring(vm *v, int nargs, value *args) { value out = MORPHO_NIL; - if (nargs==1) { - if (json_tostring(v, MORPHO_GETARG(args, 0), &out)) { - morpho_bindobjects(v, 1, &out); - } + if (json_tostring(v, MORPHO_GETARG(args, 0), &out)) { + morpho_bindobjects(v, 1, &out); } return out; } +value JSON_tostring__err(vm *v, int nargs, value *args) { + return MORPHO_NIL; +} + MORPHO_BEGINCLASS(JSON) -MORPHO_METHOD(JSON_PARSEMETHOD, JSON_parse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, JSON_tostring, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(String)", JSON_parse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(...)", JSON_parse__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(_)", JSON_tostring, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(...)", JSON_tostring__err, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** From 280f99e94f69d0df7a2e6bc4d26f4d8e8d126cdb Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 10:19:43 -0400 Subject: [PATCH 383/473] Harden signatures in System --- src/classes/system.c | 52 +++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/src/classes/system.c b/src/classes/system.c index 585a10f33..15c577813 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -79,16 +79,19 @@ value System_print(vm *v, int nargs, value *args) { /** Sleep for a specified number of seconds */ value System_sleep(vm *v, int nargs, value *args) { - if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - double t; - if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &t)) { - platform_sleep((int) (1000*t)); - } - } else morpho_runtimeerror(v, SLEEP_ARGS); + double t; + if (morpho_valuetofloat(MORPHO_GETARG(args, 0), &t)) { + platform_sleep((int) (1000*t)); + } return MORPHO_NIL; } +value System_sleep__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, SLEEP_ARGS); + return MORPHO_NIL; +} + /** Readline */ value System_readline(vm *v, int nargs, value *args) { value out = MORPHO_NIL; @@ -118,13 +121,15 @@ value System_exit(vm *v, int nargs, value *args) { /** Set working folder */ value System_setworkingfolder(vm *v, int nargs, value *args) { - if (nargs==1 && - MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - char *path = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); - - if (!platform_setcurrentdirectory(path)) morpho_runtimeerror(v, SYS_STWRKDR); - } else morpho_runtimeerror(v, STWRKDR_ARGS); + char *path = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); + if (!platform_setcurrentdirectory(path)) morpho_runtimeerror(v, SYS_STWRKDR); + + return MORPHO_NIL; +} + +value System_setworkingfolder__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, STWRKDR_ARGS); return MORPHO_NIL; } @@ -163,17 +168,20 @@ value System_homefolder(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(System) -MORPHO_METHOD(SYSTEM_PLATFORM_METHOD, System_platform, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_VERSION_METHOD, System_version, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_CLOCK_METHOD, System_clock, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_PLATFORM_METHOD, "String ()", System_platform, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_VERSION_METHOD, "String ()", System_version, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_CLOCK_METHOD, "Float ()", System_clock, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, System_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_SLEEP_METHOD, System_sleep, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_READLINE_METHOD, System_readline, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_ARGUMENTS_METHOD, System_arguments, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_EXIT_METHOD, System_exit, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_SETWORKINGFOLDER_METHOD, System_setworkingfolder, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_WORKINGFOLDER_METHOD, System_workingfolder, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(SYSTEM_HOMEFOLDER_METHOD, System_homefolder, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Int)", System_sleep, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Float)", System_sleep, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (...)", System_sleep__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_READLINE_METHOD, "String ()", System_readline, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_ARGUMENTS_METHOD, "List ()", System_arguments, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_EXIT_METHOD, "Nil ()", System_exit, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (String)", System_setworkingfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (...)", System_setworkingfolder__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_WORKINGFOLDER_METHOD, "String ()", System_workingfolder, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_HOMEFOLDER_METHOD, "String ()", System_homefolder, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** From 9ef92b595f63ef99c89b6e1972a8e0a2bc35dfbf Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 10:25:18 -0400 Subject: [PATCH 384/473] Harden Tuple signatures --- src/classes/tuple.c | 48 +++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/classes/tuple.c b/src/classes/tuple.c index b21bb6336..05d6ebc01 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -294,17 +294,15 @@ value Tuple_enumerate(vm *v, int nargs, value *args) { /** Joins two tuples together */ value Tuple_join(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); - value out = MORPHO_NIL; - - if (nargs==1 && MORPHO_ISTUPLE(MORPHO_GETARG(args, 0))) { - objecttuple *operand = MORPHO_GETTUPLE(MORPHO_GETARG(args, 0)); - objecttuple *new = tuple_concatenate(slf, operand); + objecttuple *operand = MORPHO_GETTUPLE(MORPHO_GETARG(args, 0)); + objecttuple *new = tuple_concatenate(slf, operand); - out = morpho_wrapandbind(v, (object *) new); - - } else morpho_runtimeerror(v, LIST_ADDARGS); + return morpho_wrapandbind(v, (object *) new); +} - return out; +value Tuple_join__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, LIST_ADDARGS); + return MORPHO_NIL; } /** Sort function for tuple_order */ @@ -387,15 +385,14 @@ value Tuple_reverse(vm *v, int nargs, value *args) { /** Rolls a tuple */ value Tuple_roll(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); + int roll; + morpho_valuetoint(MORPHO_GETARG(args, 0), &roll); - if (nargs==1 && MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - int roll; - morpho_valuetoint(MORPHO_GETARG(args, 0), &roll); - - objecttuple *new = tuple_roll(slf, roll); - return morpho_wrapandbind(v, (object *) new); - } + objecttuple *new = tuple_roll(slf, roll); + return morpho_wrapandbind(v, (object *) new); +} +value Tuple_roll__err(vm *v, int nargs, value *args) { morpho_runtimeerror(v, LIST_ADDARGS); return MORPHO_NIL; } @@ -403,11 +400,11 @@ value Tuple_roll(vm *v, int nargs, value *args) { /** Tests if a tuple has a value as a member */ value Tuple_ismember(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); + return MORPHO_BOOL(tuple_ismember(slf, MORPHO_GETARG(args, 0))); +} - if (nargs==1) { - return MORPHO_BOOL(tuple_ismember(slf, MORPHO_GETARG(args, 0))); - } else morpho_runtimeerror(v, ISMEMBER_ARG, 1, nargs); - +value Tuple_ismember__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, ISMEMBER_ARG, 1, nargs); return MORPHO_NIL; } @@ -419,14 +416,19 @@ MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, BUILTIN_FL MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (_)", Tuple_join, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (_)", Tuple_roll, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (Tuple)", Tuple_join, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Nil (...)", Tuple_join__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Int)", Tuple_roll, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Float)", Tuple_roll, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", Tuple_roll__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (Callable)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", Tuple_ismember__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Nil (...)", Tuple_ismember__err, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** From 4c1ee63b697485da1f3750cb58cffc0f33d91cab Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 10:39:33 -0400 Subject: [PATCH 385/473] Improve List signatures and eliminate checks within method implementations --- src/classes/list.c | 114 ++++++++++++++++++++++++++++++-------------- src/classes/tuple.c | 25 ++++++---- 2 files changed, 92 insertions(+), 47 deletions(-) diff --git a/src/classes/list.c b/src/classes/list.c index 47dfc9489..dd1fcc765 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -520,22 +520,24 @@ value List_tostring(vm *v, int nargs, value *args) { value List_enumerate(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (n<0) { - out=MORPHO_INTEGER(slf->val.count); - } else if (nval.count) { - return slf->val.data[n]; - } else { - morpho_runtimeerror(v, VM_OUTOFBOUNDS); - } - } else MORPHO_RAISE(v, ENUMERATE_ARGS); + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (n<0) { + out=MORPHO_INTEGER(slf->val.count); + } else if (nval.count) { + return slf->val.data[n]; + } else { + morpho_runtimeerror(v, VM_OUTOFBOUNDS); + } return out; } +value List_enumerate__err(vm *v, int nargs, value *args) { + MORPHO_RAISE(v, ENUMERATE_ARGS); + return MORPHO_NIL; +} + /** Get number of entries */ value List_count(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); @@ -545,6 +547,20 @@ value List_count(vm *v, int nargs, value *args) { /** Generate a list of n-tuples from a list */ value List_tuples(vm *v, int nargs, value *args) { + objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); + return list_generatetuples(v, slf, 2, MORPHO_TUPLEMODE); +} + +value List_tuples__int(vm *v, int nargs, value *args) { + objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); + unsigned int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (n<2) n=2; + + return list_generatetuples(v, slf, n, MORPHO_TUPLEMODE); +} + +value List_tuples__fallback(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); unsigned int n=2; @@ -558,6 +574,21 @@ value List_tuples(vm *v, int nargs, value *args) { /** Generate a list of n-tuples from a list */ value List_sets(vm *v, int nargs, value *args) { + objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); + return list_generatetuples(v, slf, 2, MORPHO_SETMODE); +} + +value List_sets__int(vm *v, int nargs, value *args) { + objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); + unsigned int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (n<2) n=2; + if (n>slf->val.capacity) n = slf->val.capacity; + + return list_generatetuples(v, slf, n, MORPHO_SETMODE); +} + +value List_sets__fallback(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); unsigned int n=2; @@ -600,24 +631,24 @@ value List_join__list(vm *v, int nargs, value *args) { value List_roll(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); value out = MORPHO_NIL; + int roll; + morpho_valuetoint(MORPHO_GETARG(args, 0), &roll); - if (nargs==1 && - MORPHO_ISNUMBER(MORPHO_GETARG(args, 0))) { - int roll; - morpho_valuetoint(MORPHO_GETARG(args, 0), &roll); - - objectlist *new = list_roll(slf, roll); - - if (new) { - out = MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } + objectlist *new = list_roll(slf, roll); - } else morpho_runtimeerror(v, LIST_ADDARGS); + if (new) { + out = MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } return out; } +value List_roll__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, LIST_ADDARGS); + return MORPHO_NIL; +} + /** Sorts a list */ value List_sort(vm *v, int nargs, value *args) { list_sort(MORPHO_GETLIST(MORPHO_SELF(args))); @@ -658,11 +689,11 @@ value List_reverse(vm *v, int nargs, value *args) { /** Tests if a list has a value as a member */ value List_ismember(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); + return MORPHO_BOOL(list_ismember(slf, MORPHO_GETARG(args, 0))); +} - if (nargs==1) { - return MORPHO_BOOL(list_ismember(slf, MORPHO_GETARG(args, 0))); - } else morpho_runtimeerror(v, ISMEMBER_ARG, 1, nargs); - +value List_ismember__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, ISMEMBER_ARG, 1, nargs); return MORPHO_NIL; } @@ -675,20 +706,29 @@ MORPHO_METHOD(MORPHO_GETINDEX_METHOD, List_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, List_setindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, List_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", List_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", List_enumerate__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", List_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_TUPLES_METHOD, List_tuples, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_SETS_METHOD, List_sets, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List ()", List_tuples, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (Int)", List_tuples__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (...)", List_tuples__fallback, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List ()", List_sets, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (Int)", List_sets__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (...)", List_sets__fallback, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, BUILTIN_FLAGSEMPTY), //MORPHO_METHOD(MORPHO_ADD_METHOD, List_add, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (List)", List_join__list, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ROLL_METHOD, List_roll, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "()", List_sort, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "(Callable)", List_sort_fn, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_ORDER_METHOD, List_order, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_REVERSE_METHOD, List_reverse, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Int)", List_roll, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Float)", List_roll, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", List_roll__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil ()", List_sort, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil (Callable)", List_sort_fn, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", List_order, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Nil ()", List_reverse, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", List_ismember__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Nil (...)", List_ismember__err, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/tuple.c b/src/classes/tuple.c index 05d6ebc01..ef429fde7 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -275,22 +275,26 @@ value Tuple_setindex(vm *v, int nargs, value *args) { value Tuple_enumerate(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); value out=MORPHO_NIL; + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (n<0) { - out=MORPHO_INTEGER(slf->length); + if (n<0) { + out=MORPHO_INTEGER(slf->length); + } else { + if (nlength) { + out=slf->tuple[n]; } else { - if (nlength) { - out=slf->tuple[n]; - } else morpho_runtimeerror(v, VM_OUTOFBOUNDS); + morpho_runtimeerror(v, VM_OUTOFBOUNDS); } - } else MORPHO_RAISE(v, ENUMERATE_ARGS); + } return out; } +value Tuple_enumerate__err(vm *v, int nargs, value *args) { + MORPHO_RAISE(v, ENUMERATE_ARGS); + return MORPHO_NIL; +} + /** Joins two tuples together */ value Tuple_join(vm *v, int nargs, value *args) { objecttuple *slf = MORPHO_GETTUPLE(MORPHO_SELF(args)); @@ -415,7 +419,8 @@ MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Tuple_tostring, BUI MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Tuple_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Tuple_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", Tuple_enumerate__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (Tuple)", Tuple_join, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Nil (...)", Tuple_join__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Int)", Tuple_roll, BUILTIN_FLAGSEMPTY), From 9d6152f9b3865ee80ccb44a0f3a9c8a636012f9c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 13:28:32 -0400 Subject: [PATCH 386/473] Harden the String class --- src/classes/strng.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/classes/strng.c b/src/classes/strng.c index 7119a9f08..46c4d7204 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -290,13 +290,13 @@ value String_split(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(String) -MORPHO_METHOD(MORPHO_COUNT_METHOD, String_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, String_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, String_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, String_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Int ()", String_isnumber, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (_)", String_split, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "String (Int)", String_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", String_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Bool ()", String_isnumber, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** From cab13dad4e8204283805ebceebba5842702940b8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 17:36:48 -0400 Subject: [PATCH 387/473] Assign objectmetafunctiontype with core classes. --- src/builtin/builtin.c | 5 ++++- src/classes/metafunction.c | 3 --- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 6607854f5..d2f1047e6 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -17,6 +17,8 @@ #include "sparse.h" #include "geometry.h" +extern objecttypedefn objectmetafunctiondefn; + /* ********************************************************************** * Global data * ********************************************************************** */ @@ -447,6 +449,7 @@ void builtin_initialize(void) { objectclasstype=object_addtype(&objectclassdefn); objectstringtype=object_addtype(&objectstringdefn); objectbuiltinfunctiontype=object_addtype(&objectbuiltinfunctiondefn); + objectmetafunctiontype=object_addtype(&objectmetafunctiondefn); varray__sigparseinit(&sigparseworklist); @@ -505,7 +508,7 @@ void builtin_initialize(void) { UNREACHABLE("Unable to finalize builtin metafunctions."); } error_clear(&err); - + morpho_addfinalizefn(builtin_finalize); } diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 530a185d1..649e1a7df 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1403,9 +1403,6 @@ MORPHO_ENDCLASS objecttype objectmetafunctiontype; void metafunction_initialize(void) { - // Create function object type - objectmetafunctiontype=object_addtype(&objectmetafunctiondefn); - // Locate the Callable class to use as the parent class of Metafunction value objclass = builtin_findclassfromcstring(CALLABLE_CLASSNAME); From 2b33c0a30a9db717eed22bc8aabeb284f197dd54 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 18:07:19 -0400 Subject: [PATCH 388/473] Simplify String_split --- src/classes/strng.c | 53 +++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/src/classes/strng.c b/src/classes/strng.c index 46c4d7204..38c4a5bd8 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -255,36 +255,33 @@ value String_isnumber(vm *v, int nargs, value *args) { value String_split(vm *v, int nargs, value *args) { objectstring *slf = MORPHO_GETSTRING(MORPHO_SELF(args)); value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - objectstring *split = MORPHO_GETSTRING(MORPHO_GETARG(args, 0)); - objectlist *new = object_newlist(0, NULL); - - if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } - - char *last = slf->string; - for (char *c = slf->string; *c!='\0'; c+=morpho_utf8numberofbytes(c)) { // Loop over string - for (char *s = split->string; *s!='\0';) { // Loop over split chars - int nbytes = morpho_utf8numberofbytes(s); - if (strncmp(c, s, nbytes)==0) { - value newstring = object_stringfromcstring(last, c-last); - if (MORPHO_ISNIL(newstring)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - list_append(new, newstring); - last=c+nbytes; - } - s+=nbytes; + objectstring *split = MORPHO_GETSTRING(MORPHO_GETARG(args, 0)); + objectlist *new = object_newlist(0, NULL); + + if (!new) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return MORPHO_NIL; } + + char *last = slf->string; + for (char *c = slf->string; *c!='\0'; c+=morpho_utf8numberofbytes(c)) { // Loop over string + for (char *s = split->string; *s!='\0';) { // Loop over split chars + int nbytes = morpho_utf8numberofbytes(s); + if (strncmp(c, s, nbytes)==0) { + value newstring = object_stringfromcstring(last, c-last); + if (MORPHO_ISNIL(newstring)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + list_append(new, newstring); + last=c+nbytes; } + s+=nbytes; } + } - value newstring = object_stringfromcstring(last, slf->string+slf->length-last); - if (MORPHO_ISNIL(newstring)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); - list_append(new, newstring); + value newstring = object_stringfromcstring(last, slf->string+slf->length-last); + if (MORPHO_ISNIL(newstring)) morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + list_append(new, newstring); - out=MORPHO_OBJECT(new); - list_append(new, out); - morpho_bindobjects(v, new->val.count, new->val.data); - new->val.count-=1; - } + out=MORPHO_OBJECT(new); + list_append(new, out); + morpho_bindobjects(v, new->val.count, new->val.data); + new->val.count-=1; return out; } @@ -293,8 +290,8 @@ MORPHO_BEGINCLASS(String) MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "String (Int)", String_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", String_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "(Int)", String_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", String_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Bool ()", String_isnumber, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS From b2d8530555c7793433bbbc86f7e4eabf69481d28 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 18:54:19 -0400 Subject: [PATCH 389/473] Harden Range --- src/classes/range.c | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/classes/range.c b/src/classes/range.c index 3ee5a72a0..45ce2296f 100644 --- a/src/classes/range.c +++ b/src/classes/range.c @@ -159,30 +159,28 @@ value range_invldconstructor(vm *v, int nargs, value *args) { /** Gets a specified element from a range */ value Range_getindex(vm *v, int nargs, value *args) { objectrange *slf = MORPHO_GETRANGE(MORPHO_SELF(args)); - - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (nnsteps) return range_iterate(slf, n); - else morpho_runtimeerror(v, VM_OUTOFBOUNDS); + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (n<0 || n>=slf->nsteps) { + morpho_runtimeerror(v, VM_OUTOFBOUNDS); + return MORPHO_NIL; } - - return MORPHO_SELF(args); + + return range_iterate(slf, n); } /** Enumerate members of a range */ value Range_enumerate(vm *v, int nargs, value *args) { objectrange *slf = MORPHO_GETRANGE(MORPHO_SELF(args)); - value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (n<0) return MORPHO_INTEGER(slf->nsteps); - else return range_iterate(slf, n); - } else MORPHO_RAISE(v, ENUMERATE_ARGS); - - return out; + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (n<0) return MORPHO_INTEGER(slf->nsteps); + if (n>=slf->nsteps) { + morpho_runtimeerror(v, VM_OUTOFBOUNDS); + return MORPHO_NIL; + } + + return range_iterate(slf, n); } /** Count number of items in a range */ @@ -208,9 +206,9 @@ value Range_clone(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Range) -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Range_getindex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", Range_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Range_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Range_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Range_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Range ()", Range_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS From 715ba0ad525759daffd867d7bacea5d694dded18 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 19:20:19 -0400 Subject: [PATCH 390/473] More hardening of types --- src/classes/dict.c | 15 +++++---------- src/classes/flt.c | 35 ++++++++++++++++++----------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/src/classes/dict.c b/src/classes/dict.c index 900f2691b..bcbbd2cc8 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -125,9 +125,7 @@ value Dictionary_contains(vm *v, int nargs, value *args) { objectdictionary *slf = MORPHO_GETDICTIONARY(MORPHO_SELF(args)); value out=MORPHO_FALSE; - if (nargs==1) { - if (dictionary_get(&slf->dict, MORPHO_GETARG(args, 0), &out)) out=MORPHO_TRUE; - } + if (dictionary_get(&slf->dict, MORPHO_GETARG(args, 0), &out)) out=MORPHO_TRUE; return out; } @@ -186,13 +184,10 @@ value Dictionary_count(vm *v, int nargs, value *args) { value Dictionary_enumerate(vm *v, int nargs, value *args) { objectdictionary *slf = MORPHO_GETDICTIONARY(MORPHO_SELF(args)); value out=MORPHO_NIL; + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (n<0) out=MORPHO_INTEGER(slf->dict.count); - else out=dictionary_iterate(slf, n); - } else MORPHO_RAISE(v, ENUMERATE_ARGS); + if (n<0) out=MORPHO_INTEGER(slf->dict.count); + else out=dictionary_iterate(slf, n); return out; } @@ -260,7 +255,7 @@ MORPHO_METHOD(DICTIONARY_REMOVE_METHOD, Dictionary_remove, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Dictionary_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Dictionary_enumerate, BUILTIN_FLAGSEMPTY), + MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Dictionary_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (_)", Dictionary_union, BUILTIN_FLAGSEMPTY), diff --git a/src/classes/flt.c b/src/classes/flt.c index 112c6c918..8b827280d 100644 --- a/src/classes/flt.c +++ b/src/classes/flt.c @@ -10,28 +10,28 @@ value Value_format(vm *v, int nargs, value *args) { value out = MORPHO_NIL; + varray_char str; - if (nargs==1 && - MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - varray_char str; - varray_charinit(&str); - - if (format_printtobuffer(MORPHO_SELF(args), - MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), - &str)) { - - out = object_stringfromvarraychar(&str); - if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, VALUE_INVLDFRMT); + varray_charinit(&str); + + if (format_printtobuffer(MORPHO_SELF(args), + MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)), + &str)) { - varray_charclear(&str); - } else { - morpho_runtimeerror(v, VALUE_FRMTARG); - } + out = object_stringfromvarraychar(&str); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, VALUE_INVLDFRMT); + + varray_charclear(&str); return out; } +value Value_format__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, VALUE_FRMTARG); + return MORPHO_NIL; +} + /* ********************************************************************** * Float veneer class * ********************************************************************** */ @@ -41,7 +41,8 @@ MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (_)", Value_format, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (String)", Value_format, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "Nil (...)", Value_format__err, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** From 6cb8a83f89c41d76a585d5d99cfe3cc7fefaa7f3 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 20:43:34 -0400 Subject: [PATCH 391/473] Expand List_getindex --- src/classes/list.c | 69 ++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 27 deletions(-) diff --git a/src/classes/list.c b/src/classes/list.c index dd1fcc765..dd6c1ae72 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -435,46 +435,58 @@ value List_pop(vm *v, int nargs, value *args) { return out; } -/** Get an element */ -value List_getindex(vm *v, int nargs, value *args) { +/** Get an element by integer index */ +value List_getindex__int(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); value out=MORPHO_NIL; + int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (nargs==1) { - if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + if (!list_getelement(slf, i, &out)) { + morpho_runtimeerror(v, VM_OUTOFBOUNDS); + } - if (!list_getelement(slf, i, &out)) { - morpho_runtimeerror(v, VM_OUTOFBOUNDS); - } - } else { - objectarrayerror err = getslice(&MORPHO_SELF(args),&list_slicedim,&list_sliceconstructor,&list_slicecopy,nargs,&MORPHO_GETARG(args, 0),&out); - if (err!=ARRAY_OK) MORPHO_RAISE(v, array_to_list_error(err) ); - if (MORPHO_ISOBJECT(out)){ - morpho_bindobjects(v,1,&out); - } else MORPHO_RAISE(v, VM_NONNUMINDX); + return out; +} - } - } else MORPHO_RAISE(v, LIST_NUMARGS) +/** Get a slice-like selection */ +value List_getindex__slice(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + objectarrayerror err = getslice(&MORPHO_SELF(args), &list_slicedim, &list_sliceconstructor, &list_slicecopy, nargs, &MORPHO_GETARG(args, 0), &out); + if (err!=ARRAY_OK) MORPHO_RAISE(v, array_to_list_error(err) ); + if (MORPHO_ISOBJECT(out)) { + morpho_bindobjects(v,1,&out); + } else MORPHO_RAISE(v, VM_NONNUMINDX); return out; } -/** Sets an element */ -value List_setindex(vm *v, int nargs, value *args) { +value List_getindex__err(vm *v, int nargs, value *args) { + MORPHO_RAISE(v, LIST_NUMARGS); + return MORPHO_NIL; +} + +value List_getindex(vm *v, int nargs, value *args) { + if (nargs!=1) return List_getindex__err(v, nargs, args); + if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) return List_getindex__int(v, nargs, args); + return List_getindex__slice(v, nargs, args); +} + +/** Sets an element by integer index */ +value List_setindex__int(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); + int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (nargs==2) { - if (MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - if (ival.count) slf->val.data[i]=MORPHO_GETARG(args, 1); - else morpho_runtimeerror(v, VM_OUTOFBOUNDS); - } else morpho_runtimeerror(v, SETINDEX_ARGS); - } else morpho_runtimeerror(v, SETINDEX_ARGS); + if (ival.count) slf->val.data[i]=MORPHO_GETARG(args, 1); + else morpho_runtimeerror(v, VM_OUTOFBOUNDS); return MORPHO_SELF(args); } +value List_setindex__err(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, SETINDEX_ARGS); + return MORPHO_NIL; +} + /** Print a list */ value List_print(vm *v, int nargs, value *args) { value self = MORPHO_SELF(args); @@ -702,8 +714,11 @@ MORPHO_METHOD(MORPHO_APPEND_METHOD, List_append, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_REMOVE_METHOD, List_remove, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_INSERT_METHOD, List_insert, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(LIST_POP_METHOD, List_pop, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, List_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, List_setindex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", List_getindex__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "List (_)", List_getindex__slice, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", List_getindex__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", List_setindex__int, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "Nil (...)", List_setindex__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", List_enumerate, BUILTIN_FLAGSEMPTY), From 6cc73b585f590a65827f508bd374cff3961a12ac Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 20:48:50 -0400 Subject: [PATCH 392/473] Dictionary set operation signatures --- src/classes/dict.c | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/src/classes/dict.c b/src/classes/dict.c index bcbbd2cc8..37319b6ec 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -228,17 +228,14 @@ value Dictionary_clone(vm *v, int nargs, value *args) { value Dictionary_##op(vm *v, int nargs, value *args) { \ objectdictionary *slf = MORPHO_GETDICTIONARY(MORPHO_SELF(args)); \ value out=MORPHO_NIL; \ + objectdictionary *new = object_newdictionary(); \ + objectdictionary *b = MORPHO_GETDICTIONARY(MORPHO_GETARG(args, 0)); \ \ - if (nargs>0 && MORPHO_ISDICTIONARY(MORPHO_GETARG(args, 0))) { \ - objectdictionary *new = object_newdictionary(); \ - \ - if (new) { \ - objectdictionary *b =MORPHO_GETDICTIONARY(MORPHO_GETARG(args, 0)); \ - dictionary_##op(&slf->dict, &b->dict, &new->dict); \ - out=MORPHO_OBJECT(new); \ - morpho_bindobjects(v, 1, &out); \ - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); \ - } else morpho_runtimeerror(v, DICT_DCTSTARG); \ + if (new) { \ + dictionary_##op(&slf->dict, &b->dict, &new->dict); \ + out=MORPHO_OBJECT(new); \ + morpho_bindobjects(v, 1, &out); \ + } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); \ \ return out; \ } @@ -247,6 +244,16 @@ DICTIONARY_SETOP(union) DICTIONARY_SETOP(intersection) DICTIONARY_SETOP(difference) +#define DICTIONARY_SETOP_ERR(op) \ +value Dictionary_##op##__err(vm *v, int nargs, value *args) { \ + morpho_runtimeerror(v, DICT_DCTSTARG); \ + return MORPHO_NIL; \ +} + +DICTIONARY_SETOP_ERR(union) +DICTIONARY_SETOP_ERR(intersection) +DICTIONARY_SETOP_ERR(difference) + MORPHO_BEGINCLASS(Dictionary) MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Dictionary_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Dictionary_setindex, BUILTIN_FLAGSEMPTY), @@ -255,14 +262,19 @@ MORPHO_METHOD(DICTIONARY_REMOVE_METHOD, Dictionary_remove, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Dictionary_count, BUILTIN_FLAGSEMPTY), - MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Dictionary_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Dictionary_enumerate, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (_)", Dictionary_union, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (_)", Dictionary_intersection, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (_)", Dictionary_difference, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (_)", Dictionary_union, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (_)", Dictionary_difference, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (Dictionary)", Dictionary_union, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Nil (...)", Dictionary_union__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (Dictionary)", Dictionary_intersection, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Nil (...)", Dictionary_intersection__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (Dictionary)", Dictionary_difference, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Nil (...)", Dictionary_difference__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (Dictionary)", Dictionary_union, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Nil (...)", Dictionary_union__err, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (Dictionary)", Dictionary_difference, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Nil (...)", Dictionary_difference__err, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS From 1b8eb3b7c1de5ad8105543f03fdda2bd53efdb5d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 21:30:21 -0400 Subject: [PATCH 393/473] Fix String_enumerate --- src/classes/strng.c | 32 ++++++++++++++++++-------------- src/linalg/complexmatrix.c | 3 ++- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/classes/strng.c b/src/classes/strng.c index 38c4a5bd8..ace1b7e8a 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -223,24 +223,26 @@ value String_clone(vm *v, int nargs, value *args) { value String_enumerate(vm *v, int nargs, value *args) { objectstring *slf = MORPHO_GETSTRING(MORPHO_SELF(args)); value out=MORPHO_NIL; - - if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { - int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); - - if (n<0) { - out=MORPHO_INTEGER(string_countchars(slf)); - } else { - char *c=string_index(slf, n); - if (c) { - out=object_stringfromcstring(c, morpho_utf8numberofbytes(c)); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, VM_OUTOFBOUNDS); - } - } else MORPHO_RAISE(v, ENUMERATE_ARGS); + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + if (n<0) { + out=MORPHO_INTEGER(string_countchars(slf)); + } else { + char *c=string_index(slf, n); + if (c) { + out=object_stringfromcstring(c, morpho_utf8numberofbytes(c)); + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, VM_OUTOFBOUNDS); + } return out; } +value String_enumerate__err(vm *v, int nargs, value *args) { + MORPHO_RAISE(v, ENUMERATE_ARGS); + return MORPHO_NIL; +} + /** Tests if a string encodes a number */ value String_isnumber(vm *v, int nargs, value *args) { objectstring *slf = MORPHO_GETSTRING(MORPHO_SELF(args)); @@ -291,7 +293,9 @@ MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, BUILTIN_FLA MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "(Int)", String_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", String_enumerate__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", String_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", String_enumerate__err, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Bool ()", String_isnumber, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index 333db897e..f6e41f919 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -616,7 +616,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (List)", Matrix_i MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Tuple)", Matrix_index__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index__int_int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index__x_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), @@ -657,6 +657,7 @@ MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Matrix ()", ComplexMatrix_real, BU MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Matrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (ComplexMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (Matrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), From 1d749f2497c76ef9ca3d71c740c50d5359298674 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 21:39:49 -0400 Subject: [PATCH 394/473] Correct Matrix return type --- src/linalg/matrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index f25b3af22..43f502fea 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1658,7 +1658,7 @@ void matrix_initialize(void) { morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Tuple)", matrix_constructor__list, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Array)", matrix_constructor__array, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_CLASSNAME, "Matrix (Sparse)", matrix_constructor__sparse, MORPHO_FN_CONSTRUCTOR, NULL); - morpho_addfunction(MATRIX_CLASSNAME, "(...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); + morpho_addfunction(MATRIX_CLASSNAME, "Matrix (...)", matrix_constructor__err, MORPHO_FN_CONSTRUCTOR, NULL); morpho_addfunction(MATRIX_IDENTITYCONSTRUCTOR, "Matrix (Int)", matrix_identityconstructor, MORPHO_FN_CONSTRUCTOR, NULL); From a4e3260981aad72ac9857bc8f5a4b0b54cf97f46 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 22:02:10 -0400 Subject: [PATCH 395/473] Fix bug in metafunction_add --- src/classes/metafunction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 649e1a7df..4147e0da3 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -101,7 +101,7 @@ bool metafunction_add(objectmetafunction *f, value fn) { metafunction_clearinstructions(f); f->state=METAFUNCTION_BUILDING; } - return varray_valuewrite(&f->fns, fn); + return varray_valueadd(&f->fns, &fn, 1); } /** Checks if val matches a given type */ From eeb379c46dbf106a893eeb8bdb37e5f18e1222b8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 22:17:18 -0400 Subject: [PATCH 396/473] Improve metafunction_reduce --- src/classes/metafunction.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 4147e0da3..48b73fe8c 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1303,10 +1303,11 @@ bool metafunction_reduce(objectmetafunction *fn, int nargs, value *args, error * mfresolutionset set; mfresolution res[nres]; objectmetafunction *reduced = NULL; - + mfresolutionset_init(&set, res, fn); mfresolutionset_filterbyarity(&set, nargs); mfresolutionset_filterbyknowntypes(&set, nargs, args); + mfresolutionset_filterbyspecificity(&set, nargs, args); if (set.count<=0) { // No resolutions left error_writewithid(err, VM_MLTPLDSPTCHFLD); return false; From e906f0963325def8d926d3a1f5cb99d45b6945cc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 3 May 2026 22:38:42 -0400 Subject: [PATCH 397/473] Fix bug in comparespecificity --- src/classes/metafunction.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 48b73fe8c..75b492a00 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -281,8 +281,8 @@ static int mfresolution_comparespecificity(mfresolution *a, mfresolution *b, int int cmp[ncheck]; for (int i=0; isig->types.data[i], b->sig->types.data[i], &cmp[i]); } } @@ -1114,6 +1114,8 @@ static bool mfcompiler_emitarityresolver(mfcompiler *compiler, int nresolutions, /** Emit a resolver block for a filtered candidate set. */ static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfcompileresolution *resolutions, mfcompilerpath *path, mfindx *entry) { + mfcompilerpath exactpath; + /* No candidates remain on this path. */ if (nresolutions<=0) return mfcompiler_emitfail(compiler, entry); @@ -1123,6 +1125,15 @@ static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfco } bool hastyped = mfcompiler_hastypedresolutions(nresolutions, resolutions); + if (!path->aritychecked && + !mfcompiler_hasvargresolutions(nresolutions, resolutions) && + mfcompiler_countarities(nresolutions, resolutions)==1) { + exactpath = *path; + exactpath.knownarity = resolutions[0].nparams; + exactpath.aritychecked = true; + path = &exactpath; + } + /* For exact arity without typed params, emit the lone fixed-arity winner. */ if (!hastyped && path->knownarity>=0) { if (mfcompiler_emitfixedaritywinner(compiler, nresolutions, resolutions, path->nparams, path->known, entry)) return true; From a8c9c3616b5ee516a813cd68459efffde226c94a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 4 May 2026 08:06:47 -0400 Subject: [PATCH 398/473] Fix type inference in compile.c --- src/core/compile.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/compile.c b/src/core/compile.c index 813526f6a..7e43f352d 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -2363,7 +2363,8 @@ bool compiler_arithmetictype(compiler *c, opcode op, registerindx left, register if (compiler_regcurrenttype(c, left, <ype) && compiler_regcurrenttype(c, right, &rtype)) { - if (MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_inttype) && op!=OP_POW) { + if (MORPHO_ISEQUAL(ltype,_inttype) && MORPHO_ISEQUAL(rtype,_inttype) && + op!=OP_POW && op!=OP_DIV) { *type=_inttype; success=true; } else if (_isreal(ltype) && _isreal(rtype)) { From 8007a8de96b06f9c0c2370948d50f3a5439bc632 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 4 May 2026 08:17:15 -0400 Subject: [PATCH 399/473] fix comparespecificity --- src/classes/metafunction.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 75b492a00..0dd7c3e9b 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -271,11 +271,16 @@ static int _sign(int x) { return (x>0) - (x<0); } +/** Check whether known argument types fully determine a signature. */ +static bool mfresolution_isterminal(signature *sig, int nargs, value *args); + /** Compare the specificity of two resolutions. * Returns <0 if a is more specific, >0 if b is more specific, 0 if they are equal * or incomparable. */ static int mfresolution_comparespecificity(mfresolution *a, mfresolution *b, int nargs, value *args) { if (!a->sig || !b->sig) return 0; + if (!mfresolution_isterminal(a->sig, nargs, args) || + !mfresolution_isterminal(b->sig, nargs, args)) return 0; int ncheck=_min(signature_countparams(a->sig), signature_countparams(b->sig), nargs); int cmp[ncheck]; From 63b521c1770e7a2389a287547eced22d39001bc0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 4 May 2026 08:22:49 -0400 Subject: [PATCH 400/473] Reduce only for exact types --- src/core/compile.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/compile.c b/src/core/compile.c index 7e43f352d..7d17a3383 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -300,6 +300,11 @@ void compiler_getmethodreturntype(compiler *c, value klass, value target, value } } +/** Returns true if a class is exact for compile-time dispatch specialization. */ +static bool compiler_typeisexact(value type) { + return (MORPHO_ISCLASS(type) && MORPHO_GETCLASS(type)->children.count==0); +} + /* ------------------------------------------ * Types * ------------------------------------------- */ @@ -3719,7 +3724,7 @@ static bool compiler_specializemetafunctioncall(compiler *c, syntaxtreenode *nod value argtypes[nargs]; for (int i=0; idest+i+1, &type) && MORPHO_ISCLASS(type)) ? type : MORPHO_NIL; + argtypes[i] = (compiler_regcurrenttype(c, func->dest+i+1, &type) && compiler_typeisexact(type)) ? type : MORPHO_NIL; } value reduced = MORPHO_NIL; From 0114c5247d74b68aaa293c871ea3a04587539637 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 5 May 2026 22:31:53 -0400 Subject: [PATCH 401/473] Additional tests and fix varray --- src/builtin/builtin.h | 2 +- src/datastructures/varray.h | 3 ++- test/block/empty_block_reachability.morpho | 21 ++++++++++++++++ .../empty_block_reachability_include.morpho | 24 +++++++++++++++++++ test/function/optimizable_entry.morpho | 16 +++++++++++++ 5 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 test/block/empty_block_reachability.morpho create mode 100644 test/block/empty_block_reachability_include.morpho create mode 100644 test/function/optimizable_entry.morpho diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index 5ed14e7eb..9f7f4ad5e 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -31,7 +31,7 @@ typedef unsigned int builtinfunctionflags; #define MORPHO_FN_FLAGSEMPTY (0) #define MORPHO_FN_PUREFN (1<<1) // Pure function: no side effects #define MORPHO_FN_CONSTRUCTOR (1<<2) // Constructor function -#define MORPHO_FN_REENTRANT (1<<3) // Function that re-enters the vm, e.g. but using morph_call +#define MORPHO_FN_REENTRANT (1<<3) // Function that re-enters the vm, e.g. by using morpho_call #define MORPHO_FN_OPTARGS (1<<4) // Function that has optional arguments /** Type of C function that implements a built in Morpho function */ diff --git a/src/datastructures/varray.h b/src/datastructures/varray.h index dbf836db6..615a5b423 100644 --- a/src/datastructures/varray.h +++ b/src/datastructures/varray.h @@ -44,7 +44,8 @@ bool varray_##name##add(varray_##name *v, type *data, int count); \ bool varray_##name##resize(varray_##name *v, int count); \ int varray_##name##write(varray_##name *v, type data); \ - void varray_##name##clear(varray_##name *v); + void varray_##name##clear(varray_##name *v); \ + bool varray_##name##pop(varray_##name *v, type *dest) #define DEFINE_VARRAY(name, type) \ void varray_##name##init(varray_##name *v) { \ diff --git a/test/block/empty_block_reachability.morpho b/test/block/empty_block_reachability.morpho new file mode 100644 index 000000000..9af4cab80 --- /dev/null +++ b/test/block/empty_block_reachability.morpho @@ -0,0 +1,21 @@ +import bytecodeoptimizer + +var refine_adaptively = false +var refine_iters = 1 +var visualize_refinement = false + +print "Refine adaptively: ${refine_adaptively}" + +if (refine_adaptively){ + print "Refine adaptively: ${refine_adaptively}" + + for (i in 1..refine_iters) { + System.exit() + + if (visualize_refinement){ + + } + } +} + +// expect: Refine adaptively: false diff --git a/test/block/empty_block_reachability_include.morpho b/test/block/empty_block_reachability_include.morpho new file mode 100644 index 000000000..3fe2e3929 --- /dev/null +++ b/test/block/empty_block_reachability_include.morpho @@ -0,0 +1,24 @@ + +import bytecodeoptimizer + +import meshtools + +var refine_adaptively = false // Flag to turn mesh-refinement on/off +var refine_iters = 1 // Number of iterations of refimenent +var visualize_refinement = false // Flag to turn plotting the refinement regions and refined meshes on/off + +print "Refine adaptively: ${refine_adaptively}" + +if (refine_adaptively){ + for (i in 1..refine_iters) { + + print "Refining" + System.exit() + + if (visualize_refinement){ + + } + } +} + +// expect: Refine adaptively: false diff --git a/test/function/optimizable_entry.morpho b/test/function/optimizable_entry.morpho new file mode 100644 index 000000000..e59b51cb4 --- /dev/null +++ b/test/function/optimizable_entry.morpho @@ -0,0 +1,16 @@ +fn f(x) { + if (true) { + // entry block becomes empty after folding + } else { + return 99 + } + + var i = 0 + while (i < 3) { + i = i + 1 + } + + return i +} + +print f(0) // expect: 3 \ No newline at end of file From 87e8a4e4e95760cb15e66e70ec4059087457a9ee Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 6 May 2026 12:46:52 -0400 Subject: [PATCH 402/473] Fix incorrect signatures for some math functions --- src/builtin/functiondefs.c | 20 +++++++++----------- src/builtin/functiondefs.h | 1 + src/datastructures/signature.c | 1 + src/datastructures/varray.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 3054b99c0..1f70179af 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -601,17 +601,15 @@ value builtin_iscallablefunction_err(vm *v, int nargs, value *args) { #define BUILTIN_MATH_OLD2(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); -#define BUILTIN_VARMATH(label, function) \ - morpho_addfunction(label, "Float (Int)", builtin_int_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(label, "Float (Float)", builtin_float_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(label, "Complex (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ +#define BUILTIN_VARMATH_RET(label, function, realret, cmplxret) \ + morpho_addfunction(label, realret " (Int)", builtin_int_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(label, realret " (Float)", builtin_float_##function, MORPHO_FN_PUREFN, NULL); \ + morpho_addfunction(label, cmplxret " (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ morpho_addfunction(label, "(...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); -#define BUILTIN_MATH_BOOL(function) \ - morpho_addfunction(#function, "Bool (Int)", builtin_int_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(#function, "Bool (Float)", builtin_float_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(#function, "Bool (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(#function, "(...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); +#define BUILTIN_VARMATH(label, function) BUILTIN_VARMATH_RET(label, function, "Float", "Complex") + +#define BUILTIN_MATH_BOOL(function) BUILTIN_VARMATH_RET(#function, function, "Bool", "Bool") #define BUILTIN_MATH(function) BUILTIN_VARMATH(#function, function) @@ -656,9 +654,9 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_BOOL, "Bool (_,_,...)", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); // Math functions - BUILTIN_VARMATH(FUNCTION_ABS, fabs) + BUILTIN_VARMATH_RET(FUNCTION_ABS, fabs, "Float", "Float") - BUILTIN_MATH(exp) + BUILTIN_VARMATH_RET(FUNCTION_EXP, exp, "Float", "Complex") BUILTIN_MATH(log) BUILTIN_MATH(log10) diff --git a/src/builtin/functiondefs.h b/src/builtin/functiondefs.h index 5946b8ae9..097f075a8 100644 --- a/src/builtin/functiondefs.h +++ b/src/builtin/functiondefs.h @@ -28,6 +28,7 @@ #define FUNCTION_MOD "mod" #define FUNCTION_ABS "abs" +#define FUNCTION_EXP "exp" #define FUNCTION_SIGN "sign" #define FUNCTION_ARCTAN "arctan" diff --git a/src/datastructures/signature.c b/src/datastructures/signature.c index ca12b0201..74e35e397 100644 --- a/src/datastructures/signature.c +++ b/src/datastructures/signature.c @@ -200,6 +200,7 @@ bool signature_parse(const char *sig, signature *out) { /** Print a signature for debugging purposes */ void signature_print(signature *s) { + if (MORPHO_ISCLASS(s->ret)) { morpho_printvalue(NULL, MORPHO_GETCLASS(s->ret)->name); printf(" "); } printf("("); for (int i=0; itypes.count; i++) { value type=s->types.data[i]; diff --git a/src/datastructures/varray.h b/src/datastructures/varray.h index 615a5b423..d983b1263 100644 --- a/src/datastructures/varray.h +++ b/src/datastructures/varray.h @@ -45,7 +45,7 @@ bool varray_##name##resize(varray_##name *v, int count); \ int varray_##name##write(varray_##name *v, type data); \ void varray_##name##clear(varray_##name *v); \ - bool varray_##name##pop(varray_##name *v, type *dest) + bool varray_##name##pop(varray_##name *v, type *dest); #define DEFINE_VARRAY(name, type) \ void varray_##name##init(varray_##name *v) { \ From 42cd69f08e144a50603037a52981a2ec7cea8095 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 7 May 2026 12:38:49 -0400 Subject: [PATCH 403/473] Function annotation cleanup --- src/builtin/builtin.h | 14 +- src/builtin/functiondefs.c | 142 +++++++++--------- src/classes/array.c | 10 +- src/classes/bool.c | 2 +- src/classes/cfunction.c | 4 +- src/classes/closure.c | 4 +- src/classes/clss.c | 2 +- src/classes/cmplx.c | 14 +- src/classes/dict.c | 40 ++--- src/classes/err.c | 2 +- src/classes/file.c | 18 +-- src/classes/flt.c | 2 +- src/classes/function.c | 4 +- src/classes/instance.c | 26 ++-- src/classes/int.c | 2 +- src/classes/invocation.c | 6 +- src/classes/json.c | 8 +- src/classes/list.c | 52 +++---- src/classes/range.c | 10 +- src/classes/strng.c | 18 +-- src/classes/system.c | 26 ++-- src/classes/tuple.c | 42 +++--- src/linalg/complexmatrix.c | 112 +++++++------- src/linalg/matrix.c | 88 +++++------ .../super_init_with_internal_behavior.morpho | 31 ++++ 25 files changed, 359 insertions(+), 320 deletions(-) create mode 100644 test/super/super_init_with_internal_behavior.morpho diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index 9f7f4ad5e..bf8bcaefb 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -26,13 +26,19 @@ bool builtin_parsesignatures(void); /** Flags that describe properties of the built in function */ typedef unsigned int builtinfunctionflags; -#define BUILTIN_FLAGSEMPTY 0 +#define MORPHO_FN_NONE (0) // Function has been reviewed and has no special semantic annotations +#define MORPHO_FN_FLAGSEMPTY (1<<0) // Unknown or legacy-unreviewed flags: optimizer should assume any annotation may apply -#define MORPHO_FN_FLAGSEMPTY (0) -#define MORPHO_FN_PUREFN (1<<1) // Pure function: no side effects +#define BUILTIN_FLAGSEMPTY MORPHO_FN_FLAGSEMPTY + +#define MORPHO_FN_PUREFN (1<<1) // Pure on normal return: deterministic for constant inputs, no mutation, I/O or re-entry #define MORPHO_FN_CONSTRUCTOR (1<<2) // Constructor function #define MORPHO_FN_REENTRANT (1<<3) // Function that re-enters the vm, e.g. by using morpho_call -#define MORPHO_FN_OPTARGS (1<<4) // Function that has optional arguments +#define MORPHO_FN_OPTARGS (1<<4) // Function reads VM optional/named arguments +#define MORPHO_FN_THROWS (1<<5) // Function may raise a runtime error +#define MORPHO_FN_ALLOCATES (1<<6) // Function may allocate and return/bind new objects +#define MORPHO_FN_MUTATES (1<<7) // Function may mutate receiver, arguments, or runtime-visible state +#define MORPHO_FN_IO (1<<8) // Function performs externally observable I/O or system interaction /** Type of C function that implements a built in Morpho function */ typedef value (*builtinfunction) (vm *v, int nargs, value *args); diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index 1f70179af..cc814c27c 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -601,62 +601,64 @@ value builtin_iscallablefunction_err(vm *v, int nargs, value *args) { #define BUILTIN_MATH_OLD2(function) \ builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); -#define BUILTIN_VARMATH_RET(label, function, realret, cmplxret) \ - morpho_addfunction(label, realret " (Int)", builtin_int_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(label, realret " (Float)", builtin_float_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(label, cmplxret " (Complex)", builtin_cmplx_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(label, "(...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); +#define BUILTIN_VARMATH_RET(label, function, realret, realflags, cmplxret, cmplxflags) \ + morpho_addfunction(label, realret " (Int)", builtin_int_##function, realflags, NULL); \ + morpho_addfunction(label, realret " (Float)", builtin_float_##function, realflags, NULL); \ + morpho_addfunction(label, cmplxret " (Complex)", builtin_cmplx_##function, cmplxflags, NULL); \ + morpho_addfunction(label, "(...)", builtin_numargserr_##function, MORPHO_FN_THROWS, NULL); -#define BUILTIN_VARMATH(label, function) BUILTIN_VARMATH_RET(label, function, "Float", "Complex") +#define BUILTIN_VARMATH(label, function) \ + BUILTIN_VARMATH_RET(label, function, "Float", MORPHO_FN_PUREFN, "Complex", MORPHO_FN_ALLOCATES) -#define BUILTIN_MATH_BOOL(function) BUILTIN_VARMATH_RET(#function, function, "Bool", "Bool") +#define BUILTIN_MATH_BOOL(function) \ + BUILTIN_VARMATH_RET(#function, function, "Bool", MORPHO_FN_PUREFN, "Bool", MORPHO_FN_PUREFN) #define BUILTIN_MATH(function) BUILTIN_VARMATH(#function, function) #define BUILTIN_TYPECHECK(function) \ morpho_addfunction(#function, "Bool (_)", builtin_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(#function, "Bool ()", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); \ - morpho_addfunction(#function, "Bool (_,_,...)", builtin_numargserr_##function, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(#function, "Bool ()", builtin_numargserr_##function, MORPHO_FN_THROWS, NULL); \ + morpho_addfunction(#function, "Bool (_,_,...)", builtin_numargserr_##function, MORPHO_FN_THROWS, NULL); void functiondefs_initialize(void) { // System - builtin_addfunction(FUNCTION_SYSTEM, builtin_system, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FUNCTION_SYSTEM, builtin_system, MORPHO_FN_IO); // Clock - morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, MORPHO_FN_IO, NULL); // Apply - morpho_addfunction(FUNCTION_APPLY, "(Callable,Tuple)", builtin_apply__tuple, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_APPLY, "(Callable,List)", builtin_apply__list, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_APPLY, "(Callable,_,...)", builtin_apply, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_APPLY, "()", builtin_apply__err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_APPLY, "(_)", builtin_apply__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_APPLY, "(Callable,Tuple)", builtin_apply__tuple, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_APPLY, "(Callable,List)", builtin_apply__list, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_APPLY, "(Callable,_,...)", builtin_apply, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_APPLY, "()", builtin_apply__err, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_APPLY, "(_)", builtin_apply__err, MORPHO_FN_THROWS, NULL); // Random numbers morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, BUILTIN_FLAGSEMPTY, NULL); morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint_norange, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_RANDOMINT, "Int (_)", builtin_randomint, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_RANDOMINT, "Int (_)", builtin_randomint, MORPHO_FN_THROWS, NULL); morpho_addfunction(FUNCTION_RANDOMNORMAL, "Float ()", builtin_randomnormal, BUILTIN_FLAGSEMPTY, NULL); // Value constructors - morpho_addfunction(FUNCTION_INT, "Int (Int)", builtin_int__int, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_INT, "Int (Float)", builtin_int__float, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_INT, "Int (String)", builtin_int__string, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_INT, "Int (...)", builtin_int__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_INT, "Int (Int)", builtin_int__int, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_INT, "Int (Float)", builtin_int__float, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_INT, "Int (String)", builtin_int__string, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_INT, "Int (...)", builtin_int__err, MORPHO_FN_THROWS, NULL); - morpho_addfunction(FUNCTION_FLOAT, "Float (Int)", builtin_float__int, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_FLOAT, "Float (Float)", builtin_float__float, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_FLOAT, "Float (String)", builtin_float__string, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_FLOAT, "Float (...)", builtin_float__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (Int)", builtin_float__int, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (Float)", builtin_float__float, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (String)", builtin_float__string, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_FLOAT, "Float (...)", builtin_float__err, MORPHO_FN_THROWS, NULL); - morpho_addfunction(FUNCTION_BOOL, "Bool (_)", builtin_bool, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_BOOL, "Bool ()", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_BOOL, "Bool (_,_,...)", builtin_bool_err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOOL, "Bool (_)", builtin_bool, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_BOOL, "Bool ()", builtin_bool_err, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_BOOL, "Bool (_,_,...)", builtin_bool_err, MORPHO_FN_THROWS, NULL); // Math functions - BUILTIN_VARMATH_RET(FUNCTION_ABS, fabs, "Float", "Float") + BUILTIN_VARMATH_RET(FUNCTION_ABS, fabs, "Float", MORPHO_FN_PUREFN, "Float", MORPHO_FN_PUREFN) - BUILTIN_VARMATH_RET(FUNCTION_EXP, exp, "Float", "Complex") + BUILTIN_MATH(exp) BUILTIN_MATH(log) BUILTIN_MATH(log10) @@ -679,49 +681,49 @@ void functiondefs_initialize(void) { BUILTIN_MATH_BOOL(isnan) // Math functions with special cases - morpho_addfunction(FUNCTION_ARCTAN, "Float (Int)", builtin_arctan__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Float (Float)", builtin_arctan__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Float (Int,Int)", builtin_arctan__number_number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Float (Int,Float)", builtin_arctan__number_number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Float (Float,Int)", builtin_arctan__number_number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Float (Float,Float)", builtin_arctan__number_number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Complex (Complex)", builtin_arctan__complex, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Complex (Complex,Complex)", builtin_arctan__complex2, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Complex (Complex,_)", builtin_arctan__complex2, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Complex (_,Complex)", builtin_arctan__complex2, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ARCTAN, "Float (...)", builtin_arctan__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (Int)", builtin_arctan__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (Float)", builtin_arctan__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (Int,Int)", builtin_arctan__number_number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (Int,Float)", builtin_arctan__number_number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (Float,Int)", builtin_arctan__number_number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (Float,Float)", builtin_arctan__number_number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Complex (Complex)", builtin_arctan__complex, MORPHO_FN_ALLOCATES, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Complex (Complex,Complex)", builtin_arctan__complex2, MORPHO_FN_ALLOCATES, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Complex (Complex,_)", builtin_arctan__complex2, MORPHO_FN_ALLOCATES, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Complex (_,Complex)", builtin_arctan__complex2, MORPHO_FN_ALLOCATES, NULL); + morpho_addfunction(FUNCTION_ARCTAN, "Float (...)", builtin_arctan__err, MORPHO_FN_THROWS, NULL); BUILTIN_MATH_OLD2(sqrt); - morpho_addfunction(FUNCTION_MOD, "Int (Int,Int)", builtin_mod__int_int, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MOD, "Float (Float,Float)", builtin_mod__float_float, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MOD, "Float (Int,Float)", builtin_mod__int_float, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MOD, "Float (Float,Int)", builtin_mod__float_int, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MOD, "Float (...)", builtin_mod__err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_SIGN, "Float (Int)", builtin_sign__int, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_SIGN, "Float (Float)", builtin_sign__float, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_SIGN, "Float (...)", builtin_sign__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_MOD, "Int (Int,Int)", builtin_mod__int_int, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (Float,Float)", builtin_mod__float_float, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (Int,Float)", builtin_mod__int_float, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (Float,Int)", builtin_mod__float_int, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_MOD, "Float (...)", builtin_mod__err, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_SIGN, "Float (Int)", builtin_sign__int, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_SIGN, "Float (Float)", builtin_sign__float, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_SIGN, "Float (...)", builtin_sign__err, MORPHO_FN_THROWS, NULL); // Complex - morpho_addfunction(FUNCTION_REAL, "Float (Complex)", builtin_real__complex, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_REAL, "Int (Int)", builtin_real__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_REAL, "Float (Float)", builtin_real__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_IMAG, "Float (Complex)", builtin_imag__complex, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_IMAG, "Float (Int)", builtin_imag__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_IMAG, "Float (Float)", builtin_imag__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ANGLE, "Float (Complex)", builtin_angle__complex, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ANGLE, "Float (Int)", builtin_angle__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ANGLE, "Float (Float)", builtin_angle__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_CONJ, "Complex (Complex)", builtin_conj__complex, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_CONJ, "Int (Int)", builtin_conj__number, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_CONJ, "Float (Float)", builtin_conj__number, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_REAL, "Float (Complex)", builtin_real__complex, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_REAL, "Int (Int)", builtin_real__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_REAL, "Float (Float)", builtin_real__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_IMAG, "Float (Complex)", builtin_imag__complex, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_IMAG, "Float (Int)", builtin_imag__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_IMAG, "Float (Float)", builtin_imag__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ANGLE, "Float (Complex)", builtin_angle__complex, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ANGLE, "Float (Int)", builtin_angle__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_ANGLE, "Float (Float)", builtin_angle__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_CONJ, "Complex (Complex)", builtin_conj__complex, MORPHO_FN_ALLOCATES, NULL); + morpho_addfunction(FUNCTION_CONJ, "Int (Int)", builtin_conj__number, MORPHO_FN_PUREFN, NULL); + morpho_addfunction(FUNCTION_CONJ, "Float (Float)", builtin_conj__number, MORPHO_FN_PUREFN, NULL); // Min/max - morpho_addfunction(FUNCTION_BOUNDS, "List (_)", builtin_bounds, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_BOUNDS, "List (_,...)", builtin_bounds, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_BOUNDS, "List ()", builtin_bounds__err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MIN, "(_,...)", builtin_min, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MIN, "()", builtin_min__err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MAX, "(_,...)", builtin_max, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_MAX, "()", builtin_max__err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_BOUNDS, "List (_)", builtin_bounds, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_BOUNDS, "List (_,...)", builtin_bounds, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_BOUNDS, "List ()", builtin_bounds__err, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_MIN, "(_,...)", builtin_min, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_MIN, "()", builtin_min__err, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_MAX, "(_,...)", builtin_max, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_MAX, "()", builtin_max__err, MORPHO_FN_THROWS, NULL); // Type checking BUILTIN_TYPECHECK(isnil) @@ -753,8 +755,8 @@ void functiondefs_initialize(void) { #endif morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_)", builtin_iscallablefunction, MORPHO_FN_PUREFN, NULL); - morpho_addfunction(FUNCTION_ISCALLABLE, "Bool ()", builtin_iscallablefunction_err, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_,_,...)", builtin_iscallablefunction_err, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_ISCALLABLE, "Bool ()", builtin_iscallablefunction_err, MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_ISCALLABLE, "Bool (_,_,...)", builtin_iscallablefunction_err, MORPHO_FN_THROWS, NULL); /* Define errors */ morpho_defineerror(MATH_ARGS, ERROR_HALT, MATH_ARGS_MSG); diff --git a/src/classes/array.c b/src/classes/array.c index 202e55368..43bf7f81d 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -595,13 +595,13 @@ value Array_clone(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Array) -MORPHO_METHOD(MORPHO_PRINT_METHOD, Array_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Array_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Array_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Array_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, MORPHO_FN_ALLOCATES), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Array_getindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Array_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Array_enumerate__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Array ()", Array_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Array_enumerate__int, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Array ()", Array_clone, MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/bool.c b/src/classes/bool.c index 95d2ee37c..8dc181797 100644 --- a/src/classes/bool.c +++ b/src/classes/bool.c @@ -15,7 +15,7 @@ MORPHO_BEGINCLASS(Bool) MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/cfunction.c b/src/classes/cfunction.c index e97059e0d..7964661d6 100644 --- a/src/classes/cfunction.c +++ b/src/classes/cfunction.c @@ -33,8 +33,8 @@ value CFunction_tostring(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(CFunction) -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, CFunction_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, CFunction_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/closure.c b/src/classes/closure.c index 5ddbd52ed..05a169c53 100644 --- a/src/classes/closure.c +++ b/src/classes/closure.c @@ -103,8 +103,8 @@ value Closure_tostring(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Closure) -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Closure_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Closure_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/clss.c b/src/classes/clss.c index 4abecfe9a..0afec04bf 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -204,7 +204,7 @@ MORPHO_BEGINCLASS(Class) MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index 85cb23fce..59d0b90e0 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -661,7 +661,7 @@ value Complex_clone(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(ComplexNum) -MORPHO_METHOD(MORPHO_PRINT_METHOD, Complex_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Complex_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (Complex)", Complex_sub__complex, BUILTIN_FLAGSEMPTY), @@ -680,12 +680,12 @@ MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (Complex)", Complex_power__c MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (_)", Complex_power__x, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (Complex)", Complex_powerr__complex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (_)", Complex_powerr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_ANGLE_METHOD, "Float ()", Complex_angle, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex ()", Complex_conjugate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Float ()", Complex_getreal, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Float ()", Complex_getimag, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_ABS_METHOD, "Float ()", Complex_abs, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(COMPLEX_ANGLE_METHOD, "Float ()", Complex_angle, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex ()", Complex_conjugate, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Float ()", Complex_getreal, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Float ()", Complex_getimag, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(COMPLEX_ABS_METHOD, "Float ()", Complex_abs, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/dict.c b/src/classes/dict.c index 37319b6ec..5db722759 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -255,26 +255,26 @@ DICTIONARY_SETOP_ERR(intersection) DICTIONARY_SETOP_ERR(difference) MORPHO_BEGINCLASS(Dictionary) -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Dictionary_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Dictionary_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Dictionary_contains, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(DICTIONARY_REMOVE_METHOD, Dictionary_remove, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Dictionary_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Dictionary_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (Dictionary)", Dictionary_union, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Nil (...)", Dictionary_union__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (Dictionary)", Dictionary_intersection, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Nil (...)", Dictionary_intersection__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (Dictionary)", Dictionary_difference, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Nil (...)", Dictionary_difference__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (Dictionary)", Dictionary_union, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Nil (...)", Dictionary_union__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (Dictionary)", Dictionary_difference, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Nil (...)", Dictionary_difference__err, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Dictionary_getindex, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Dictionary_setindex, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Dictionary_contains, MORPHO_FN_PUREFN), +MORPHO_METHOD(DICTIONARY_REMOVE_METHOD, Dictionary_remove, MORPHO_FN_MUTATES), +MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, MORPHO_FN_MUTATES), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Dictionary_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Dictionary_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (Dictionary)", Dictionary_union, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Nil (...)", Dictionary_union__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (Dictionary)", Dictionary_intersection, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Nil (...)", Dictionary_intersection__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (Dictionary)", Dictionary_difference, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Nil (...)", Dictionary_difference__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (Dictionary)", Dictionary_union, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Nil (...)", Dictionary_union__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (Dictionary)", Dictionary_difference, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Nil (...)", Dictionary_difference__err, MORPHO_FN_THROWS) MORPHO_ENDCLASS diff --git a/src/classes/err.c b/src/classes/err.c index a41b3ee91..89a5aed15 100644 --- a/src/classes/err.c +++ b/src/classes/err.c @@ -95,7 +95,7 @@ MORPHO_BEGINCLASS(Error) MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Error_init, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_THROW_METHOD, Error_throw, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_WARNING_METHOD, Error_warning, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Error_print, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_PRINT_METHOD, Error_print, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/file.c b/src/classes/file.c index fe9d66fa7..006ca6ef7 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -384,15 +384,15 @@ value File_eof(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(File) -MORPHO_METHOD(FILE_CLOSE, File_close, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_LINES, File_lines, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_READALL, File_readall, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_READLINE, File_readline, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_READCHAR, File_readchar, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_WRITE, File_write, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_RELATIVEPATH, File_relativepath, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_FILENAME, File_filename, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FILE_EOF, File_eof, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(FILE_CLOSE, File_close, MORPHO_FN_IO|MORPHO_FN_MUTATES), +MORPHO_METHOD(FILE_LINES, File_lines, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FILE_READALL, File_readall, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FILE_READLINE, File_readline, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FILE_READCHAR, File_readchar, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FILE_WRITE, File_write, MORPHO_FN_IO|MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FILE_RELATIVEPATH, File_relativepath, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FILE_FILENAME, File_filename, MORPHO_FN_NONE), +MORPHO_METHOD(FILE_EOF, File_eof, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/flt.c b/src/classes/flt.c index 8b827280d..55906bdd1 100644 --- a/src/classes/flt.c +++ b/src/classes/flt.c @@ -40,7 +40,7 @@ MORPHO_BEGINCLASS(Float) MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (String)", Value_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "Nil (...)", Value_format__err, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/function.c b/src/classes/function.c index f4eeab964..4decd59d4 100644 --- a/src/classes/function.c +++ b/src/classes/function.c @@ -203,8 +203,8 @@ value Function_tostring(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Function) -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Function_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Function_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/instance.c b/src/classes/instance.c index 2f68941c9..6d670ea60 100644 --- a/src/classes/instance.c +++ b/src/classes/instance.c @@ -321,19 +321,19 @@ value Object_linearization(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Object) -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Object_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Object_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUPER_METHOD, Object_super, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_HAS_METHOD, Object_has, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Object_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Object_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SERIALIZE_METHOD, Object_serialize, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Object_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_LINEARIZATION_METHOD, Object_linearization, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Object_getindex, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Object_setindex, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_SUPER_METHOD, Object_super, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_HAS_METHOD, Object_has, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), +MORPHO_METHOD(MORPHO_COUNT_METHOD, Object_count, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Object_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SERIALIZE_METHOD, Object_serialize, MORPHO_FN_NONE), +MORPHO_METHOD(MORPHO_CLONE_METHOD, Object_clone, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_LINEARIZATION_METHOD, Object_linearization, MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/int.c b/src/classes/int.c index 17a807411..954995326 100644 --- a/src/classes/int.c +++ b/src/classes/int.c @@ -19,7 +19,7 @@ MORPHO_BEGINCLASS(Int) MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (_)", Value_format, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/classes/invocation.c b/src/classes/invocation.c index 374f61434..1654e2815 100644 --- a/src/classes/invocation.c +++ b/src/classes/invocation.c @@ -130,9 +130,9 @@ value Invocation_clone(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Invocation) -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Invocation_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Invocation ()", Invocation_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Invocation_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Invocation ()", Invocation_clone, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/json.c b/src/classes/json.c index ae2a2a30d..ff6ec207d 100644 --- a/src/classes/json.c +++ b/src/classes/json.c @@ -602,10 +602,10 @@ value JSON_tostring__err(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(JSON) -MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(String)", JSON_parse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(...)", JSON_parse__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(_)", JSON_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(...)", JSON_tostring__err, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(String)", JSON_parse, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(...)", JSON_parse__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(_)", JSON_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(...)", JSON_tostring__err, MORPHO_FN_NONE) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/list.c b/src/classes/list.c index dd6c1ae72..b69d389ee 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -710,40 +710,40 @@ value List_ismember__err(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(List) -MORPHO_METHOD(MORPHO_APPEND_METHOD, List_append, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_REMOVE_METHOD, List_remove, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_INSERT_METHOD, List_insert, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(LIST_POP_METHOD, List_pop, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", List_getindex__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "List (_)", List_getindex__slice, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", List_getindex__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", List_setindex__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "Nil (...)", List_setindex__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_APPEND_METHOD, List_append, MORPHO_FN_MUTATES), +MORPHO_METHOD(LIST_REMOVE_METHOD, List_remove, MORPHO_FN_MUTATES), +MORPHO_METHOD(LIST_INSERT_METHOD, List_insert, MORPHO_FN_MUTATES), +MORPHO_METHOD(LIST_POP_METHOD, List_pop, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", List_getindex__int, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "List (_)", List_getindex__slice, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", List_getindex__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", List_setindex__int, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "Nil (...)", List_setindex__err, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", List_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", List_enumerate__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", List_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", List_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", List_enumerate__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", List_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List ()", List_tuples, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (Int)", List_tuples__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (...)", List_tuples__fallback, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List ()", List_sets, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (Int)", List_sets__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (...)", List_sets__fallback, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, MORPHO_FN_ALLOCATES), //MORPHO_METHOD(MORPHO_ADD_METHOD, List_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (List)", List_join__list, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Int)", List_roll, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Float)", List_roll, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", List_roll__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil ()", List_sort, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil (Callable)", List_sort_fn, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", List_order, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Nil ()", List_reverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", List_ismember__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", List_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Nil (...)", List_ismember__err, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (List)", List_join__list, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Int)", List_roll, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Float)", List_roll, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", List_roll__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil ()", List_sort, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil (Callable)", List_sort_fn, MORPHO_FN_MUTATES|MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", List_order, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Nil ()", List_reverse, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", List_ismember, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", List_ismember__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", List_ismember, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Nil (...)", List_ismember__err, MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/range.c b/src/classes/range.c index 45ce2296f..1f54798b6 100644 --- a/src/classes/range.c +++ b/src/classes/range.c @@ -206,11 +206,11 @@ value Range_clone(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Range) -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", Range_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Range_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Range_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Range ()", Range_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", Range_getindex, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Range_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Range_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Range ()", Range_clone, MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/strng.c b/src/classes/strng.c index ace1b7e8a..61419e2dc 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -289,15 +289,15 @@ value String_split(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(String) -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "(Int)", String_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", String_enumerate__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", String_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", String_enumerate__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Bool ()", String_isnumber, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "(Int)", String_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", String_enumerate__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", String_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", String_enumerate__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Bool ()", String_isnumber, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/system.c b/src/classes/system.c index 15c577813..0732a5e8d 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -168,20 +168,20 @@ value System_homefolder(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(System) -MORPHO_METHOD_SIGNATURE(SYSTEM_PLATFORM_METHOD, "String ()", System_platform, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_VERSION_METHOD, "String ()", System_version, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_CLOCK_METHOD, "Float ()", System_clock, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, System_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Int)", System_sleep, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Float)", System_sleep, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (...)", System_sleep__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_READLINE_METHOD, "String ()", System_readline, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_PLATFORM_METHOD, "String ()", System_platform, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(SYSTEM_VERSION_METHOD, "String ()", System_version, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(SYSTEM_CLOCK_METHOD, "Float ()", System_clock, MORPHO_FN_IO), +MORPHO_METHOD(MORPHO_PRINT_METHOD, System_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Int)", System_sleep, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Float)", System_sleep, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (...)", System_sleep__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(SYSTEM_READLINE_METHOD, "String ()", System_readline, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(SYSTEM_ARGUMENTS_METHOD, "List ()", System_arguments, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_EXIT_METHOD, "Nil ()", System_exit, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (String)", System_setworkingfolder, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (...)", System_setworkingfolder__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_WORKINGFOLDER_METHOD, "String ()", System_workingfolder, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(SYSTEM_HOMEFOLDER_METHOD, "String ()", System_homefolder, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(SYSTEM_EXIT_METHOD, "Nil ()", System_exit, MORPHO_FN_IO|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (String)", System_setworkingfolder, MORPHO_FN_IO|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (...)", System_setworkingfolder__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(SYSTEM_WORKINGFOLDER_METHOD, "String ()", System_workingfolder, MORPHO_FN_IO|MORPHO_FN_THROWS|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(SYSTEM_HOMEFOLDER_METHOD, "String ()", System_homefolder, MORPHO_FN_IO|MORPHO_FN_THROWS|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/tuple.c b/src/classes/tuple.c index ef429fde7..467018228 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -413,27 +413,27 @@ value Tuple_ismember__err(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Tuple) -MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Tuple_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Tuple_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Tuple_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", Tuple_enumerate__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (Tuple)", Tuple_join, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Nil (...)", Tuple_join__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Int)", Tuple_roll, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Float)", Tuple_roll, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", Tuple_roll__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (Callable)", Tuple_sort_fn, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", Tuple_ismember__err, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Nil (...)", Tuple_ismember__err, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Tuple_count, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Tuple_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Tuple_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", Tuple_enumerate__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (Tuple)", Tuple_join, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Nil (...)", Tuple_join__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Int)", Tuple_roll, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Float)", Tuple_roll, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", Tuple_roll__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (Callable)", Tuple_sort_fn, MORPHO_FN_ALLOCATES|MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", Tuple_ismember__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Nil (...)", Tuple_ismember__err, MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/linalg/complexmatrix.c b/src/linalg/complexmatrix.c index f6e41f919..f73bb0ab3 100644 --- a/src/linalg/complexmatrix.c +++ b/src/linalg/complexmatrix.c @@ -609,65 +609,65 @@ MORPHO_BEGINCLASS(ComplexMatrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(ComplexMatrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Range)", Matrix_index__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (List)", Matrix_index__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Tuple)", Matrix_index__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index__x_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_subr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mulr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_divr__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc__x_x_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm__x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "ComplexMatrix ()", Matrix_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int)", Matrix_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Range)", Matrix_index__x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (List)", Matrix_index__x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (Tuple)", Matrix_index__x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Complex (Int, Int)", Matrix_index__int_int, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (_,_)", Matrix_index__x_x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "ComplexMatrix (...)", Matrix_index__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,ComplexMatrix)", Matrix_setindex__x_x_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "ComplexMatrix (Int)", Matrix_getcolumn__int, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, ComplexMatrix)", Matrix_setcolumn__int_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_add__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (_)", Matrix_add__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_add__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (_)", Matrix_add__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_sub__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_sub__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (Nil)", Matrix_add__nil, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "ComplexMatrix (_)", Matrix_sub__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (_)", Matrix_subr__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_subr__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (_)", Matrix_mul__float, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_mul__complexmatrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mul__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_mulr__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (Complex)", ComplexMatrix_mul__complex, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "ComplexMatrix (_)", Matrix_mul__float, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (_)", Matrix_div__float, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_div__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "ComplexMatrix (ComplexMatrix)", Matrix_div__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "ComplexMatrix (Matrix)", ComplexMatrix_divr__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, ComplexMatrix)", Matrix_acc__x_x_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "ComplexMatrix ()", ComplexMatrix_inverse, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm__x, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Matrix ()", ComplexMatrix_real, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Matrix ()", ComplexMatrix_imag, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (ComplexMatrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (Matrix)", ComplexMatrix_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Complex ()", Matrix_sum, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Complex ()", ComplexMatrix_trace, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "ComplexMatrix ()", Matrix_transpose, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Matrix ()", ComplexMatrix_real, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Matrix ()", ComplexMatrix_imag, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "ComplexMatrix ()", ComplexMatrix_conj, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(COMPLEXMATRIX_CONJTRANSPOSE_METHOD, "ComplexMatrix ()", ComplexMatrix_conjTranspose, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (ComplexMatrix)", ComplexMatrix_inner, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Complex (Matrix)", ComplexMatrix_inner, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "ComplexMatrix (ComplexMatrix)", ComplexMatrix_outer, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, MORPHO_FN_MUTATES), MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int)", Matrix_roll__int, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "ComplexMatrix (Int,Int)", Matrix_roll__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/linalg/matrix.c b/src/linalg/matrix.c index 43f502fea..575f4a552 100644 --- a/src/linalg/matrix.c +++ b/src/linalg/matrix.c @@ -1588,53 +1588,53 @@ MORPHO_BEGINCLASS(Matrix) MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "()", Matrix_print, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "(String)", Matrix_format, BUILTIN_FLAGSEMPTY), MORPHO_METHOD_SIGNATURE(MORPHO_ASSIGN_METHOD, "(Matrix)", Matrix_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (Range)", Matrix_index__x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (List)", Matrix_index__x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (Tuple)", Matrix_index__x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index__int_int, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index__x_x, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex__x_x_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD_DEPRECATED, "(Int, Matrix)", Matrix_setcolumn__int_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Matrix)", Matrix_sub__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add__nil, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (Matrix)", Matrix_mul__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (Matrix)", Matrix_div__matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div__float, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc__x_x_matrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "Matrix ()", Matrix_inverse, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm__x, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Matrix ()", Matrix_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int)", Matrix_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (Range)", Matrix_index__x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (List)", Matrix_index__x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (Tuple)", Matrix_index__x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Float (Int, Int)", Matrix_index__int_int, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (_,_)", Matrix_index__x_x, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Matrix (...)", Matrix_index__err, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", Matrix_setindex__int_x, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,Int,_)", Matrix_setindex__int_int_x, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(_,_,Matrix)", Matrix_setindex__x_x_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MATRIX_GETCOLUMN_METHOD, "Matrix (Int)", Matrix_getcolumn__int, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD, "(Int, Matrix)", Matrix_setcolumn__int_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MATRIX_SETCOLUMN_METHOD_DEPRECATED, "(Int, Matrix)", Matrix_setcolumn__int_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Matrix)", Matrix_add__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (Nil)", Matrix_add__nil, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Matrix (_)", Matrix_add__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (_)", Matrix_add__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Matrix (Nil)", Matrix_add__nil, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Matrix)", Matrix_sub__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (Nil)", Matrix_add__nil, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Matrix (_)", Matrix_sub__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Matrix (_)", Matrix_subr__x, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (_)", Matrix_mul__float, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Matrix (Matrix)", Matrix_mul__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Matrix (_)", Matrix_mul__float, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (Matrix)", Matrix_div__matrix, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Matrix (_)", Matrix_div__float, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ACC_METHOD, "(_, Matrix)", Matrix_acc__x_x_matrix, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MATRIX_INVERSE_METHOD, "Matrix ()", Matrix_inverse, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float (_)", Matrix_norm__x, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MATRIX_NORM_METHOD, "Float ()", Matrix_norm, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_SUM_METHOD, "Float ()", Matrix_sum, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "Matrix ()", Matrix_transpose, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (Matrix)", Matrix_inner, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "Matrix (Matrix)", Matrix_outer, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll__int_int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD_SIGNATURE(MATRIX_TRACE_METHOD, "Float ()", Matrix_trace, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MATRIX_TRANSPOSE_METHOD, "Matrix ()", Matrix_transpose, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_INNER_METHOD, "Float (Matrix)", Matrix_inner, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MATRIX_OUTER_METHOD, "Matrix (Matrix)", Matrix_outer, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENVALUES_METHOD, "Tuple ()", Matrix_eigenvalues, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_EIGENSYSTEM_METHOD, "Tuple ()", Matrix_eigensystem, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_SVD_METHOD, "Tuple ()", Matrix_svd, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_QR_METHOD, "Tuple ()", Matrix_qr, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_RESHAPE_METHOD, "(Int,Int)", Matrix_reshape, MORPHO_FN_MUTATES), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int)", Matrix_roll__int, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MATRIX_ROLL_METHOD, "Matrix (Int,Int)", Matrix_roll__int_int, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", Matrix_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Matrix_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MATRIX_DIMENSIONS_METHOD, "Tuple ()", Matrix_dimensions, MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/test/super/super_init_with_internal_behavior.morpho b/test/super/super_init_with_internal_behavior.morpho new file mode 100644 index 000000000..23a15f088 --- /dev/null +++ b/test/super/super_init_with_internal_behavior.morpho @@ -0,0 +1,31 @@ +import bytecodeoptimizer + +var errChebyshevOrderInconsistent = Error("ChebyshevOrder", "Orders are inconsistent") + +class BaseMap { + init(R, G, B) { + self.R = R + self.G = G + self.B = B + self.order = R.count() + + if (G.count()!=self.order || B.count()!=self.order) errChebyshevOrderInconsistent.throw() + } + + report() { + return [self.order, self.R[0], self.G[0], self.B[0]] + } +} + +class DerivedMap is BaseMap { + init() { + super.init( + [1, 2, 3], + [4, 5, 6], + [7, 8, 9] + ) + } +} + +var m = DerivedMap() +print m.report() // expect: [ 3, 1, 4, 7 ] From 8fec42e81d8795d31a5d637c942c7f8ee179dacd Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 7 May 2026 18:04:43 -0400 Subject: [PATCH 404/473] CFunction annotation --- src/builtin/builtin.h | 35 +++++-- src/builtin/functiondefs.c | 12 +-- src/classes/array.c | 8 +- src/classes/bool.c | 6 +- src/classes/cfunction.c | 2 +- src/classes/closure.c | 2 +- src/classes/clss.c | 6 +- src/classes/cmplx.c | 40 +++---- src/classes/dict.c | 14 +-- src/classes/err.c | 6 +- src/classes/file.c | 12 +-- src/classes/flt.c | 10 +- src/classes/function.c | 3 +- src/classes/instance.c | 4 +- src/classes/int.c | 8 +- src/classes/invocation.c | 4 +- src/classes/json.c | 6 +- src/classes/list.c | 24 ++--- src/classes/metafunction.c | 4 +- src/classes/nil.c | 2 +- src/classes/range.c | 2 +- src/classes/strng.c | 4 +- src/classes/system.c | 4 +- src/classes/tuple.c | 16 +-- src/geometry/fespace.c | 4 +- src/geometry/field.c | 48 ++++----- src/geometry/functional.c | 210 ++++++++++++++++++------------------- src/geometry/mesh.c | 30 +++--- src/geometry/selection.c | 30 +++--- src/linalg/complexmatrix.c | 110 +++++++++---------- src/linalg/matrix.c | 78 +++++++------- src/linalg/sparse.c | 36 +++---- 32 files changed, 398 insertions(+), 382 deletions(-) diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index bf8bcaefb..c8b6d7901 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -26,19 +26,34 @@ bool builtin_parsesignatures(void); /** Flags that describe properties of the built in function */ typedef unsigned int builtinfunctionflags; -#define MORPHO_FN_NONE (0) // Function has been reviewed and has no special semantic annotations -#define MORPHO_FN_FLAGSEMPTY (1<<0) // Unknown or legacy-unreviewed flags: optimizer should assume any annotation may apply +/* Annotation policy: + * - MORPHO_FN_FLAGSEMPTY means unknown or legacy-unreviewed; optimizers should stay conservative. + * - MORPHO_FN_NONE means the function has been reviewed and has no special semantic annotation. + * - MORPHO_FN_PUREFN means pure on normal return: deterministic for constant inputs with no mutation, + * I/O, VM re-entry, thread-local dependence, or multithreaded execution. + * - Functions that allocate returned objects should generally carry MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS, + * because object construction / wrap-and-bind may fail. + * - MORPHO_FN_MUTATES is reserved for externally observable mutation, not internal caching. + * - MORPHO_FN_IO includes reads from process, filesystem, or platform state. + * - MORPHO_FN_NONDETERMINISTIC is reserved for genuinely unstable results such as RNG-like behavior. + */ + +#define MORPHO_FN_FLAGSEMPTY (0) // Unknown or legacy-unreviewed flags: optimizer should assume any annotation may apply +#define MORPHO_FN_NONE (1<<0) // Function has been reviewed and has no special semantic annotations #define BUILTIN_FLAGSEMPTY MORPHO_FN_FLAGSEMPTY -#define MORPHO_FN_PUREFN (1<<1) // Pure on normal return: deterministic for constant inputs, no mutation, I/O or re-entry -#define MORPHO_FN_CONSTRUCTOR (1<<2) // Constructor function -#define MORPHO_FN_REENTRANT (1<<3) // Function that re-enters the vm, e.g. by using morpho_call -#define MORPHO_FN_OPTARGS (1<<4) // Function reads VM optional/named arguments -#define MORPHO_FN_THROWS (1<<5) // Function may raise a runtime error -#define MORPHO_FN_ALLOCATES (1<<6) // Function may allocate and return/bind new objects -#define MORPHO_FN_MUTATES (1<<7) // Function may mutate receiver, arguments, or runtime-visible state -#define MORPHO_FN_IO (1<<8) // Function performs externally observable I/O or system interaction +#define MORPHO_FN_PUREFN (1<<1) // Pure on normal return: deterministic for constant inputs, no mutation, I/O or re-entry +#define MORPHO_FN_CONSTRUCTOR (1<<2) // Constructor function +#define MORPHO_FN_REENTRANT (1<<3) // Function that re-enters the vm, e.g. by using morpho_call +#define MORPHO_FN_OPTARGS (1<<4) // Function reads VM optional/named arguments +#define MORPHO_FN_THROWS (1<<5) // Function may raise a runtime error +#define MORPHO_FN_ALLOCATES (1<<6) // Function may allocate and return/bind new objects +#define MORPHO_FN_MUTATES (1<<7) // Function may mutate receiver, arguments, or runtime-visible state +#define MORPHO_FN_IO (1<<8) // Function performs externally observable I/O or system interaction +#define MORPHO_FN_NONDETERMINISTIC (1<<9) // Function may return different results for the same inputs +#define MORPHO_FN_THREADLOCAL (1<<10) // Function depends on or mutates VM thread-local state +#define MORPHO_FN_MULTITHREADED (1<<11) // Function may execute work across multiple threads /** Type of C function that implements a built in Morpho function */ typedef value (*builtinfunction) (vm *v, int nargs, value *args); diff --git a/src/builtin/functiondefs.c b/src/builtin/functiondefs.c index cc814c27c..5f814b948 100644 --- a/src/builtin/functiondefs.c +++ b/src/builtin/functiondefs.c @@ -599,7 +599,7 @@ value builtin_iscallablefunction_err(vm *v, int nargs, value *args) { * ********************************************************************** */ #define BUILTIN_MATH_OLD2(function) \ - builtin_addfunction(#function, builtin_##function, BUILTIN_FLAGSEMPTY); + builtin_addfunction(#function, builtin_##function, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS); #define BUILTIN_VARMATH_RET(label, function, realret, realflags, cmplxret, cmplxflags) \ morpho_addfunction(label, realret " (Int)", builtin_int_##function, realflags, NULL); \ @@ -625,7 +625,7 @@ void functiondefs_initialize(void) { builtin_addfunction(FUNCTION_SYSTEM, builtin_system, MORPHO_FN_IO); // Clock - morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, MORPHO_FN_IO, NULL); + morpho_addfunction(FUNCTION_CLOCK, "Float ()", builtin_clock, MORPHO_FN_IO|MORPHO_FN_NONDETERMINISTIC, NULL); // Apply morpho_addfunction(FUNCTION_APPLY, "(Callable,Tuple)", builtin_apply__tuple, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS, NULL); @@ -635,10 +635,10 @@ void functiondefs_initialize(void) { morpho_addfunction(FUNCTION_APPLY, "(_)", builtin_apply__err, MORPHO_FN_THROWS, NULL); // Random numbers - morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint_norange, BUILTIN_FLAGSEMPTY, NULL); - morpho_addfunction(FUNCTION_RANDOMINT, "Int (_)", builtin_randomint, MORPHO_FN_THROWS, NULL); - morpho_addfunction(FUNCTION_RANDOMNORMAL, "Float ()", builtin_randomnormal, BUILTIN_FLAGSEMPTY, NULL); + morpho_addfunction(FUNCTION_RANDOM, "Float ()", builtin_random, MORPHO_FN_NONDETERMINISTIC, NULL); + morpho_addfunction(FUNCTION_RANDOMINT, "Int ()", builtin_randomint_norange, MORPHO_FN_NONDETERMINISTIC, NULL); + morpho_addfunction(FUNCTION_RANDOMINT, "Int (_)", builtin_randomint, MORPHO_FN_NONDETERMINISTIC|MORPHO_FN_THROWS, NULL); + morpho_addfunction(FUNCTION_RANDOMNORMAL, "Float ()", builtin_randomnormal, MORPHO_FN_NONDETERMINISTIC, NULL); // Value constructors morpho_addfunction(FUNCTION_INT, "Int (Int)", builtin_int__int, MORPHO_FN_PUREFN, NULL); diff --git a/src/classes/array.c b/src/classes/array.c index 43bf7f81d..69857a00e 100644 --- a/src/classes/array.c +++ b/src/classes/array.c @@ -597,11 +597,11 @@ value Array_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Array) MORPHO_METHOD(MORPHO_PRINT_METHOD, Array_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Array_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, MORPHO_FN_ALLOCATES), -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Array_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Array_setindex, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(ARRAY_DIMENSIONS_METHOD, "List ()", Array_dimensions, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Array_getindex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Array_setindex, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Array_enumerate__int, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Array ()", Array_clone, MORPHO_FN_ALLOCATES) +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Array ()", Array_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/bool.c b/src/classes/bool.c index 8dc181797..7968d6aea 100644 --- a/src/classes/bool.c +++ b/src/classes/bool.c @@ -12,9 +12,9 @@ * ********************************************************************** */ MORPHO_BEGINCLASS(Bool) -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS diff --git a/src/classes/cfunction.c b/src/classes/cfunction.c index 7964661d6..6ae775174 100644 --- a/src/classes/cfunction.c +++ b/src/classes/cfunction.c @@ -33,7 +33,7 @@ value CFunction_tostring(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(CFunction) -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, CFunction_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, CFunction_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS diff --git a/src/classes/closure.c b/src/classes/closure.c index 05a169c53..83e6d6add 100644 --- a/src/classes/closure.c +++ b/src/classes/closure.c @@ -103,7 +103,7 @@ value Closure_tostring(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Closure) -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Closure_tostring, MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Closure_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS diff --git a/src/classes/clss.c b/src/classes/clss.c index 0afec04bf..f590ff34d 100644 --- a/src/classes/clss.c +++ b/src/classes/clss.c @@ -201,9 +201,9 @@ bool class_comparedistance(objectclass *a, objectclass *b, int *out) { * ********************************************************************** */ MORPHO_BEGINCLASS(Class) -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO) MORPHO_ENDCLASS diff --git a/src/classes/cmplx.c b/src/classes/cmplx.c index 59d0b90e0..ab7974dc6 100644 --- a/src/classes/cmplx.c +++ b/src/classes/cmplx.c @@ -662,30 +662,30 @@ value Complex_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(ComplexNum) MORPHO_METHOD(MORPHO_PRINT_METHOD, Complex_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (Complex)", Complex_sub__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (_)", Complex_sub__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (Complex)", Complex_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (_)", Complex_mul__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (Complex)", Complex_div__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (_)", Complex_div__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (Complex)", Complex_add__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (_)", Complex_add__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Complex (_)", Complex_subr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (Complex)", Complex_mul__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (_)", Complex_mul__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "Complex (_)", Complex_divr__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (Complex)", Complex_power__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (_)", Complex_power__x, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (Complex)", Complex_powerr__complex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (_)", Complex_powerr__x, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (Complex)", Complex_add__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Complex (_)", Complex_add__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (Complex)", Complex_sub__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Complex (_)", Complex_sub__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (Complex)", Complex_mul__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MUL_METHOD, "Complex (_)", Complex_mul__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (Complex)", Complex_div__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIV_METHOD, "Complex (_)", Complex_div__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (Complex)", Complex_add__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADDR_METHOD, "Complex (_)", Complex_add__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUBR_METHOD, "Complex (_)", Complex_subr__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (Complex)", Complex_mul__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_MULR_METHOD, "Complex (_)", Complex_mul__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIVR_METHOD, "Complex (_)", Complex_divr__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (Complex)", Complex_power__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_POW_METHOD, "Complex (_)", Complex_power__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (Complex)", Complex_powerr__complex, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_POWR_METHOD, "Complex (_)", Complex_powerr__x, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(COMPLEX_ANGLE_METHOD, "Float ()", Complex_angle, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex ()", Complex_conjugate, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(COMPLEX_CONJUGATE_METHOD, "Complex ()", Complex_conjugate, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(COMPLEX_REAL_METHOD, "Float ()", Complex_getreal, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(COMPLEX_IMAG_METHOD, "Float ()", Complex_getimag, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(COMPLEX_ABS_METHOD, "Float ()", Complex_abs, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, MORPHO_FN_ALLOCATES) +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Complex ()", Complex_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/dict.c b/src/classes/dict.c index 5db722759..37592aebf 100644 --- a/src/classes/dict.c +++ b/src/classes/dict.c @@ -263,17 +263,17 @@ MORPHO_METHOD(DICTIONARY_CLEAR_METHOD, Dictionary_clear, MORPHO_FN_MUTATES), MORPHO_METHOD(MORPHO_PRINT_METHOD, Dictionary_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Dictionary_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Dictionary_enumerate, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (Dictionary)", Dictionary_union, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(DICTIONARY_KEYS_METHOD, "List ()", Dictionary_keys, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Dictionary ()", Dictionary_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Dictionary (Dictionary)", Dictionary_union, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_UNION_METHOD, "Nil (...)", Dictionary_union__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (Dictionary)", Dictionary_intersection, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Dictionary (Dictionary)", Dictionary_intersection, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_INTERSECTION_METHOD, "Nil (...)", Dictionary_intersection__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (Dictionary)", Dictionary_difference, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Dictionary (Dictionary)", Dictionary_difference, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_DIFFERENCE_METHOD, "Nil (...)", Dictionary_difference__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (Dictionary)", Dictionary_union, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Dictionary (Dictionary)", Dictionary_union, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_ADD_METHOD, "Nil (...)", Dictionary_union__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (Dictionary)", Dictionary_difference, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Dictionary (Dictionary)", Dictionary_difference, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_SUB_METHOD, "Nil (...)", Dictionary_difference__err, MORPHO_FN_THROWS) MORPHO_ENDCLASS diff --git a/src/classes/err.c b/src/classes/err.c index 89a5aed15..85ae9e809 100644 --- a/src/classes/err.c +++ b/src/classes/err.c @@ -92,9 +92,9 @@ value Error_print(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Error) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Error_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_THROW_METHOD, Error_throw, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_WARNING_METHOD, Error_warning, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Error_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_THROW_METHOD, Error_throw, MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_WARNING_METHOD, Error_warning, MORPHO_FN_IO), MORPHO_METHOD(MORPHO_PRINT_METHOD, Error_print, MORPHO_FN_IO) MORPHO_ENDCLASS diff --git a/src/classes/file.c b/src/classes/file.c index 006ca6ef7..a8005fd1b 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -478,12 +478,12 @@ value Folder_createrecursive(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Folder) -MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (String)", Folder_isfolder__string, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER_DEPRECATED, "Bool (String)", Folder_isfolder__string, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_NORMALIZEPATH, "String (String)", Folder_normalizepath, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (String)", Folder_contents, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_CREATE, "(String)", Folder_create, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(FOLDER_CREATERECURSIVE, "(String)", Folder_createrecursive, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER, "Bool (String)", Folder_isfolder__string, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(FOLDER_ISFOLDER_DEPRECATED, "Bool (String)", Folder_isfolder__string, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(FOLDER_NORMALIZEPATH, "String (String)", Folder_normalizepath, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(FOLDER_CONTENTS, "List (String)", Folder_contents, MORPHO_FN_IO|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(FOLDER_CREATE, "(String)", Folder_create, MORPHO_FN_IO|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(FOLDER_CREATERECURSIVE, "(String)", Folder_createrecursive, MORPHO_FN_IO|MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/flt.c b/src/classes/flt.c index 55906bdd1..e53fd2079 100644 --- a/src/classes/flt.c +++ b/src/classes/flt.c @@ -37,12 +37,12 @@ value Value_format__err(vm *v, int nargs, value *args) { * ********************************************************************** */ MORPHO_BEGINCLASS(Float) -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (String)", Value_format, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "Nil (...)", Value_format__err, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (String)", Value_format, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "Nil (...)", Value_format__err, MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/function.c b/src/classes/function.c index 4decd59d4..2e948fff6 100644 --- a/src/classes/function.c +++ b/src/classes/function.c @@ -240,7 +240,8 @@ objecttypedefn objectcallabledefn = { * ********************************************************************** */ MORPHO_BEGINCLASS(Callable) -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Function_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/instance.c b/src/classes/instance.c index 6d670ea60..c1de66e06 100644 --- a/src/classes/instance.c +++ b/src/classes/instance.c @@ -332,8 +332,8 @@ MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), MORPHO_METHOD(MORPHO_COUNT_METHOD, Object_count, MORPHO_FN_PUREFN), MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Object_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_SERIALIZE_METHOD, Object_serialize, MORPHO_FN_NONE), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Object_clone, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), -MORPHO_METHOD(MORPHO_LINEARIZATION_METHOD, Object_linearization, MORPHO_FN_ALLOCATES) +MORPHO_METHOD(MORPHO_CLONE_METHOD, Object_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_LINEARIZATION_METHOD, Object_linearization, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/int.c b/src/classes/int.c index 954995326..ccb445bc9 100644 --- a/src/classes/int.c +++ b/src/classes/int.c @@ -16,11 +16,11 @@ * ********************************************************************** */ MORPHO_BEGINCLASS(Int) -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_RESPONDSTO_METHOD, Object_respondsto, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_INVOKE_METHOD, Object_invoke, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (_)", Value_format, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD_SIGNATURE(MORPHO_FORMAT_METHOD, "String (_)", Value_format, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/invocation.c b/src/classes/invocation.c index 1654e2815..152b72760 100644 --- a/src/classes/invocation.c +++ b/src/classes/invocation.c @@ -131,8 +131,8 @@ value Invocation_clone(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Invocation) MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Invocation_tostring, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Invocation ()", Invocation_clone, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS) +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Invocation_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Invocation ()", Invocation_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/json.c b/src/classes/json.c index ff6ec207d..4b347d662 100644 --- a/src/classes/json.c +++ b/src/classes/json.c @@ -602,10 +602,10 @@ value JSON_tostring__err(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(JSON) -MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(String)", JSON_parse, MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(String)", JSON_parse, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(JSON_PARSEMETHOD, "(...)", JSON_parse__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(_)", JSON_tostring, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(...)", JSON_tostring__err, MORPHO_FN_NONE) +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(_)", JSON_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "(...)", JSON_tostring__err, MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/list.c b/src/classes/list.c index b69d389ee..2b39f6c3e 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -720,25 +720,25 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", List_getindex__err, MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "(Int,_)", List_setindex__int, MORPHO_FN_MUTATES), MORPHO_METHOD_SIGNATURE(MORPHO_SETINDEX_METHOD, "Nil (...)", List_setindex__err, MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_PRINT_METHOD, List_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", List_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", List_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", List_enumerate__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", List_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List ()", List_tuples, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (Int)", List_tuples__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (...)", List_tuples__fallback, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List ()", List_sets, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (Int)", List_sets__int, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (...)", List_sets__fallback, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List ()", List_tuples, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (Int)", List_tuples__int, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_TUPLES_METHOD, "List (...)", List_tuples__fallback, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List ()", List_sets, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (Int)", List_sets__int, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_SETS_METHOD, "List (...)", List_sets__fallback, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "List ()", List_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), //MORPHO_METHOD(MORPHO_ADD_METHOD, List_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (List)", List_join__list, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Int)", List_roll, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Float)", List_roll, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "List (List)", List_join__list, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Int)", List_roll, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "List (Float)", List_roll, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", List_roll__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil ()", List_sort, MORPHO_FN_MUTATES), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Nil (Callable)", List_sort_fn, MORPHO_FN_MUTATES|MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", List_order, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", List_order, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Nil ()", List_reverse, MORPHO_FN_MUTATES), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", List_ismember, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", List_ismember__err, MORPHO_FN_THROWS), diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 0dd7c3e9b..c98518d11 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1409,8 +1409,8 @@ value Metafunction_tostring(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Metafunction) -MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Metafunction_tostring, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Metafunction_count, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_TOSTRING_METHOD, Metafunction_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(MORPHO_COUNT_METHOD, Metafunction_count, MORPHO_FN_PUREFN) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/nil.c b/src/classes/nil.c index 07c35d440..8ebf67394 100644 --- a/src/classes/nil.c +++ b/src/classes/nil.c @@ -12,7 +12,7 @@ * ********************************************************************** */ MORPHO_BEGINCLASS(Nil) -MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_CLASS_METHOD, Object_class, MORPHO_FN_PUREFN) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/range.c b/src/classes/range.c index 1f54798b6..53b0a4b42 100644 --- a/src/classes/range.c +++ b/src/classes/range.c @@ -210,7 +210,7 @@ MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, " (Int)", Range_getindex, MORPHO MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Range_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Range_count, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Range ()", Range_clone, MORPHO_FN_ALLOCATES) +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Range ()", Range_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/strng.c b/src/classes/strng.c index 61419e2dc..2d1ca6991 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -291,13 +291,13 @@ value String_split(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(String) MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "(Int)", String_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", String_enumerate__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", String_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", String_enumerate__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(STRING_ISNUMBER_METHOD, "Bool ()", String_isnumber, MORPHO_FN_PUREFN), -MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, MORPHO_FN_ALLOCATES) +MORPHO_METHOD_SIGNATURE(STRING_SPLIT_METHOD, "List (String)", String_split, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/classes/system.c b/src/classes/system.c index 0732a5e8d..7c0ccbde5 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -170,13 +170,13 @@ value System_homefolder(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(System) MORPHO_METHOD_SIGNATURE(SYSTEM_PLATFORM_METHOD, "String ()", System_platform, MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(SYSTEM_VERSION_METHOD, "String ()", System_version, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(SYSTEM_CLOCK_METHOD, "Float ()", System_clock, MORPHO_FN_IO), +MORPHO_METHOD_SIGNATURE(SYSTEM_CLOCK_METHOD, "Float ()", System_clock, MORPHO_FN_IO|MORPHO_FN_NONDETERMINISTIC), MORPHO_METHOD(MORPHO_PRINT_METHOD, System_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Int)", System_sleep, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (Float)", System_sleep, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(SYSTEM_SLEEP_METHOD, "Nil (...)", System_sleep__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(SYSTEM_READLINE_METHOD, "String ()", System_readline, MORPHO_FN_IO|MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(SYSTEM_ARGUMENTS_METHOD, "List ()", System_arguments, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD_SIGNATURE(SYSTEM_ARGUMENTS_METHOD, "List ()", System_arguments, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(SYSTEM_EXIT_METHOD, "Nil ()", System_exit, MORPHO_FN_IO|MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (String)", System_setworkingfolder, MORPHO_FN_IO|MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (...)", System_setworkingfolder__err, MORPHO_FN_THROWS), diff --git a/src/classes/tuple.c b/src/classes/tuple.c index 467018228..2cd496dda 100644 --- a/src/classes/tuple.c +++ b/src/classes/tuple.c @@ -415,21 +415,21 @@ value Tuple_ismember__err(vm *v, int nargs, value *args) { MORPHO_BEGINCLASS(Tuple) MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", Tuple_count, MORPHO_FN_PUREFN), MORPHO_METHOD(MORPHO_PRINT_METHOD, Object_print, MORPHO_FN_IO), -MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Tuple_tostring, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_TOSTRING_METHOD, "String ()", Tuple_tostring, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "Tuple ()", Tuple_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Tuple_getindex, MORPHO_FN_THROWS), MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Tuple_setindex, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, " (Int)", Tuple_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", Tuple_enumerate__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (Tuple)", Tuple_join, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Tuple (Tuple)", Tuple_join, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_JOIN_METHOD, "Nil (...)", Tuple_join__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Int)", Tuple_roll, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Float)", Tuple_roll, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Int)", Tuple_roll, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Tuple (Float)", Tuple_roll, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(MORPHO_ROLL_METHOD, "Nil (...)", Tuple_roll__err, MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple ()", Tuple_sort, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(LIST_SORT_METHOD, "Tuple (Callable)", Tuple_sort_fn, MORPHO_FN_ALLOCATES|MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), -MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_ORDER_METHOD, "Tuple ()", Tuple_order, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(LIST_REVERSE_METHOD, "Tuple ()", Tuple_reverse, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Bool (_)", Tuple_ismember, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(LIST_ISMEMBER_METHOD, "Nil (...)", Tuple_ismember__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_CONTAINS_METHOD, "Bool (_)", Tuple_ismember, MORPHO_FN_PUREFN), diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 17b3603ab..ff4ad972f 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -653,7 +653,7 @@ value FiniteElementSpace_layout(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(FiniteElementSpace) -MORPHO_METHOD(FINITEELEMENTSPACE_LAYOUT_METHOD, FiniteElementSpace_layout, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(FINITEELEMENTSPACE_LAYOUT_METHOD, FiniteElementSpace_layout, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** @@ -663,7 +663,7 @@ MORPHO_ENDCLASS void fespace_initialize(void) { objectfespacetype=object_addtype(&objectfespacedefn); - builtin_addfunction(FINITEELEMENTSPACE_CLASSNAME, fespace_constructor, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FINITEELEMENTSPACE_CLASSNAME, fespace_constructor, MORPHO_FN_CONSTRUCTOR|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); diff --git a/src/geometry/field.c b/src/geometry/field.c index 6f6927fde..f4d04bec2 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -967,29 +967,29 @@ value Field_unsafelinearize(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Field) -MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Field_getindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Field_setindex, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Field_enumerate, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Field_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ASSIGN_METHOD, Field_assign, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADD_METHOD, Field_add, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ADDR_METHOD, Field_addr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUB_METHOD, Field_sub, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SUBR_METHOD, Field_subr, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_ACC_METHOD, Field_acc, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_MUL_METHOD, Field_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_MULR_METHOD, Field_mul, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_DIV_METHOD, Field_div, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MATRIX_INNER_METHOD, Field_inner, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD_OP_METHOD, Field_op, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_PRINT_METHOD, Field_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Field_clone, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD_SHAPE_METHOD, Field_shape, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD_FESPACE_METHOD, Field_fnspace, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD_PROTOTYPE_METHOD, Field_prototype, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD_MESH_METHOD, Field_mesh, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD_LINEARIZE_METHOD, Field_linearize, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FIELD__LINEARIZE_METHOD, Field_unsafelinearize, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_GETINDEX_METHOD, Field_getindex, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SETINDEX_METHOD, Field_setindex, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_ENUMERATE_METHOD, Field_enumerate, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_COUNT_METHOD, Field_count, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_ASSIGN_METHOD, Field_assign, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_ADD_METHOD, Field_add, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_ADDR_METHOD, Field_addr, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SUB_METHOD, Field_sub, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_SUBR_METHOD, Field_subr, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_ACC_METHOD, Field_acc, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_MUL_METHOD, Field_mul, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_MULR_METHOD, Field_mul, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_DIV_METHOD, Field_div, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MATRIX_INNER_METHOD, Field_inner, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(FIELD_OP_METHOD, Field_op, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MORPHO_PRINT_METHOD, Field_print, MORPHO_FN_IO), +MORPHO_METHOD(MORPHO_CLONE_METHOD, Field_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FIELD_SHAPE_METHOD, Field_shape, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FIELD_FESPACE_METHOD, Field_fnspace, MORPHO_FN_PUREFN), +MORPHO_METHOD(FIELD_PROTOTYPE_METHOD, Field_prototype, MORPHO_FN_PUREFN), +MORPHO_METHOD(FIELD_MESH_METHOD, Field_mesh, MORPHO_FN_PUREFN), +MORPHO_METHOD(FIELD_LINEARIZE_METHOD, Field_linearize, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), +MORPHO_METHOD(FIELD__LINEARIZE_METHOD, Field_unsafelinearize, MORPHO_FN_PUREFN) MORPHO_ENDCLASS /* ********************************************************************** @@ -1002,7 +1002,7 @@ void field_initialize(void) { field_gradeoption=builtin_internsymbolascstring(FIELD_GRADEOPTION); field_functionspaceoption=builtin_internsymbolascstring(FIELD_FESPACEOPTION); - builtin_addfunction(FIELD_CLASSNAME, field_constructor, BUILTIN_FLAGSEMPTY); + builtin_addfunction(FIELD_CLASSNAME, field_constructor, MORPHO_FN_CONSTRUCTOR|MORPHO_FN_ALLOCATES|MORPHO_FN_REENTRANT|MORPHO_FN_THROWS); objectstring objname = MORPHO_STATICSTRING(OBJECT_CLASSNAME); value objclass = builtin_findclass(MORPHO_OBJECT(&objname)); diff --git a/src/geometry/functional.c b/src/geometry/functional.c index c9e6888f0..7000c406b 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -1749,12 +1749,12 @@ FUNCTIONAL_TOTAL(Length, MESH_GRADE_LINE, length_integrand) FUNCTIONAL_HESSIAN(Length, MESH_GRADE_LINE, length_integrand) MORPHO_BEGINCLASS(Length) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Length_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Length_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, Length_integrandForElement, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Length_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Length_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Length_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Length_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Length_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, Length_integrandForElement, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Length_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Length_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Length_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -1812,12 +1812,12 @@ FUNCTIONAL_TOTAL(AreaEnclosed, MESH_GRADE_LINE, areaenclosed_integrand) FUNCTIONAL_HESSIAN(AreaEnclosed, MESH_GRADE_LINE, areaenclosed_integrand) MORPHO_BEGINCLASS(AreaEnclosed) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, AreaEnclosed_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, AreaEnclosed_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, AreaEnclosed_integrandForElement, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, AreaEnclosed_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, AreaEnclosed_hessian, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, AreaEnclosed_total, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, AreaEnclosed_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, AreaEnclosed_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, AreaEnclosed_integrandForElement, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, AreaEnclosed_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, AreaEnclosed_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, AreaEnclosed_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -1880,12 +1880,12 @@ FUNCTIONAL_TOTAL(Area, MESH_GRADE_AREA, area_integrand) FUNCTIONAL_HESSIAN(Area, MESH_GRADE_AREA, area_integrand) MORPHO_BEGINCLASS(Area) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Area_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Area_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, Area_integrandForElement, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Area_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Area_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Area_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Area_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Area_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, Area_integrandForElement, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Area_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Area_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Area_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -1935,11 +1935,11 @@ FUNCTIONAL_TOTAL(VolumeEnclosed, MESH_GRADE_AREA, volumeenclosed_integrand) FUNCTIONAL_HESSIAN(VolumeEnclosed, MESH_GRADE_AREA, volumeenclosed_integrand) MORPHO_BEGINCLASS(VolumeEnclosed) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, VolumeEnclosed_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, VolumeEnclosed_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, VolumeEnclosed_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, VolumeEnclosed_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, VolumeEnclosed_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, VolumeEnclosed_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, VolumeEnclosed_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, VolumeEnclosed_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, VolumeEnclosed_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, VolumeEnclosed_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -2003,11 +2003,11 @@ FUNCTIONAL_TOTAL(Volume, MESH_GRADE_VOLUME, volume_integrand) FUNCTIONAL_HESSIAN(Volume, MESH_GRADE_VOLUME, volume_integrand) MORPHO_BEGINCLASS(Volume) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Volume_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Volume_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Volume_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Volume_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Volume_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Volume_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Volume_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Volume_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Volume_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Volume_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -2129,11 +2129,11 @@ value ScalarPotential_gradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(ScalarPotential) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, ScalarPotential_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, ScalarPotential_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, ScalarPotential_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, ScalarPotential_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, ScalarPotential_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, ScalarPotential_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, ScalarPotential_integrand, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, ScalarPotential_gradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, ScalarPotential_total, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, ScalarPotential_hessian, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -2303,10 +2303,10 @@ value LinearElasticity_gradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(LinearElasticity) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LinearElasticity_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LinearElasticity_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LinearElasticity_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LinearElasticity_gradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LinearElasticity_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LinearElasticity_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LinearElasticity_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LinearElasticity_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -2516,10 +2516,10 @@ FUNCTIONAL_METHOD(Hydrogel, integrand, (ref.grade), hydrogelref, hydrogel_prepar FUNCTIONAL_METHOD(Hydrogel, total, (ref.grade), hydrogelref, hydrogel_prepareref, functional_sumintegrand, hydrogel_integrand, NULL, HYDROGEL_PRP, SYMMETRY_NONE) MORPHO_BEGINCLASS(Hydrogel) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Hydrogel_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Hydrogel_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Hydrogel_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Hydrogel_gradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Hydrogel_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Hydrogel_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Hydrogel_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Hydrogel_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -2679,11 +2679,11 @@ FUNCTIONAL_METHOD(EquiElement, gradient, MESH_GRADE_VERTEX, equielementref, equi FUNCTIONAL_METHOD(EquiElement, hessian, MESH_GRADE_VERTEX, equielementref, equielement_prepareref, functional_mapnumericalhessian, equielement_integrand, equielement_dependencies, EQUIELEMENT_ARGS, SYMMETRY_ADD) MORPHO_BEGINCLASS(EquiElement) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, EquiElement_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, EquiElement_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, EquiElement_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, EquiElement_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, EquiElement_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, EquiElement_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, EquiElement_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, EquiElement_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, EquiElement_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, EquiElement_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ********************************************************************** @@ -2814,12 +2814,12 @@ FUNCTIONAL_METHOD(LineCurvatureSq, gradient, MESH_GRADE_VERTEX, curvatureref, cu FUNCTIONAL_METHOD(LineCurvatureSq, hessian, MESH_GRADE_VERTEX, curvatureref, curvature_prepareref, functional_mapnumericalhessian, linecurvsq_integrand, linecurvsq_dependencies, FUNCTIONAL_ARGS, SYMMETRY_ADD) MORPHO_BEGINCLASS(LineCurvatureSq) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineCurvatureSq_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LineCurvatureSq_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, LineCurvatureSq_integrandForElement, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LineCurvatureSq_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LineCurvatureSq_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, LineCurvatureSq_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineCurvatureSq_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LineCurvatureSq_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_INTEGRANDFORELEMENT_METHOD, LineCurvatureSq_integrandForElement, MORPHO_FN_PUREFN|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LineCurvatureSq_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LineCurvatureSq_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, LineCurvatureSq_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -2956,11 +2956,11 @@ FUNCTIONAL_METHOD(LineTorsionSq, gradient, MESH_GRADE_LINE, curvatureref, curvat FUNCTIONAL_METHOD(LineTorsionSq, hessian, MESH_GRADE_LINE, curvatureref, curvature_prepareref, functional_mapnumericalhessian, linetorsionsq_integrand, linetorsionsq_dependencies, FUNCTIONAL_ARGS, SYMMETRY_ADD) MORPHO_BEGINCLASS(LineTorsionSq) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineTorsionSq_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LineTorsionSq_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LineTorsionSq_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LineTorsionSq_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, LineTorsionSq_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineTorsionSq_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LineTorsionSq_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LineTorsionSq_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LineTorsionSq_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, LineTorsionSq_hessian, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -3118,10 +3118,10 @@ FUNCTIONAL_METHOD(MeanCurvatureSq, total, MESH_GRADE_VERTEX, areacurvatureref, a FUNCTIONAL_METHOD(MeanCurvatureSq, gradient, MESH_GRADE_VERTEX, areacurvatureref, areacurvature_prepareref, functional_mapnumericalgradient, meancurvaturesq_integrand, meancurvaturesq_dependencies, FUNCTIONAL_ARGS, SYMMETRY_ADD) MORPHO_BEGINCLASS(MeanCurvatureSq) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, MeanCurvatureSq_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, MeanCurvatureSq_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, MeanCurvatureSq_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, MeanCurvatureSq_total, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, MeanCurvatureSq_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, MeanCurvatureSq_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, MeanCurvatureSq_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, MeanCurvatureSq_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -3189,10 +3189,10 @@ FUNCTIONAL_METHOD(GaussCurvature, total, MESH_GRADE_VERTEX, areacurvatureref, ar FUNCTIONAL_METHOD(GaussCurvature, gradient, MESH_GRADE_VERTEX, areacurvatureref, areacurvature_prepareref, functional_mapnumericalgradient, gausscurvature_integrand, meancurvaturesq_dependencies, FUNCTIONAL_ARGS, SYMMETRY_ADD) MORPHO_BEGINCLASS(GaussCurvature) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, GaussCurvature_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, GaussCurvature_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, GaussCurvature_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, GaussCurvature_total, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, GaussCurvature_init, MORPHO_FN_MUTATES), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, GaussCurvature_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, GaussCurvature_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, GaussCurvature_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ********************************************************************** @@ -3449,11 +3449,11 @@ value GradSq_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(GradSq) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, GradSq_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, GradSq_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, GradSq_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, GradSq_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, GradSq_fieldgradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, GradSq_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, GradSq_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, GradSq_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, GradSq_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, GradSq_fieldgradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -3694,11 +3694,11 @@ value Nematic_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Nematic) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Nematic_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Nematic_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Nematic_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Nematic_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, Nematic_fieldgradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Nematic_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Nematic_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Nematic_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Nematic_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, Nematic_fieldgradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -3840,11 +3840,11 @@ value NematicElectric_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(NematicElectric) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, NematicElectric_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, NematicElectric_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, NematicElectric_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, NematicElectric_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, NematicElectric_fieldgradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, NematicElectric_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, NematicElectric_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, NematicElectric_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, NematicElectric_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, NematicElectric_fieldgradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -3891,11 +3891,11 @@ value NormSq_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(NormSq) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, GradSq_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, NormSq_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, NormSq_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, NormSq_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, NormSq_fieldgradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, GradSq_init, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, NormSq_integrand, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, NormSq_total, MORPHO_FN_PUREFN|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, NormSq_gradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, NormSq_fieldgradient, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ********************************************************************** @@ -4678,12 +4678,12 @@ value LineIntegral_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(LineIntegral) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineIntegral_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LineIntegral_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LineIntegral_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LineIntegral_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, LineIntegral_fieldgradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, LineIntegral_hessian, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineIntegral_init, MORPHO_FN_MUTATES|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, LineIntegral_integrand, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, LineIntegral_total, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, LineIntegral_gradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, LineIntegral_fieldgradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, LineIntegral_hessian, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -4786,11 +4786,11 @@ value AreaIntegral_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(AreaIntegral) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineIntegral_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, AreaIntegral_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, AreaIntegral_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, AreaIntegral_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, AreaIntegral_fieldgradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineIntegral_init, MORPHO_FN_MUTATES|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, AreaIntegral_integrand, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, AreaIntegral_total, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, AreaIntegral_gradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, AreaIntegral_fieldgradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ---------------------------------------------- @@ -4888,11 +4888,11 @@ value VolumeIntegral_fieldgradient(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(VolumeIntegral) -MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineIntegral_init, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, VolumeIntegral_integrand, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, VolumeIntegral_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, VolumeIntegral_gradient, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, VolumeIntegral_fieldgradient, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, LineIntegral_init, MORPHO_FN_MUTATES|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, VolumeIntegral_integrand, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, VolumeIntegral_total, MORPHO_FN_REENTRANT|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, VolumeIntegral_gradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, VolumeIntegral_fieldgradient, MORPHO_FN_REENTRANT|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS|MORPHO_FN_MULTITHREADED) MORPHO_ENDCLASS /* ********************************************************************** @@ -4951,10 +4951,10 @@ void functional_initialize(void) { builtin_addclass(NEMATIC_CLASSNAME, MORPHO_GETCLASSDEFINITION(Nematic), objclass); builtin_addclass(NEMATICELECTRIC_CLASSNAME, MORPHO_GETCLASSDEFINITION(NematicElectric), objclass); - builtin_addfunction(TANGENT_FUNCTION, integral_tangent, BUILTIN_FLAGSEMPTY); - builtin_addfunction(NORMAL_FUNCTION, integral_normal, BUILTIN_FLAGSEMPTY); - builtin_addfunction(GRAD_FUNCTION, integral_gradfn, BUILTIN_FLAGSEMPTY); - builtin_addfunction(CGTENSOR_FUNCTION, integral_cgfn, BUILTIN_FLAGSEMPTY); + builtin_addfunction(TANGENT_FUNCTION, integral_tangent, MORPHO_FN_THREADLOCAL | MORPHO_FN_ALLOCATES | MORPHO_FN_THROWS); + builtin_addfunction(NORMAL_FUNCTION, integral_normal, MORPHO_FN_THREADLOCAL | MORPHO_FN_ALLOCATES | MORPHO_FN_THROWS); + builtin_addfunction(GRAD_FUNCTION, integral_gradfn, MORPHO_FN_THREADLOCAL | MORPHO_FN_ALLOCATES | MORPHO_FN_THROWS); + builtin_addfunction(CGTENSOR_FUNCTION, integral_cgfn, MORPHO_FN_THREADLOCAL | MORPHO_FN_ALLOCATES | MORPHO_FN_THROWS); morpho_defineerror(VOLUMEENCLOSED_ZERO, ERROR_HALT, VOLUMEENCLOSED_ZERO_MSG); morpho_defineerror(FUNC_INTEGRAND_MESH, ERROR_HALT, FUNC_INTEGRAND_MESH_MSG); diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 7afb6ad8c..d17d6178b 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -1289,20 +1289,20 @@ value Mesh_clone(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(Mesh) -MORPHO_METHOD(MORPHO_PRINT_METHOD, Mesh_print, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_SAVE_METHOD, Mesh_save, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_VERTEXMATRIX_METHOD, Mesh_vertexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_SETVERTEXMATRIX_METHOD, Mesh_setvertexmatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_VERTEXPOSITION_METHOD, Mesh_vertexposition, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_SETVERTEXPOSITION_METHOD, Mesh_setvertexposition, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_RESETCONNECTIVITY_METHOD, Mesh_resetconnectivity, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_CONNECTIVITYMATRIX_METHOD, Mesh_connectivitymatrix, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_ADDGRADE_METHOD, Mesh_addgrade, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_REMOVEGRADE_METHOD, Mesh_removegrade, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_ADDSYMMETRY_METHOD, Mesh_addsymmetry, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MESH_MAXGRADE_METHOD, Mesh_maxgrade, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_COUNT_METHOD, Mesh_count, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(MORPHO_CLONE_METHOD, Mesh_clone, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(MORPHO_PRINT_METHOD, Mesh_print, MORPHO_FN_IO), +MORPHO_METHOD(MORPHO_SAVE_METHOD, Mesh_save, MORPHO_FN_IO), +MORPHO_METHOD(MESH_VERTEXMATRIX_METHOD, Mesh_vertexmatrix, MORPHO_FN_PUREFN), +MORPHO_METHOD(MESH_SETVERTEXMATRIX_METHOD, Mesh_setvertexmatrix, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_VERTEXPOSITION_METHOD, Mesh_vertexposition, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_SETVERTEXPOSITION_METHOD, Mesh_setvertexposition, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_RESETCONNECTIVITY_METHOD, Mesh_resetconnectivity, MORPHO_FN_MUTATES), +MORPHO_METHOD(MESH_CONNECTIVITYMATRIX_METHOD, Mesh_connectivitymatrix, MORPHO_FN_MUTATES|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_ADDGRADE_METHOD, Mesh_addgrade, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_REMOVEGRADE_METHOD, Mesh_removegrade, MORPHO_FN_MUTATES|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_ADDSYMMETRY_METHOD, Mesh_addsymmetry, MORPHO_FN_MUTATES|MORPHO_FN_REENTRANT|MORPHO_FN_THROWS), +MORPHO_METHOD(MESH_MAXGRADE_METHOD, Mesh_maxgrade, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_COUNT_METHOD, Mesh_count, MORPHO_FN_PUREFN), +MORPHO_METHOD(MORPHO_CLONE_METHOD, Mesh_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES|MORPHO_FN_THROWS) MORPHO_ENDCLASS /* ********************************************************************** @@ -1316,7 +1316,7 @@ void mesh_initialize(void) { for (unsigned int i=0; i Date: Mon, 11 May 2026 22:27:20 -0400 Subject: [PATCH 405/473] Fix issue with name ownership --- src/builtin/builtin.c | 22 ++++++++++--- .../class_constructor_from_global.morpho | 31 +++++++++++++++++++ test/self/polymorphic_self_dispatch.morpho | 18 +++++++++++ 3 files changed, 67 insertions(+), 4 deletions(-) create mode 100644 test/class/class_constructor_from_global.morpho create mode 100644 test/self/polymorphic_self_dispatch.morpho diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index d2f1047e6..7e6337135 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -54,7 +54,7 @@ void builtin_init(objectbuiltinfunction *func) { /** Clear an objectbuiltinfunction */ void builtin_clear(objectbuiltinfunction *func) { - morpho_freeobject(func->name); + if (MORPHO_ISOBJECT(func->name)) object_freeifunmanaged(MORPHO_GETOBJECT(func->name)); signature_clear(&func->sig); } @@ -287,10 +287,16 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built new->flags=flags; new->name=object_stringfromcstring(name, strlen(name)); - if (!name) goto morpho_addfunction_cleanup; + if (!new->name) goto morpho_addfunction_cleanup; // Parse function signature if provided if (signature) builtin_addparsesignature(signature, &new->sig); + + value selector = dictionary_intern(&builtin_symboltable, new->name); + if (MORPHO_ISNIL(selector)) goto morpho_addfunction_cleanup; + if (!MORPHO_ISSAME(selector, new->name)) morpho_freeobject(new->name); + new->name=selector; + builtin_bindobject(MORPHO_GETOBJECT(selector)); value newfn = MORPHO_OBJECT(new); @@ -306,7 +312,6 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built morpho_addfunction_cleanup: if (new) { - builtin_clear(new); object_free((object *) new); } @@ -362,10 +367,19 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * newmethod->function=desc[i].function; newmethod->klass=new; newmethod->name=object_stringfromcstring(desc[i].name, strlen(desc[i].name)); + if (!newmethod->name) { success=false; break; } newmethod->flags=desc[i].flags; if (desc[i].signature) builtin_addparsesignature(desc[i].signature, &newmethod->sig); - dictionary_intern(&builtin_symboltable, newmethod->name); + value selector = dictionary_intern(&builtin_symboltable, newmethod->name); + if (MORPHO_ISNIL(selector)) { + object_free((object *) newmethod); + success=false; + break; + } + if (!MORPHO_ISSAME(selector, newmethod->name)) morpho_freeobject(newmethod->name); + newmethod->name=selector; + builtin_bindobject(MORPHO_GETOBJECT(selector)); value method = MORPHO_OBJECT(newmethod); builtin_bindobject((object *) newmethod); diff --git a/test/class/class_constructor_from_global.morpho b/test/class/class_constructor_from_global.morpho new file mode 100644 index 000000000..00cfc92dc --- /dev/null +++ b/test/class/class_constructor_from_global.morpho @@ -0,0 +1,31 @@ +import bytecodeoptimizer + +class MiniSphere { + init(vertices, indx) { + var n = indx.count()-1 + var b = Matrix(n) + self.n = n + self.b = b + } +} + +class Repro { + init(pts) { + self.pts = pts + } + + run() { + var extel = List(0, 1) + extel.append(2) + return MiniSphere(self.pts, extel) + } +} + +var pts = [ + Matrix([0, 0]), + Matrix([1, 0]), + Matrix([0, 1]), + Matrix([2, 2]) +] + +print Repro(pts).run() // expect: diff --git a/test/self/polymorphic_self_dispatch.morpho b/test/self/polymorphic_self_dispatch.morpho new file mode 100644 index 000000000..3ca9da05e --- /dev/null +++ b/test/self/polymorphic_self_dispatch.morpho @@ -0,0 +1,18 @@ +import bytecodeoptimizer + +class Base { + run() { return self.step() } + step() { return 0 } +} + +class WithField is Base { + init(f) { self.func = f } + step() { return self.func(1) } +} + +class Plain is Base { + step() { return 7 } +} + +print WithField(fn (x) x+1).run() // expect: 2 +print Plain().run() // expect: 7 From 6c3dbcf9d0a3d8c38d17f2c16f747c8e9708fce9 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Wed, 13 May 2026 09:31:25 +0100 Subject: [PATCH 406/473] Add missing selectors --- src/morpho.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/morpho.h b/src/morpho.h index f3c50c75b..0f63fc0a2 100644 --- a/src/morpho.h +++ b/src/morpho.h @@ -82,9 +82,15 @@ extern value initselector; extern value indexselector; extern value setindexselector; extern value addselector; +extern value addrselector; extern value subselector; +extern value subrselector; extern value mulselector; +extern value mulrselector; extern value divselector; +extern value divrselector; +extern value powselector; +extern value powrselector; extern value printselector; extern value enumerateselector; extern value countselector; From 68226d9cefc4d53b1b51dd562051100156a00d31 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 21:12:22 +0200 Subject: [PATCH 407/473] CG3 on a 1D element --- src/geometry/fespace.c | 40 +++++++++++++++++-- .../discretizations/cg3/cg3_area_in_2d.morpho | 6 +-- .../discretizations/cg3/cg3_line_in_1d.morpho | 2 - .../cg3/cg3_line_in_1d_reversed.morpho | 31 ++++++++++++++ 4 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 40bb4e592..75b52a162 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -626,13 +626,32 @@ fespace *fespace_findlinear(grade g) { #define FETCH(instr) (*(instr++)) +typedef struct { + elementid id; + bool reversed; +} fespacesubelement; + +/** Remaps an edge-local quantity index if the matched line orientation is reversed. */ +static int fespace_orientedquantity(fespace *disc, grade g, fespacesubelement *subel, int sid, int indx) { + if (g!=MESH_GRADE_LINE || !subel[sid].reversed) return indx; + + fespace *lower; + if (!fespace_lower(disc, g, &lower)) return indx; + + int nedgeq = lower->shape[MESH_GRADE_LINE]; + if (indx<0 || indx>=nedgeq) return indx; + + return nedgeq-indx-1; +} + /** Steps through an element definition, generating subelements and identifying quantities */ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids, fieldindx *findx) { - elementid subel[disc->nsubel+1]; // Element IDs of sub elements + fespacesubelement subel[disc->nsubel+1]; // Element IDs and orientation of subelements int sid, svids[nv], nmatch, k=0; objectsparse *vmatrix[disc->grade+1]; // Vertex->elementid connectivity matrices for (grade g=0; g<=disc->grade; g++) vmatrix[g]=mesh_addconnectivityelement(field->mesh, g, 0); + objectsparse *lineconn = mesh_getconnectivityelement(field->mesh, 0, MESH_GRADE_LINE); for (eldefninstruction *instr=disc->eldefn; instr!=NULL && *instr!=ENDDEFN; ) { eldefninstruction op=FETCH(instr); @@ -643,15 +662,28 @@ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids sid = FETCH(instr); for (int i=0; i<=op; i++) svids[i] = vids[FETCH(instr)]; - if (!mesh_matchelements(vmatrix[1], op, op+1, svids, 1, &nmatch, &subel[sid])) return false; + if (!mesh_matchelements(vmatrix[1], op, op+1, svids, 1, &nmatch, &subel[sid].id)) return false; + + subel[sid].reversed=false; + if (op==LINE_OPCODE) { + int nlinev, *linevids; + if (!lineconn || !mesh_getconnectivity(lineconn, subel[sid].id, &nlinev, &linevids)) return false; + if (nlinev!=2) return false; + + if (linevids[0]==svids[1] && linevids[1]==svids[0]) { + subel[sid].reversed=true; + } else if (!(linevids[0]==svids[0] && linevids[1]==svids[1])) { + return false; + } + } } break; case QUANTITY_OPCODE: { findx[k].g=FETCH(instr); int sid=FETCH(instr); - findx[k].id=(findx[k].g==0 ? vids[sid]: subel[sid]); - findx[k].indx=FETCH(instr); + findx[k].id=(findx[k].g==0 ? vids[sid]: subel[sid].id); + findx[k].indx=fespace_orientedquantity(disc, findx[k].g, subel, sid, FETCH(instr)); k++; } break; diff --git a/test/field/discretizations/cg3/cg3_area_in_2d.morpho b/test/field/discretizations/cg3/cg3_area_in_2d.morpho index c15c73be9..88e4d2214 100644 --- a/test/field/discretizations/cg3/cg3_area_in_2d.morpho +++ b/test/field/discretizations/cg3/cg3_area_in_2d.morpho @@ -16,7 +16,7 @@ var l = FiniteElementSpace("CG2", grade=2) var f = Field(m, fn (x,y) (x+y)^3, finiteelementspace=l) -print f.shape() // expect: [ 1, 1, 0 ] +//print f.shape() //: [ 1, 1, 0 ] -print abs(AreaIntegral(fn (x, phi) phi, f, method={ }).total(m)-4/9) < 1e-6 -// expect: true +//print abs(AreaIntegral(fn (x, phi) phi, f, method={ }).total(m)-4/9) < 1e-6 +//: true diff --git a/test/field/discretizations/cg3/cg3_line_in_1d.morpho b/test/field/discretizations/cg3/cg3_line_in_1d.morpho index e963804db..226df47e8 100644 --- a/test/field/discretizations/cg3/cg3_line_in_1d.morpho +++ b/test/field/discretizations/cg3/cg3_line_in_1d.morpho @@ -14,8 +14,6 @@ var l = FiniteElementSpace("CG3", grade=1) var f = Field(m, fn (x,y,z) x^3, finiteelementspace=l) -print f[2,1] - print l.layout(f) // expect: [ 1 0 ] // expect: [ 1 1 ] diff --git a/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho b/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho new file mode 100644 index 000000000..09190b011 --- /dev/null +++ b/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho @@ -0,0 +1,31 @@ +// CG3 FunctionSpace in one dimension with a reversed edge orientation +// Smoke test only: true edge reorientation is exercised in higher-dimensional parents. + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([0.5,0,0]) +mb.addvertex([1,0,0]) +mb.addedge([0,1]) +mb.addedge([2,1]) +var m = mb.build() + +var l = FiniteElementSpace("CG3", grade=1) + +var f = Field(m, fn (x,y,z) x^3, finiteelementspace=l) + +print l.layout(f) +// expect: [ 1 0 ] +// expect: [ 1 1 ] +// expect: [ 0 1 ] +// expect: [ 1 0 ] +// expect: [ 1 0 ] +// expect: [ 0 1 ] +// expect: [ 0 1 ] + +print f.shape() +// expect: [ 1, 2 ] + +print (LineIntegral(fn (x, u) u, f, method={ }).total(m) - 1/4) < 1e-10 +// expect: true From 4c998bc6efe9247f7629d49e747711103fcc4726 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 21:25:25 +0200 Subject: [PATCH 408/473] Additional test for triangle --- .../cg3/cg3_line_in_1d_reversed.morpho | 2 ++ .../cg3/cg3_line_in_1d_triangle.morpho | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho diff --git a/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho b/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho index 09190b011..767428de3 100644 --- a/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho +++ b/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho @@ -15,6 +15,8 @@ var l = FiniteElementSpace("CG3", grade=1) var f = Field(m, fn (x,y,z) x^3, finiteelementspace=l) +print f + print l.layout(f) // expect: [ 1 0 ] // expect: [ 1 1 ] diff --git a/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho b/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho new file mode 100644 index 000000000..fe229c8eb --- /dev/null +++ b/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho @@ -0,0 +1,32 @@ +// CG3 FunctionSpace in one dimension on a triangle + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addedge([0,1]) +mb.addedge([1,2]) +mb.addedge([2,0]) +var m = mb.build() + +var l = FiniteElementSpace("CG3", grade=1) + +var f = Field(m, fn (x,y,z) x^3 + y^3, finiteelementspace=l) + +print l.layout(f) +// expect: [ 1 0 ] +// expect: [ 1 1 ] +// expect: [ 0 1 ] +// expect: [ 1 0 ] +// expect: [ 1 0 ] +// expect: [ 0 1 ] +// expect: [ 0 1 ] + +print f.shape() +// expect: [ 1, 2 ] + +var a = 1/2 + 1/sqrt(2) +print abs(LineIntegral(fn (x, u) u, f, method={ }).total(m) - a) < 1e-10 +// expect: true From 6670cbe82b8c941215f3e3aea74c5da55bcd4ed9 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 21:50:24 +0200 Subject: [PATCH 409/473] CG3 on triangles --- src/geometry/fespace.c | 6 +-- .../discretizations/cg3/cg3_area_in_2d.morpho | 15 +++--- .../cg3/cg3_area_in_2d_reversed_edge.morpho | 47 +++++++++++++++++++ .../cg3/cg3_line_in_1d_reversed.morpho | 2 - .../cg3/cg3_line_in_1d_triangle.morpho | 16 ++++--- 5 files changed, 67 insertions(+), 19 deletions(-) create mode 100644 test/field/discretizations/cg3/cg3_area_in_2d_reversed_edge.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 75b52a162..4fa19edd4 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -395,7 +395,7 @@ eldefninstruction cg3_2deldefn[] = { LINE(0,0,1), // Identify line subelement with vertex indices (0,1) LINE(1,1,2), // Identify line subelement with vertex indices (1,2) LINE(2,2,0), // Identify line subelement with vertex indices (2,0) - AREA(0,0,1,2), // Identify area subelement with vertex indices (0,1,2) + AREA(3,0,1,2), // Identify area subelement with vertex indices (0,1,2) QUANTITY(0,0,0), // Fetch quantity on vertex 0 QUANTITY(0,1,0), // Fetch quantity on vertex 1 QUANTITY(0,2,0), // Fetch quantity on vertex 2 @@ -405,7 +405,7 @@ eldefninstruction cg3_2deldefn[] = { QUANTITY(1,1,1), // Fetch quantity 1 from line 1 QUANTITY(1,2,0), // Fetch quantity 0 from line 2 QUANTITY(1,2,1), // Fetch quantity 1 from line 2 - QUANTITY(2,0,0), // Fetch quantity 0 from area 0 + QUANTITY(2,3,0), // Fetch quantity 0 from area 0 ENDDEFN }; @@ -662,7 +662,7 @@ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids sid = FETCH(instr); for (int i=0; i<=op; i++) svids[i] = vids[FETCH(instr)]; - if (!mesh_matchelements(vmatrix[1], op, op+1, svids, 1, &nmatch, &subel[sid].id)) return false; + if (!mesh_matchelements(vmatrix[op], op, op+1, svids, 1, &nmatch, &subel[sid].id)) return false; subel[sid].reversed=false; if (op==LINE_OPCODE) { diff --git a/test/field/discretizations/cg3/cg3_area_in_2d.morpho b/test/field/discretizations/cg3/cg3_area_in_2d.morpho index 88e4d2214..5fd4c0626 100644 --- a/test/field/discretizations/cg3/cg3_area_in_2d.morpho +++ b/test/field/discretizations/cg3/cg3_area_in_2d.morpho @@ -1,8 +1,8 @@ -// CG2 FunctionSpace in two dimensions +// CG3 FunctionSpace in two dimensions -import meshtools +import meshtools -var mb = MeshBuilder() +var mb = MeshBuilder() mb.addvertex([0,0]) mb.addvertex([1,0]) mb.addvertex([0,1]) @@ -12,11 +12,12 @@ mb.addface([1,3,2]) var m = mb.build() m.addgrade(1) -var l = FiniteElementSpace("CG2", grade=2) +var l = FiniteElementSpace("CG3", grade=2) var f = Field(m, fn (x,y) (x+y)^3, finiteelementspace=l) -//print f.shape() //: [ 1, 1, 0 ] +print f.shape() +// expect: [ 1, 2, 1 ] -//print abs(AreaIntegral(fn (x, phi) phi, f, method={ }).total(m)-4/9) < 1e-6 -//: true +print abs(AreaIntegral(fn (x, phi) phi, f, method={ }).total(m)-3/2) < 1e-6 +// expect: true diff --git a/test/field/discretizations/cg3/cg3_area_in_2d_reversed_edge.morpho b/test/field/discretizations/cg3/cg3_area_in_2d_reversed_edge.morpho new file mode 100644 index 000000000..5deb1e9be --- /dev/null +++ b/test/field/discretizations/cg3/cg3_area_in_2d_reversed_edge.morpho @@ -0,0 +1,47 @@ +// CG3 FunctionSpace in two dimensions with a shared edge used in opposite local orientations + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addvertex([1,1]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) +var m = mb.build() +m.addgrade(1) + +var l = FiniteElementSpace("CG3", grade=2) + +var f = Field(m, fn (x,y) x^3, finiteelementspace=l) + +print l.layout(f) +// expect: [ 1 0 ] +// expect: [ 1 1 ] +// expect: [ 1 1 ] +// expect: [ 0 1 ] +// expect: [ 1 0 ] +// expect: [ 1 0 ] +// expect: [ 1 0 ] +// expect: [ 1 0 ] +// expect: [ 1 1 ] +// expect: [ 1 1 ] +// expect: [ 0 1 ] +// expect: [ 0 1 ] +// expect: [ 0 1 ] +// expect: [ 0 1 ] +// expect: [ 1 0 ] +// expect: [ 0 1 ] + +print f.shape() +// expect: [ 1, 2, 1 ] + +// Shared edge is edge 2; these two values distinguish the edge orientation. +print abs(f[1,2,0]-8/27) < 1e-10 +// expect: true +print abs(f[1,2,1]-1/27) < 1e-10 +// expect: true + +print abs(AreaIntegral(fn (x, phi) phi, f, method={ }).total(m)-1/4) < 1e-6 +// expect: true diff --git a/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho b/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho index 767428de3..09190b011 100644 --- a/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho +++ b/test/field/discretizations/cg3/cg3_line_in_1d_reversed.morpho @@ -15,8 +15,6 @@ var l = FiniteElementSpace("CG3", grade=1) var f = Field(m, fn (x,y,z) x^3, finiteelementspace=l) -print f - print l.layout(f) // expect: [ 1 0 ] // expect: [ 1 1 ] diff --git a/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho b/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho index fe229c8eb..6f8c620eb 100644 --- a/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho +++ b/test/field/discretizations/cg3/cg3_line_in_1d_triangle.morpho @@ -16,13 +16,15 @@ var l = FiniteElementSpace("CG3", grade=1) var f = Field(m, fn (x,y,z) x^3 + y^3, finiteelementspace=l) print l.layout(f) -// expect: [ 1 0 ] -// expect: [ 1 1 ] -// expect: [ 0 1 ] -// expect: [ 1 0 ] -// expect: [ 1 0 ] -// expect: [ 0 1 ] -// expect: [ 0 1 ] +// expect: [ 1 0 1 ] +// expect: [ 1 1 0 ] +// expect: [ 0 1 1 ] +// expect: [ 1 0 0 ] +// expect: [ 1 0 0 ] +// expect: [ 0 1 0 ] +// expect: [ 0 1 0 ] +// expect: [ 0 0 1 ] +// expect: [ 0 0 1 ] print f.shape() // expect: [ 1, 2 ] From 915c3fba7cdce74c2ae6f38d23e7e38865182db1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 22:00:59 +0200 Subject: [PATCH 410/473] CG3 gradients --- src/geometry/fespace.c | 2 +- .../cg3/cg3_area_in_2d_grad.morpho | 24 +++++++++++++++++++ .../cg3/cg3_line_in_2d_grad.morpho | 17 +++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 test/field/discretizations/cg3/cg3_area_in_2d_grad.morpho create mode 100644 test/field/discretizations/cg3/cg3_line_in_2d_grad.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 4fa19edd4..b2361bed0 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -358,7 +358,7 @@ void cg3_2dgrad(double *lambda, double *grad) { // Gij = d Xi[i] / d lambda[j] in col. major order double g[] = { 1.0 + 4.5*lambda[0]*(3*lambda[0]-2), 0, 0, - 4.5*lambda[1]*(6*lambda[0]-1), 4.5*lambda[1]*(3*lambda[0]-1), + 4.5*lambda[1]*(6*lambda[0]-1), 4.5*lambda[1]*(3*lambda[1]-1), 0, 0, 4.5*lambda[2]*(3*lambda[2]-1), 4.5*lambda[2]*(6*lambda[0]-1), 27*lambda[1]*lambda[2], diff --git a/test/field/discretizations/cg3/cg3_area_in_2d_grad.morpho b/test/field/discretizations/cg3/cg3_area_in_2d_grad.morpho new file mode 100644 index 000000000..247770ef3 --- /dev/null +++ b/test/field/discretizations/cg3/cg3_area_in_2d_grad.morpho @@ -0,0 +1,24 @@ +// Compute the gradient of a CG3 quantity on triangles in 2D + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addvertex([1,1]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) +var m = mb.build() +m.addgrade(1) + +var l = FiniteElementSpace("CG3", grade=2) + +fn integrand(x, q) { + var g = grad(q) + return g.norm()^2 +} + +var f = Field(m, fn (x,y) x^3 + y^3, finiteelementspace=l) +print abs(AreaIntegral(integrand, f, method={ }).total(m) - 18/5) < 1e-8 +// expect: true diff --git a/test/field/discretizations/cg3/cg3_line_in_2d_grad.morpho b/test/field/discretizations/cg3/cg3_line_in_2d_grad.morpho new file mode 100644 index 000000000..b88847278 --- /dev/null +++ b/test/field/discretizations/cg3/cg3_line_in_2d_grad.morpho @@ -0,0 +1,17 @@ +// Compute the gradient of a CG3 quantity on a line in 2D + +import meshtools + +var m = LineMesh(fn (t) [t,t], 0..1:0.5) + +var l = FiniteElementSpace("CG3", grade=1) + +var f = Field(m, fn (x,y) x^3+y^3, finiteelementspace=l) + +fn integrand(x, u) { + var g = grad(u) + return g.norm()^2 +} + +print abs(LineIntegral(integrand, f, method={ }).total(m) - 18*sqrt(2)/5) < 1e-8 +// expect: true From c827fa72bfa307b54625225fad08e174b26d5d77 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 22:42:17 +0200 Subject: [PATCH 411/473] CG3 in 3D! --- src/geometry/fespace.c | 156 +++++++++++++++++- src/geometry/field.c | 5 + .../discretizations/cg3/cg3_vol_in_3d.morpho | 29 ++++ .../cg3/cg3_vol_in_3d_grad.morpho | 27 +++ 4 files changed, 216 insertions(+), 1 deletion(-) create mode 100644 test/field/discretizations/cg3/cg3_vol_in_3d.morpho create mode 100644 test/field/discretizations/cg3/cg3_vol_in_3d_grad.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index b2361bed0..3e93efb92 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -587,6 +587,153 @@ fespace cg2_3d = { .lower = cg2_3d_lower }; +/* ------------------------------------------------------- + * CG3 element in 3D + * ------------------------------------------------------- */ + +/* z = 0 layer: z = 1/3 layer: z = 2/3 layer: z = 1 layer: + * + * 2 14 + * | \ . . + * 9 7 . . 15 + * | \ 19 18 . . + * 8 16 6 . . . . + * | \ . . . . + * 0--4--5--1 10..17..12 11...13 3 + */ + +void cg3_3dinterpolate(double *lambda, double *wts) { + int k=0; + int edges[6][2] = { {0,1}, {1,2}, {2,0}, {0,3}, {1,3}, {2,3} }; + int faces[4][3] = { {0,1,2}, {0,3,1}, {1,3,2}, {2,3,0} }; + + for (int i=0; i<4; i++) { + wts[k++]=0.5*lambda[i]*(3*lambda[i]-1)*(3*lambda[i]-2); + } + + for (int i=0; i<6; i++) { + int a=edges[i][0], b=edges[i][1]; + wts[k++]=4.5*lambda[a]*lambda[b]*(3*lambda[a]-1); + wts[k++]=4.5*lambda[a]*lambda[b]*(3*lambda[b]-1); + } + + for (int i=0; i<4; i++) { + int a=faces[i][0], b=faces[i][1], c=faces[i][2]; + wts[k++]=27.0*lambda[a]*lambda[b]*lambda[c]; + } +} + +void cg3_3dgrad(double *lambda, double *grad) { + int edges[6][2] = { {0,1}, {1,2}, {2,0}, {0,3}, {1,3}, {2,3} }; + int faces[4][3] = { {0,1,2}, {0,3,1}, {1,3,2}, {2,3,0} }; + + memset(grad, 0, sizeof(double)*20*4); + + for (int j=0; j<4; j++) { + grad[j*20+j]=13.5*lambda[j]*lambda[j]-9.0*lambda[j]+1.0; + } + + int k=4; + for (int i=0; i<6; i++) { + int a=edges[i][0], b=edges[i][1]; + + grad[a*20+k]=4.5*lambda[b]*(6*lambda[a]-1); + grad[b*20+k]=4.5*lambda[a]*(3*lambda[a]-1); + k++; + + grad[a*20+k]=4.5*lambda[b]*(3*lambda[b]-1); + grad[b*20+k]=4.5*lambda[a]*(6*lambda[b]-1); + k++; + } + + for (int i=0; i<4; i++) { + int a=faces[i][0], b=faces[i][1], c=faces[i][2]; + grad[a*20+k]=27.0*lambda[b]*lambda[c]; + grad[b*20+k]=27.0*lambda[a]*lambda[c]; + grad[c*20+k]=27.0*lambda[a]*lambda[b]; + k++; + } +} + +unsigned int cg3_3dshape[] = { 1, 2, 1, 0 }; + +double cg3_3dnodes[] = { + 0.0, 0.0, 0.0, + 1.0, 0.0, 0.0, + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0, + 1.0/3.0, 0.0, 0.0, + 2.0/3.0, 0.0, 0.0, + 2.0/3.0, 1.0/3.0, 0.0, + 1.0/3.0, 2.0/3.0, 0.0, + 0.0, 2.0/3.0, 0.0, + 0.0, 1.0/3.0, 0.0, + 0.0, 0.0, 1.0/3.0, + 0.0, 0.0, 2.0/3.0, + 2.0/3.0, 0.0, 1.0/3.0, + 1.0/3.0, 0.0, 2.0/3.0, + 0.0, 2.0/3.0, 1.0/3.0, + 0.0, 1.0/3.0, 2.0/3.0, + 1.0/3.0, 1.0/3.0, 0.0, + 1.0/3.0, 0.0, 1.0/3.0, + 1.0/3.0, 1.0/3.0, 1.0/3.0, + 0.0, 1.0/3.0, 1.0/3.0 +}; + +eldefninstruction cg3_3deldefn[] = { + LINE(0,0,1), // Identify line subelement with vertex indices (0,1) + LINE(1,1,2), // Identify line subelement with vertex indices (1,2) + LINE(2,2,0), // Identify line subelement with vertex indices (2,0) + LINE(3,0,3), // Identify line subelement with vertex indices (0,3) + LINE(4,1,3), // Identify line subelement with vertex indices (1,3) + LINE(5,2,3), // Identify line subelement with vertex indices (2,3) + AREA(6,0,1,2), // Identify area subelement with vertex indices (0,1,2) + AREA(7,0,3,1), // Identify area subelement with vertex indices (0,3,1) + AREA(8,1,3,2), // Identify area subelement with vertex indices (1,3,2) + AREA(9,2,3,0), // Identify area subelement with vertex indices (2,3,0) + QUANTITY(0,0,0), // Fetch quantity on vertex 0 + QUANTITY(0,1,0), // Fetch quantity on vertex 1 + QUANTITY(0,2,0), // Fetch quantity on vertex 2 + QUANTITY(0,3,0), // Fetch quantity on vertex 3 + QUANTITY(1,0,0), // Fetch quantity 0 from line 0 + QUANTITY(1,0,1), // Fetch quantity 1 from line 0 + QUANTITY(1,1,0), // Fetch quantity 0 from line 1 + QUANTITY(1,1,1), // Fetch quantity 1 from line 1 + QUANTITY(1,2,0), // Fetch quantity 0 from line 2 + QUANTITY(1,2,1), // Fetch quantity 1 from line 2 + QUANTITY(1,3,0), // Fetch quantity 0 from line 3 + QUANTITY(1,3,1), // Fetch quantity 1 from line 3 + QUANTITY(1,4,0), // Fetch quantity 0 from line 4 + QUANTITY(1,4,1), // Fetch quantity 1 from line 4 + QUANTITY(1,5,0), // Fetch quantity 0 from line 5 + QUANTITY(1,5,1), // Fetch quantity 1 from line 5 + QUANTITY(2,6,0), // Fetch quantity 0 from area 0 + QUANTITY(2,7,0), // Fetch quantity 0 from area 1 + QUANTITY(2,8,0), // Fetch quantity 0 from area 2 + QUANTITY(2,9,0), // Fetch quantity 0 from area 3 + ENDDEFN +}; + +fespace *cg3_3d_lower[] = { + &cg3_2d, + &cg3_1d, + NULL +}; + +fespace cg3_3d = { + .name = "CG3", + .grade = 3, + .shape = cg3_3dshape, + .degree = 3, + .nnodes = 20, + .nsubel = 10, + .nodes = cg3_3dnodes, + .ifn = cg3_3dinterpolate, + .gfn = cg3_3dgrad, + .eldefn = cg3_3deldefn, + .lower = cg3_3d_lower +}; + /* ------------------------------------------------------- * List of finite elements * ------------------------------------------------------- */ @@ -600,6 +747,7 @@ fespace *fespaces[] = { &cg3_2d, &cg1_3d, &cg2_3d, + &cg3_3d, NULL }; @@ -650,7 +798,13 @@ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids int sid, svids[nv], nmatch, k=0; objectsparse *vmatrix[disc->grade+1]; // Vertex->elementid connectivity matrices - for (grade g=0; g<=disc->grade; g++) vmatrix[g]=mesh_addconnectivityelement(field->mesh, g, 0); + for (grade g=0; g<=disc->grade; g++) { + vmatrix[g]=mesh_addconnectivityelement(field->mesh, g, 0); + if (!vmatrix[g] && g>0 && disc->shape[g]>0) { + mesh_addgrade(field->mesh, g); + vmatrix[g]=mesh_addconnectivityelement(field->mesh, g, 0); + } + } objectsparse *lineconn = mesh_getconnectivityelement(field->mesh, 0, MESH_GRADE_LINE); for (eldefninstruction *instr=disc->eldefn; instr!=NULL && *instr!=ENDDEFN; ) { diff --git a/src/geometry/field.c b/src/geometry/field.c index e59316488..211d0f375 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -114,6 +114,11 @@ objectfield *object_newfield(objectmesh *mesh, value prototype, value fnspc, uns unsigned int dof[ngrades]; // Extract shape from fespace or the provided function space if (MORPHO_ISFESPACE(fnspc)) { fespace *disc = MORPHO_GETFESPACE(fnspc)->fespace; + for (grade g=1; g<=disc->grade; g++) { + if (disc->shape[g]>0 && !mesh_getconnectivityelement(mesh, 0, g)) { + mesh_addgrade(mesh, g); + } + } for (int i=0; i<=disc->grade; i++) dof[i]=disc->shape[i]; for (int i=disc->grade+1; i Date: Fri, 15 May 2026 22:45:15 +0200 Subject: [PATCH 412/473] Create cg3_vol_in_3d_stress.morpho --- .../cg3/cg3_vol_in_3d_stress.morpho | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/field/discretizations/cg3/cg3_vol_in_3d_stress.morpho diff --git a/test/field/discretizations/cg3/cg3_vol_in_3d_stress.morpho b/test/field/discretizations/cg3/cg3_vol_in_3d_stress.morpho new file mode 100644 index 000000000..cd07b005a --- /dev/null +++ b/test/field/discretizations/cg3/cg3_vol_in_3d_stress.morpho @@ -0,0 +1,26 @@ +// CG3 stress test in three dimensions: +// one function should be represented exactly, one should not. + +import meshtools + +var cube = [ [0,0,0], [1,0,0], [0,1,0], [1,1,0], + [0,0,1], [1,0,1], [0,1,1], [1,1,1] ] + +var pts = [] +for (x in cube) pts.append(Matrix(x)) + +var m = DelaunayMesh(pts) +m.addgrade(1) + +var fe = FiniteElementSpace("CG3", grade=3) + +// Exact: cubic polynomial +var exact = Field(m, fn (x,y,z) x^3 + y^2*z, finiteelementspace=fe) +print abs(VolumeIntegral(fn (x, q) q, exact, method={}).total(m) - (1/4 + 1/6)) < 1e-8 +// expect: true + +// Inexact: quartic polynomial +var inexact = Field(m, fn (x,y,z) x^4 + y^4 + z^4, finiteelementspace=fe) +print abs(VolumeIntegral(fn (x, q) q, inexact, method={}).total(m) - 3/5) > 1e-8 +// expect: true + From 0017c72d48747e981316cfbf21af0381a0e1fb8a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 22:58:47 +0200 Subject: [PATCH 413/473] Hessians for CG2 and CG3 --- src/geometry/fespace.c | 73 ++++++++++++++++++++++++++++++++++++++++++ src/geometry/fespace.h | 5 +++ 2 files changed, 78 insertions(+) diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 3e93efb92..475acbfc2 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -287,6 +287,17 @@ void cg2_2dgrad(double *lambda, double *grad) { memcpy(grad, g, sizeof(g)); } +void cg2_2dhess(double *lambda, double *hess) { + // Hijq = d^2 Xi[i] / d x[j] d x[q] in column-major order + double h[] = { + 4, 4, 0, -8, 0, 0, + 4, 0, 0, -4, 4, -4, + 4, 0, 0, -4, 4, -4, + 4, 0, 4, 0, 0, -8 + }; + memcpy(hess, h, sizeof(h)); +} + unsigned int cg2_2dshape[] = { 1, 1, 0 }; double cg2_2dnodes[] = { 0.0, 0.0, @@ -324,6 +335,7 @@ fespace cg2_2d = { .nodes = cg2_2dnodes, .ifn = cg2_2dinterpolate, .gfn = cg2_2dgrad, + .hfn = cg2_2dhess, .eldefn = cg2_2deldefn, .lower = cg2_2d_lower }; @@ -378,6 +390,56 @@ void cg3_2dgrad(double *lambda, double *grad) { memcpy(grad, g, sizeof(g)); } +void cg3_2dhess(double *lambda, double *hess) { + double x = lambda[1]; + double y = lambda[2]; + + // Hijq = d^2 Xi[i] / d x[j] d x[q] in column-major order + hess[0*10+0] = 27*x + 27*y - 18; + hess[1*10+0] = 27*x - 9; + hess[2*10+0] = 27*y - 9; + hess[3*10+0] = -81*x - 27*y + 36; + hess[4*10+0] = 54*x - 9; + hess[5*10+0] = 0; + hess[6*10+0] = 0; + hess[7*10+0] = 27*y; + hess[8*10+0] = -54*y + 27*x - 9; + hess[9*10+0] = -54*x - 54*y + 27; + + hess[0*10+1] = 27*x + 27*y - 18; + hess[1*10+1] = 0; + hess[2*10+1] = 0; + hess[3*10+1] = -27*(6*x + 3*y - 4.0/3.0); + hess[4*10+1] = 27*(2*x + y) - 9; + hess[5*10+1] = 27*y; + hess[6*10+1] = 27*y; + hess[7*10+1] = 27*x; + hess[8*10+1] = -27*(2*y - x + 1.0/3.0); + hess[9*10+1] = 27*(1 - 2*x - 2*y); + + hess[0*10+2] = 27*x + 27*y - 18; + hess[1*10+2] = 0; + hess[2*10+2] = 0; + hess[3*10+2] = -27*(6*x + 3*y - 4.0/3.0); + hess[4*10+2] = 27*(2*x + y) - 9; + hess[5*10+2] = 27*y; + hess[6*10+2] = 27*y; + hess[7*10+2] = 27*x; + hess[8*10+2] = -27*(2*y - x + 1.0/3.0); + hess[9*10+2] = 27*(1 - 2*x - 2*y); + + hess[0*10+3] = 27*x + 27*y - 18; + hess[1*10+3] = 0; + hess[2*10+3] = 27*y - 9; + hess[3*10+3] = -54*x; + hess[4*10+3] = 0; + hess[5*10+3] = 0; + hess[6*10+3] = 54*y - 9; + hess[7*10+3] = 27*x; + hess[8*10+3] = 27*x - 54*y + 36; + hess[9*10+3] = -54*x; +} + unsigned int cg3_2dshape[] = { 1, 2, 1 }; double cg3_2dnodes[] = { 0.0, 0.0, @@ -424,6 +486,7 @@ fespace cg3_2d = { .nodes = cg3_2dnodes, .ifn = cg3_2dinterpolate, .gfn = cg3_2dgrad, + .hfn = cg3_2dhess, .eldefn = cg3_2deldefn, .lower = cg3_2d_lower }; @@ -906,6 +969,16 @@ void fespace_gradient(fespace *disc, double *lambda, objectmatrix *grad) { } } +/** @brief Calculates the Hessian of the basis functions with respect to the reference coordinates. + * @param[in] disc - fespace to query + * @param[in] lambda - position in barycentric coordinates + * @param[out] hess - Hessian of basis functions with respect to reference coordinates + * (disc->nnodes x (disc->grade*disc->grade)) in column-major tensor order + */ +void fespace_hessian(fespace *disc, double *lambda, objectmatrix *hess) { + if (disc->hfn) (disc->hfn) (lambda, hess->elements); +} + /* ********************************************************************** * FunctionSpace class * ********************************************************************** */ diff --git a/src/geometry/fespace.h b/src/geometry/fespace.h index 062e29d49..c005d1ccf 100644 --- a/src/geometry/fespace.h +++ b/src/geometry/fespace.h @@ -16,6 +16,9 @@ /** @brief Interpolation functions are called to assign weights to the nodes given barycentric coordinates */ typedef void (*interpolationfn) (double *, double *); +/** @brief Hessian functions are called to assign second derivatives with respect to reference coordinates */ +typedef void (*hessianfn) (double *, double *); + /** @brief Element definitions comprise a sequence of instructions to map field degrees of freedom to local nodes */ typedef int eldefninstruction; @@ -30,6 +33,7 @@ typedef struct sfespace { double *nodes; /** Node positions */ interpolationfn ifn; /** Interpolation function; receives barycentric coordinates as input and returns weights per node */ interpolationfn gfn; /** Gradient interpolation function */ + hessianfn hfn; /** Hessian interpolation function in reference coordinates */ eldefninstruction *eldefn; /** Element definition */ struct sfespace **lower; /** Discretization to be used for interpolation on lower grades */ } fespace; @@ -83,6 +87,7 @@ bool fespace_lower(fespace *disc, grade target, fespace **out); bool fespace_layout(objectfield *field, fespace *disc, objectsparse **out); void fespace_gradient(fespace *disc, double *lambda, objectmatrix *grad); +void fespace_hessian(fespace *disc, double *lambda, objectmatrix *hess); void fespace_initialize(void); From 47bf6cf9842adb038ae8248d8e4bc0fb83a5aab4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 23:39:03 +0200 Subject: [PATCH 414/473] CG3 hessians --- src/geometry/fespace.c | 88 ++++----- src/geometry/functional.c | 168 +++++++++++++++++- src/geometry/functional.h | 1 + .../cg2/cg2_area_in_2d_hess.morpho | 27 +++ .../cg3/cg3_area_in_2d_hess.morpho | 28 +++ 5 files changed, 263 insertions(+), 49 deletions(-) create mode 100644 test/field/discretizations/cg2/cg2_area_in_2d_hess.morpho create mode 100644 test/field/discretizations/cg3/cg3_area_in_2d_hess.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 475acbfc2..f021df9d2 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -395,49 +395,51 @@ void cg3_2dhess(double *lambda, double *hess) { double y = lambda[2]; // Hijq = d^2 Xi[i] / d x[j] d x[q] in column-major order - hess[0*10+0] = 27*x + 27*y - 18; - hess[1*10+0] = 27*x - 9; - hess[2*10+0] = 27*y - 9; - hess[3*10+0] = -81*x - 27*y + 36; - hess[4*10+0] = 54*x - 9; - hess[5*10+0] = 0; - hess[6*10+0] = 0; - hess[7*10+0] = 27*y; - hess[8*10+0] = -54*y + 27*x - 9; - hess[9*10+0] = -54*x - 54*y + 27; - - hess[0*10+1] = 27*x + 27*y - 18; - hess[1*10+1] = 0; - hess[2*10+1] = 0; - hess[3*10+1] = -27*(6*x + 3*y - 4.0/3.0); - hess[4*10+1] = 27*(2*x + y) - 9; - hess[5*10+1] = 27*y; - hess[6*10+1] = 27*y; - hess[7*10+1] = 27*x; - hess[8*10+1] = -27*(2*y - x + 1.0/3.0); - hess[9*10+1] = 27*(1 - 2*x - 2*y); - - hess[0*10+2] = 27*x + 27*y - 18; - hess[1*10+2] = 0; - hess[2*10+2] = 0; - hess[3*10+2] = -27*(6*x + 3*y - 4.0/3.0); - hess[4*10+2] = 27*(2*x + y) - 9; - hess[5*10+2] = 27*y; - hess[6*10+2] = 27*y; - hess[7*10+2] = 27*x; - hess[8*10+2] = -27*(2*y - x + 1.0/3.0); - hess[9*10+2] = 27*(1 - 2*x - 2*y); - - hess[0*10+3] = 27*x + 27*y - 18; - hess[1*10+3] = 0; - hess[2*10+3] = 27*y - 9; - hess[3*10+3] = -54*x; - hess[4*10+3] = 0; - hess[5*10+3] = 0; - hess[6*10+3] = 54*y - 9; - hess[7*10+3] = 27*x; - hess[8*10+3] = 27*x - 54*y + 36; - hess[9*10+3] = -54*x; + #define H(c,n) hess[(c)*10+(n)] + H(0,0) = 18 - 27*x - 27*y; + H(0,1) = 27*x - 9; + H(0,2) = 0; + H(0,3) = -45 + 81*x + 54*y; + H(0,4) = 36 - 81*x - 27*y; + H(0,5) = 27*y; + H(0,6) = 0; + H(0,7) = 0; + H(0,8) = 27*y; + H(0,9) = -54*y; + + H(1,0) = 18 - 27*x - 27*y; + H(1,1) = 0; + H(1,2) = 0; + H(1,3) = -45.0/2 + 54*x + 27*y; + H(1,4) = 9.0/2 - 27*x; + H(1,5) = -9.0/2 + 27*x; + H(1,6) = -9.0/2 + 27*y; + H(1,7) = 9.0/2 - 27*y; + H(1,8) = -45.0/2 + 27*x + 54*y; + H(1,9) = 27 - 54*x - 54*y; + + H(2,0) = 18 - 27*x - 27*y; + H(2,1) = 0; + H(2,2) = 0; + H(2,3) = -45.0/2 + 54*x + 27*y; + H(2,4) = 9.0/2 - 27*x; + H(2,5) = -9.0/2 + 27*x; + H(2,6) = -9.0/2 + 27*y; + H(2,7) = 9.0/2 - 27*y; + H(2,8) = -45.0/2 + 27*x + 54*y; + H(2,9) = 27 - 54*x - 54*y; + + H(3,0) = 18 - 27*x - 27*y; + H(3,1) = 0; + H(3,2) = 27*y - 9; + H(3,3) = 27*x; + H(3,4) = 0; + H(3,5) = 0; + H(3,6) = 27*x; + H(3,7) = 36 - 27*x - 81*y; + H(3,8) = -45 + 54*x + 81*y; + H(3,9) = -54*x; + #undef H } unsigned int cg3_2dshape[] = { 1, 2, 1 }; diff --git a/src/geometry/functional.c b/src/geometry/functional.c index ab571011b..0323a8954 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -3947,6 +3947,7 @@ typedef struct { objectmatrix *invj; // Inverse jacobian for the element value *qgrad; // Gradients + value *qhess; // Hessians value *qinterpolated; // List of interpolated quantities (this allows us to identify operators on fields } objectintegralelementref; @@ -4128,6 +4129,20 @@ bool integral_gradalloc(int dim, value prototype, value *out) { return false; } +/** Allocate suitable storage for the hessian */ +bool integral_hessalloc(int dim, value prototype, value *out) { + if (MORPHO_ISNIL(prototype)) { // Scalar + objectmatrix *mhess=object_newmatrix(dim, dim, false); + if (mhess) *out = MORPHO_OBJECT(mhess); + return mhess; + } else if (MORPHO_ISMATRIX(prototype)) { + objectlist *mlst = object_newlist(0, NULL); + if (mlst) *out = MORPHO_OBJECT(mlst); + return mlst; + } else UNREACHABLE("Field type not supported in hess"); + return false; +} + /** Prepares the gradient sum to hold the component of the gradient */ bool integral_gradsuminit(int i, value prototype, value dest, value *sum) { if (MORPHO_ISLIST(dest)) { @@ -4154,6 +4169,32 @@ bool integral_gradsumcopy(int i, value sum, value dest) { } else return true; } +/** Prepares the hessian sum to hold a component of the hessian */ +bool integral_hesssuminit(int c, value prototype, value dest, value *sum) { + if (MORPHO_ISLIST(dest)) { + objectlist *lst = MORPHO_GETLIST(dest); + + if (c>=list_length(lst)) { + objectmatrix *prmat = MORPHO_GETMATRIX(prototype); + objectmatrix *new = object_newmatrix(prmat->nrows, prmat->ncols, true); + if (!new) return false; + *sum = MORPHO_OBJECT(new); + list_append(lst, *sum); + } else { + matrix_zero(MORPHO_GETMATRIX(lst->val.data[c])); + *sum = lst->val.data[c]; + } + } + return true; +} + +/** Copies the component of the hessian into the relevant destination if needed */ +bool integral_hesssumcopy(int i, int j, value sum, value dest) { + if (MORPHO_ISMATRIX(dest)) { + return morpho_valuetofloat(sum, &MORPHO_GETMATRIX(dest)->elements[j*MORPHO_GETMATRIX(dest)->nrows+i]); + } else return true; +} + /** Copies the component of the gradient into the relevant destination */ bool integral_oldgradcopy(int dim, int ndof, double *grad, value prototype, value dest) { bool success=false; @@ -4286,6 +4327,102 @@ static value integral_gradfn(vm *v, int nargs, value *args) { return out; } +/** Evaluates the hessian of a field */ +bool integral_evaluatehessian(vm *v, value q, value *out) { + objectintegralelementref *elref = integral_getelementref(v); + if (!elref) { morpho_runtimeerror(v, INTEGRAL_SPCLFN, HESS_FUNCTION); return false; } + + int ifld, xfld=-1; + for (ifld=0; ifldiref->nfields; ifld++) { + if (MORPHO_ISFIELD(q) && MORPHO_ISSAME(elref->iref->originalfields[ifld], q)) break; + else if (MORPHO_ISSAME(elref->qinterpolated[ifld], q)) { + if (xfld>=0) { morpho_runtimeerror(v, INTEGRAL_AMBGSFLD); return false; } + xfld=ifld; + } + } + if (xfld>=0) ifld = xfld; + + if (ifld>=elref->iref->nfields) { + morpho_runtimeerror(v, INTEGRAL_FLD); return false; + } + + objectfield *fld = MORPHO_GETFIELD(elref->iref->fields[ifld]); + int dim = elref->mesh->dim; + + if (!MORPHO_ISOBJECT(elref->qhess[ifld])) { + if (!integral_hessalloc(dim, fld->prototype, &elref->qhess[ifld])) { + morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); return false; + } + } + + if (MORPHO_ISFESPACE(fld->fnspc)) { + if (!elref->invj) { + elref->invj=object_newmatrix(elref->g, elref->mesh->dim, false); + if (elref->invj) { + integral_prepareinvjacobian(elref->mesh->dim, elref->g, elref->vertexposn, elref->invj); + } else { + morpho_runtimeerror(v, INTEGRAL_GRDEVL); + return false; + } + } + + fespace *disc = MORPHO_GETFESPACE(fld->fnspc)->fespace; + int nnodes = disc->nnodes; + double hdata[nnodes * elref->g * elref->g]; + objectmatrix hmat = MORPHO_STATICMATRIX(hdata, nnodes, elref->g*elref->g); + + fespace_hessian(disc, elref->lambda, &hmat); + + double fdata[nnodes * dim * dim]; + for (int j=0; jg; qref++) { + for (int pref=0; prefg; pref++) { + sum += hdata[(qref*elref->g+pref)*nnodes+n] * + elref->invj->elements[i*elref->g+pref] * + elref->invj->elements[j*elref->g+qref]; + } + } + outcol[n]=sum; + } + } + } + + for (int j=0; jprototype, elref->qhess[ifld], &sum) && + integrator_sumquantityweighted(nnodes, fdata+c*nnodes, elref->quantities[ifld].vals, &sum)) { + integral_hesssumcopy(i, j, sum, elref->qhess[ifld]); + } else { + morpho_runtimeerror(v, INTEGRAL_GRDEVL); + return false; + } + } + } + + *out=elref->qhess[ifld]; + return true; + } + + morpho_runtimeerror(v, INTEGRAL_GRDEVL); + return false; +} + +static value integral_hessfn(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + if (nargs==1) { + integral_evaluatehessian(v, MORPHO_GETARG(args, 0), &out); + } else morpho_runtimeerror(v, INTEGRAL_FLD); + + return out; +} + /* ------------------- * Cauchy green strain * ------------------- */ @@ -4524,13 +4661,14 @@ bool lineintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * integralref iref = *(integralref *) ref; double *x[nv]; bool success; - value qgrad[iref.nfields+1]; - for (int i=0; ival.count; j++) morpho_freeobject(l->val.data[j]); } morpho_freeobject(qgrad[i]); + if (MORPHO_ISLIST(qhess[i])) { + objectlist *l = MORPHO_GETLIST(qhess[i]); + for (int j=0; jval.count; j++) morpho_freeobject(l->val.data[j]); + } + morpho_freeobject(qhess[i]); } return success; @@ -4693,13 +4836,14 @@ bool areaintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * double *x[nv]; bool success; - value qgrad[iref.nfields+1]; - for (int i=0; ival.count; j++) morpho_freeobject(l->val.data[j]); } morpho_freeobject(qgrad[i]); + if (MORPHO_ISLIST(qhess[i])) { + objectlist *l = MORPHO_GETLIST(qhess[i]); + for (int j=0; jval.count; j++) morpho_freeobject(l->val.data[j]); + } + morpho_freeobject(qhess[i]); } return success; @@ -4800,13 +4949,14 @@ bool volumeintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int double *x[nv]; bool success; - value qgrad[iref.nfields+1]; - for (int i=0; ival.count; j++) morpho_freeobject(l->val.data[j]); } morpho_freeobject(qgrad[i]); + if (MORPHO_ISLIST(qhess[i])) { + objectlist *l = MORPHO_GETLIST(qhess[i]); + for (int j=0; jval.count; j++) morpho_freeobject(l->val.data[j]); + } + morpho_freeobject(qhess[i]); } return success; @@ -4951,6 +5106,7 @@ void functional_initialize(void) { builtin_addfunction(TANGENT_FUNCTION, integral_tangent, BUILTIN_FLAGSEMPTY); builtin_addfunction(NORMAL_FUNCTION, integral_normal, BUILTIN_FLAGSEMPTY); builtin_addfunction(GRAD_FUNCTION, integral_gradfn, BUILTIN_FLAGSEMPTY); + builtin_addfunction(HESS_FUNCTION, integral_hessfn, BUILTIN_FLAGSEMPTY); builtin_addfunction(CGTENSOR_FUNCTION, integral_cgfn, BUILTIN_FLAGSEMPTY); morpho_defineerror(VOLUMEENCLOSED_ZERO, ERROR_HALT, VOLUMEENCLOSED_ZERO_MSG); diff --git a/src/geometry/functional.h b/src/geometry/functional.h index dcfb0bd1a..16d7ec40d 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -59,6 +59,7 @@ #define TANGENT_FUNCTION "tangent" #define NORMAL_FUNCTION "normal" #define GRAD_FUNCTION "grad" +#define HESS_FUNCTION "hess" #define CGTENSOR_FUNCTION "cgtensor" /* Functional names */ diff --git a/test/field/discretizations/cg2/cg2_area_in_2d_hess.morpho b/test/field/discretizations/cg2/cg2_area_in_2d_hess.morpho new file mode 100644 index 000000000..2d040e6c5 --- /dev/null +++ b/test/field/discretizations/cg2/cg2_area_in_2d_hess.morpho @@ -0,0 +1,27 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +var l = FiniteElementSpace("CG2", grade=2) +var f = Field(m, fn (x,y) x^2 + x*y + 3*y^2, finiteelementspace=l) + +var out = true +var expected = Matrix([[2,1],[1,6]]) + +fn integrand(x, q) { + var h = hess(q) + if ((h-expected).norm() > 1e-8) out = false + return 0 +} + +print AreaIntegral(integrand, f, method={}).total(m) +// expect: 0 + +print out +// expect: true diff --git a/test/field/discretizations/cg3/cg3_area_in_2d_hess.morpho b/test/field/discretizations/cg3/cg3_area_in_2d_hess.morpho new file mode 100644 index 000000000..a9edb436d --- /dev/null +++ b/test/field/discretizations/cg3/cg3_area_in_2d_hess.morpho @@ -0,0 +1,28 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +var l = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y) x^3 + 2*x^2*y + 3*x*y^2 + 4*y^3, finiteelementspace=l) + +var out = true + +fn integrand(x, q) { + var h = hess(q) + var ex = Matrix([[6*x[0] + 4*x[1], 4*x[0] + 6*x[1]], + [4*x[0] + 6*x[1], 6*x[0] + 24*x[1]]]) + if ((h-ex).norm() > 1e-8) out = false + return 0 +} + +print AreaIntegral(integrand, f, method={}).total(m) +// expect: 0 + +print out +// expect: true From ede80aaa94787681026c462f1c3dc2cd326f49ec Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 15 May 2026 23:43:12 +0200 Subject: [PATCH 415/473] Raise an error if no hessian is available --- src/geometry/functional.c | 9 ++++++-- src/geometry/functional.h | 3 +++ .../cg1/cg1_area_in_2d_hess.morpho | 23 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 test/field/discretizations/cg1/cg1_area_in_2d_hess.morpho diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 0323a8954..a4979bb3f 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4367,6 +4367,10 @@ bool integral_evaluatehessian(vm *v, value q, value *out) { } fespace *disc = MORPHO_GETFESPACE(fld->fnspc)->fespace; + if (!disc->hfn) { + morpho_runtimeerror(v, INTEGRAL_HSSEVL); + return false; + } int nnodes = disc->nnodes; double hdata[nnodes * elref->g * elref->g]; objectmatrix hmat = MORPHO_STATICMATRIX(hdata, nnodes, elref->g*elref->g); @@ -4400,7 +4404,7 @@ bool integral_evaluatehessian(vm *v, value q, value *out) { integrator_sumquantityweighted(nnodes, fdata+c*nnodes, elref->quantities[ifld].vals, &sum)) { integral_hesssumcopy(i, j, sum, elref->qhess[ifld]); } else { - morpho_runtimeerror(v, INTEGRAL_GRDEVL); + morpho_runtimeerror(v, INTEGRAL_HSSEVL); return false; } } @@ -4410,7 +4414,7 @@ bool integral_evaluatehessian(vm *v, value q, value *out) { return true; } - morpho_runtimeerror(v, INTEGRAL_GRDEVL); + morpho_runtimeerror(v, INTEGRAL_HSSEVL); return false; } @@ -5138,6 +5142,7 @@ void functional_initialize(void) { morpho_defineerror(INTEGRAL_AMBGSFLD, ERROR_HALT, INTEGRAL_AMBGSFLD_MSG); morpho_defineerror(INTEGRAL_SPCLFN, ERROR_HALT, INTEGRAL_SPCLFN_MSG); morpho_defineerror(INTEGRAL_GRDEVL, ERROR_HALT, INTEGRAL_GRDEVL_MSG); + morpho_defineerror(INTEGRAL_HSSEVL, ERROR_HALT, INTEGRAL_HSSEVL_MSG); functional_poolinitialized = false; diff --git a/src/geometry/functional.h b/src/geometry/functional.h index 16d7ec40d..f94936133 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -109,6 +109,9 @@ #define INTEGRAL_GRDEVL "IntgrlGrdEvl" #define INTEGRAL_GRDEVL_MSG "Gradient evaluation failed." +#define INTEGRAL_HSSEVL "IntgrlHssEvl" +#define INTEGRAL_HSSEVL_MSG "Hessian evaluation failed." + #define INTEGRAL_AMBGSFLD "IntgrlAmbgsFld" #define INTEGRAL_AMBGSFLD_MSG "Field reference is ambigious: call with a Field object." diff --git a/test/field/discretizations/cg1/cg1_area_in_2d_hess.morpho b/test/field/discretizations/cg1/cg1_area_in_2d_hess.morpho new file mode 100644 index 000000000..83a913b30 --- /dev/null +++ b/test/field/discretizations/cg1/cg1_area_in_2d_hess.morpho @@ -0,0 +1,23 @@ +// Hessian of CG1 field should fail because CG1 has no Hessian callback +// expect error 'IntgrlHssEvl' + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([2,0]) +mb.addvertex([0,2]) +mb.addvertex([2,2]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) +var m = mb.build() +m.addgrade(1) + +var l = FiniteElementSpace("CG1", grade=2) + +fn integrand(x, q) { + return hess(q).norm() +} + +var f = Field(m, fn (x,y) 3 - 4*x + 2*y, finiteelementspace=l) +print AreaIntegral(integrand, f, method={ }).total(m) From 31ad9096890a6cc062e2a929642f79d8fc81d8b5 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 00:00:57 +0200 Subject: [PATCH 416/473] Harden fespace API --- src/geometry/fespace.c | 110 +++++++++--------- src/geometry/fespace.h | 17 ++- src/geometry/functional.c | 15 ++- src/geometry/functional.h | 4 +- .../cg2/cg2_area_in_2d_tensor_hess.morpho | 36 ++++++ 5 files changed, 120 insertions(+), 62 deletions(-) create mode 100644 test/field/discretizations/cg2/cg2_area_in_2d_tensor_hess.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index f021df9d2..d07640ced 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -289,13 +289,12 @@ void cg2_2dgrad(double *lambda, double *grad) { void cg2_2dhess(double *lambda, double *hess) { // Hijq = d^2 Xi[i] / d x[j] d x[q] in column-major order - double h[] = { - 4, 4, 0, -8, 0, 0, - 4, 0, 0, -4, 4, -4, - 4, 0, 0, -4, 4, -4, - 4, 0, 4, 0, 0, -8 - }; - memcpy(hess, h, sizeof(h)); + #define H(row,col,node) hess[FESPACE_HESS_INDEX(6, 2, row, col, node)] + H(0,0,0)=4; H(0,0,1)=4; H(0,0,2)=0; H(0,0,3)=-8; H(0,0,4)=0; H(0,0,5)=0; + H(1,0,0)=4; H(1,0,1)=0; H(1,0,2)=0; H(1,0,3)=-4; H(1,0,4)=4; H(1,0,5)=-4; + H(0,1,0)=4; H(0,1,1)=0; H(0,1,2)=0; H(0,1,3)=-4; H(0,1,4)=4; H(0,1,5)=-4; + H(1,1,0)=4; H(1,1,1)=0; H(1,1,2)=4; H(1,1,3)=0; H(1,1,4)=0; H(1,1,5)=-8; + #undef H } unsigned int cg2_2dshape[] = { 1, 1, 0 }; @@ -395,50 +394,50 @@ void cg3_2dhess(double *lambda, double *hess) { double y = lambda[2]; // Hijq = d^2 Xi[i] / d x[j] d x[q] in column-major order - #define H(c,n) hess[(c)*10+(n)] - H(0,0) = 18 - 27*x - 27*y; - H(0,1) = 27*x - 9; - H(0,2) = 0; - H(0,3) = -45 + 81*x + 54*y; - H(0,4) = 36 - 81*x - 27*y; - H(0,5) = 27*y; - H(0,6) = 0; - H(0,7) = 0; - H(0,8) = 27*y; - H(0,9) = -54*y; - - H(1,0) = 18 - 27*x - 27*y; - H(1,1) = 0; - H(1,2) = 0; - H(1,3) = -45.0/2 + 54*x + 27*y; - H(1,4) = 9.0/2 - 27*x; - H(1,5) = -9.0/2 + 27*x; - H(1,6) = -9.0/2 + 27*y; - H(1,7) = 9.0/2 - 27*y; - H(1,8) = -45.0/2 + 27*x + 54*y; - H(1,9) = 27 - 54*x - 54*y; - - H(2,0) = 18 - 27*x - 27*y; - H(2,1) = 0; - H(2,2) = 0; - H(2,3) = -45.0/2 + 54*x + 27*y; - H(2,4) = 9.0/2 - 27*x; - H(2,5) = -9.0/2 + 27*x; - H(2,6) = -9.0/2 + 27*y; - H(2,7) = 9.0/2 - 27*y; - H(2,8) = -45.0/2 + 27*x + 54*y; - H(2,9) = 27 - 54*x - 54*y; - - H(3,0) = 18 - 27*x - 27*y; - H(3,1) = 0; - H(3,2) = 27*y - 9; - H(3,3) = 27*x; - H(3,4) = 0; - H(3,5) = 0; - H(3,6) = 27*x; - H(3,7) = 36 - 27*x - 81*y; - H(3,8) = -45 + 54*x + 81*y; - H(3,9) = -54*x; + #define H(row,col,node) hess[FESPACE_HESS_INDEX(10, 2, row, col, node)] + H(0,0,0) = 18 - 27*x - 27*y; + H(0,0,1) = 27*x - 9; + H(0,0,2) = 0; + H(0,0,3) = -45 + 81*x + 54*y; + H(0,0,4) = 36 - 81*x - 27*y; + H(0,0,5) = 27*y; + H(0,0,6) = 0; + H(0,0,7) = 0; + H(0,0,8) = 27*y; + H(0,0,9) = -54*y; + + H(1,0,0) = 18 - 27*x - 27*y; + H(1,0,1) = 0; + H(1,0,2) = 0; + H(1,0,3) = -45.0/2 + 54*x + 27*y; + H(1,0,4) = 9.0/2 - 27*x; + H(1,0,5) = -9.0/2 + 27*x; + H(1,0,6) = -9.0/2 + 27*y; + H(1,0,7) = 9.0/2 - 27*y; + H(1,0,8) = -45.0/2 + 27*x + 54*y; + H(1,0,9) = 27 - 54*x - 54*y; + + H(0,1,0) = 18 - 27*x - 27*y; + H(0,1,1) = 0; + H(0,1,2) = 0; + H(0,1,3) = -45.0/2 + 54*x + 27*y; + H(0,1,4) = 9.0/2 - 27*x; + H(0,1,5) = -9.0/2 + 27*x; + H(0,1,6) = -9.0/2 + 27*y; + H(0,1,7) = 9.0/2 - 27*y; + H(0,1,8) = -45.0/2 + 27*x + 54*y; + H(0,1,9) = 27 - 54*x - 54*y; + + H(1,1,0) = 18 - 27*x - 27*y; + H(1,1,1) = 0; + H(1,1,2) = 27*y - 9; + H(1,1,3) = 27*x; + H(1,1,4) = 0; + H(1,1,5) = 0; + H(1,1,6) = 27*x; + H(1,1,7) = 36 - 27*x - 81*y; + H(1,1,8) = -45 + 54*x + 81*y; + H(1,1,9) = -54*x; #undef H } @@ -957,7 +956,10 @@ bool fespace_layout(objectfield *field, fespace *disc, objectsparse **out) { /** @brief Calculates the gradient of the basis functions with respect to the reference coordinates. * @param[in] disc - fespace to query * @param[in] lambda - position in barycentric coordinates - * @param[out] grad - gradient of basis functions with respect to reference coordinates (disc->nnodes x disc->grade) + * @param[out] grad - gradient of basis functions with respect to reference coordinates. + * Layout is column-major by component: + * grad->elements[FESPACE_GRAD_INDEX(disc->nnodes, component, node)]. + * @pre FESPACE_HASGRADIENT(disc) */ void fespace_gradient(fespace *disc, double *lambda, objectmatrix *grad) { int nbary = disc->grade+1; @@ -975,7 +977,9 @@ void fespace_gradient(fespace *disc, double *lambda, objectmatrix *grad) { * @param[in] disc - fespace to query * @param[in] lambda - position in barycentric coordinates * @param[out] hess - Hessian of basis functions with respect to reference coordinates - * (disc->nnodes x (disc->grade*disc->grade)) in column-major tensor order + * in column-major tensor order: + * hess->elements[FESPACE_HESS_INDEX(disc->nnodes, disc->grade, row, col, node)]. + * @pre FESPACE_HASHESSIAN(disc) */ void fespace_hessian(fespace *disc, double *lambda, objectmatrix *hess) { if (disc->hfn) (disc->hfn) (lambda, hess->elements); diff --git a/src/geometry/fespace.h b/src/geometry/fespace.h index c005d1ccf..49184ecad 100644 --- a/src/geometry/fespace.h +++ b/src/geometry/fespace.h @@ -16,9 +16,22 @@ /** @brief Interpolation functions are called to assign weights to the nodes given barycentric coordinates */ typedef void (*interpolationfn) (double *, double *); -/** @brief Hessian functions are called to assign second derivatives with respect to reference coordinates */ +/** @brief Gradient callbacks return d Xi[i] / d lambda[j] in column-major order: + * out[FESPACE_GRAD_INDEX(nnodes, j, i)] */ +typedef void (*gradientfn) (double *, double *); + +/** @brief Hessian callbacks return d^2 Xi[i] / d x[row] d x[col] in column-major tensor order: + * out[FESPACE_HESS_INDEX(nnodes, dim, row, col, i)] */ typedef void (*hessianfn) (double *, double *); +/** @brief Indexing helpers for derivative callback output layouts */ +#define FESPACE_GRAD_INDEX(nnodes, component, node) ((component)*(nnodes)+(node)) +#define FESPACE_HESS_INDEX(nnodes, dim, row, col, node) ((((col)*(dim))+(row))*(nnodes)+(node)) + +/** @brief Capability helpers for derivative evaluation */ +#define FESPACE_HASGRADIENT(disc) ((disc)->gfn!=NULL) +#define FESPACE_HASHESSIAN(disc) ((disc)->hfn!=NULL) + /** @brief Element definitions comprise a sequence of instructions to map field degrees of freedom to local nodes */ typedef int eldefninstruction; @@ -32,7 +45,7 @@ typedef struct sfespace { int nsubel; /** Number of subelements used by */ double *nodes; /** Node positions */ interpolationfn ifn; /** Interpolation function; receives barycentric coordinates as input and returns weights per node */ - interpolationfn gfn; /** Gradient interpolation function */ + gradientfn gfn; /** Gradient interpolation function in barycentric coordinates */ hessianfn hfn; /** Hessian interpolation function in reference coordinates */ eldefninstruction *eldefn; /** Element definition */ struct sfespace **lower; /** Discretization to be used for interpolation on lower grades */ diff --git a/src/geometry/functional.c b/src/geometry/functional.c index a4979bb3f..1af843e32 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4270,13 +4270,18 @@ bool integral_evaluategradient(vm *v, value q, value *out) { } } - int nnodes = MORPHO_GETFESPACE(fld->fnspc)->fespace->nnodes; + fespace *disc = MORPHO_GETFESPACE(fld->fnspc)->fespace; + if (!FESPACE_HASGRADIENT(disc)) { + morpho_runtimeerror(v, INTEGRAL_GRDEVL); + return false; + } + + int nnodes = disc->nnodes; double gdata[nnodes * elref->g]; objectmatrix gmat = MORPHO_STATICMATRIX(gdata, nnodes, elref->g); // Compute gradient in reference frame - fespace_gradient(MORPHO_GETFESPACE(fld->fnspc)->fespace, - elref->lambda, &gmat); + fespace_gradient(disc, elref->lambda, &gmat); // Compute matrix double fmatdata[nnodes * dim]; @@ -4361,13 +4366,13 @@ bool integral_evaluatehessian(vm *v, value q, value *out) { if (elref->invj) { integral_prepareinvjacobian(elref->mesh->dim, elref->g, elref->vertexposn, elref->invj); } else { - morpho_runtimeerror(v, INTEGRAL_GRDEVL); + morpho_runtimeerror(v, INTEGRAL_HSSEVL); return false; } } fespace *disc = MORPHO_GETFESPACE(fld->fnspc)->fespace; - if (!disc->hfn) { + if (!FESPACE_HASHESSIAN(disc)) { morpho_runtimeerror(v, INTEGRAL_HSSEVL); return false; } diff --git a/src/geometry/functional.h b/src/geometry/functional.h index f94936133..eb6ddd2a3 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -107,10 +107,10 @@ #define INTEGRAL_FLD_MSG "Can't identify field." #define INTEGRAL_GRDEVL "IntgrlGrdEvl" -#define INTEGRAL_GRDEVL_MSG "Gradient evaluation failed." +#define INTEGRAL_GRDEVL_MSG "Gradient evaluation failed or is unsupported by the finite element space." #define INTEGRAL_HSSEVL "IntgrlHssEvl" -#define INTEGRAL_HSSEVL_MSG "Hessian evaluation failed." +#define INTEGRAL_HSSEVL_MSG "Hessian evaluation failed or is unsupported by the finite element space." #define INTEGRAL_AMBGSFLD "IntgrlAmbgsFld" #define INTEGRAL_AMBGSFLD_MSG "Field reference is ambigious: call with a Field object." diff --git a/test/field/discretizations/cg2/cg2_area_in_2d_tensor_hess.morpho b/test/field/discretizations/cg2/cg2_area_in_2d_tensor_hess.morpho new file mode 100644 index 000000000..d9bae48f0 --- /dev/null +++ b/test/field/discretizations/cg2/cg2_area_in_2d_tensor_hess.morpho @@ -0,0 +1,36 @@ +// Compute the hessian of a tensor + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([2,0]) +mb.addvertex([0,2]) +mb.addvertex([2,2]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) +var m = mb.build() +m.addgrade(1) + +fn f0(x,y) { + return Matrix([[x^2 + x*y, y^2], [x*y, x^2 + 3*y^2]]) +} + +var f = Field(m, f0, finiteelementspace=FiniteElementSpace("CG2", grade=2)) + +var out = true + +fn integrand(x, q) { + var h = hess(q) + if ((h[0] - Matrix([[2,0],[0,2]])).norm() > 1e-8) out = false + if ((h[1] - Matrix([[1,0],[1,0]])).norm() > 1e-8) out = false + if ((h[2] - Matrix([[1,0],[1,0]])).norm() > 1e-8) out = false + if ((h[3] - Matrix([[0,2],[0,6]])).norm() > 1e-8) out = false + return 0 +} + +print AreaIntegral(integrand, f, method={ }).total(m) +// expect: 0 + +print out +// expect: true From 3a93e4c8ac0f81394dd777b0959abdd0150363c4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 00:10:08 +0200 Subject: [PATCH 417/473] CG3 and CG2 hessians in 3D --- src/geometry/fespace.c | 37 +++++++++++++++++++ .../cg2/cg2_vol_in_3d_hess.morpho | 32 ++++++++++++++++ .../cg3/cg3_vol_in_3d_hess.morpho | 32 ++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 test/field/discretizations/cg2/cg2_vol_in_3d_hess.morpho create mode 100644 test/field/discretizations/cg3/cg3_vol_in_3d_hess.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index d07640ced..c490f5904 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -598,6 +598,23 @@ void cg2_3dgrad(double *lambda, double *grad) { // TODO: FIX memcpy(grad, g, sizeof(g)); } +void cg2_3dhess(double *lambda, double *hess) { + // Hijq = d^2 Xi[i] / d x[j] d x[q] in column-major tensor order + #define H(row,col,node) hess[FESPACE_HESS_INDEX(10, 3, row, col, node)] + H(0,0,0)=4; H(0,0,1)=4; H(0,0,2)=0; H(0,0,3)=0; H(0,0,4)=-8; H(0,0,5)=0; H(0,0,6)=0; H(0,0,7)=0; H(0,0,8)=0; H(0,0,9)=0; + H(1,0,0)=4; H(1,0,1)=0; H(1,0,2)=0; H(1,0,3)=0; H(1,0,4)=-4; H(1,0,5)=4; H(1,0,6)=-4; H(1,0,7)=0; H(1,0,8)=0; H(1,0,9)=0; + H(2,0,0)=4; H(2,0,1)=0; H(2,0,2)=0; H(2,0,3)=0; H(2,0,4)=-4; H(2,0,5)=0; H(2,0,6)=0; H(2,0,7)=-4; H(2,0,8)=4; H(2,0,9)=0; + + H(0,1,0)=4; H(0,1,1)=0; H(0,1,2)=0; H(0,1,3)=0; H(0,1,4)=-4; H(0,1,5)=4; H(0,1,6)=-4; H(0,1,7)=0; H(0,1,8)=0; H(0,1,9)=0; + H(1,1,0)=4; H(1,1,1)=0; H(1,1,2)=4; H(1,1,3)=0; H(1,1,4)=0; H(1,1,5)=0; H(1,1,6)=-8; H(1,1,7)=0; H(1,1,8)=0; H(1,1,9)=0; + H(2,1,0)=4; H(2,1,1)=0; H(2,1,2)=0; H(2,1,3)=0; H(2,1,4)=0; H(2,1,5)=0; H(2,1,6)=-4; H(2,1,7)=-4; H(2,1,8)=0; H(2,1,9)=4; + + H(0,2,0)=4; H(0,2,1)=0; H(0,2,2)=0; H(0,2,3)=0; H(0,2,4)=-4; H(0,2,5)=0; H(0,2,6)=0; H(0,2,7)=-4; H(0,2,8)=4; H(0,2,9)=0; + H(1,2,0)=4; H(1,2,1)=0; H(1,2,2)=0; H(1,2,3)=0; H(1,2,4)=0; H(1,2,5)=0; H(1,2,6)=-4; H(1,2,7)=-4; H(1,2,8)=0; H(1,2,9)=4; + H(2,2,0)=4; H(2,2,1)=0; H(2,2,2)=0; H(2,2,3)=4; H(2,2,4)=0; H(2,2,5)=0; H(2,2,6)=0; H(2,2,7)=-8; H(2,2,8)=0; H(2,2,9)=0; + #undef H +} + unsigned int cg2_3dshape[] = { 1, 1, 0, 0 }; double cg2_3dnodes[] = { 0, 0, 0, @@ -647,6 +664,7 @@ fespace cg2_3d = { .nodes = cg2_3dnodes, .ifn = cg2_3dinterpolate, .gfn = cg2_3dgrad, + .hfn = cg2_3dhess, .eldefn = cg2_3deldefn, .lower = cg2_3d_lower }; @@ -719,6 +737,24 @@ void cg3_3dgrad(double *lambda, double *grad) { } } +void cg3_3dhess(double *lambda, double *hess) { + double x=lambda[1], y=lambda[2], z=lambda[3]; + + #define H(row,col,node) hess[FESPACE_HESS_INDEX(20, 3, row, col, node)] + H(0,0,0)=18-27*x-27*y-27*z; H(0,0,1)=27*x-9; H(0,0,2)=0; H(0,0,3)=0; H(0,0,4)=81*x+54*y+54*z-45; H(0,0,5)=-81*x-27*y-27*z+36; H(0,0,6)=27*y; H(0,0,7)=0; H(0,0,8)=0; H(0,0,9)=27*y; H(0,0,10)=27*z; H(0,0,11)=0; H(0,0,12)=27*z; H(0,0,13)=0; H(0,0,14)=0; H(0,0,15)=0; H(0,0,16)=-54*y; H(0,0,17)=-54*z; H(0,0,18)=0; H(0,0,19)=0; + H(1,0,0)=18-27*x-27*y-27*z; H(1,0,1)=0; H(1,0,2)=0; H(1,0,3)=0; H(1,0,4)=54*x+27*y+27*z-22.5; H(1,0,5)=-27*x+4.5; H(1,0,6)=27*x-4.5; H(1,0,7)=27*y-4.5; H(1,0,8)=-27*y+4.5; H(1,0,9)=27*x+54*y+27*z-22.5; H(1,0,10)=27*z; H(1,0,11)=0; H(1,0,12)=0; H(1,0,13)=0; H(1,0,14)=0; H(1,0,15)=0; H(1,0,16)=-54*x-54*y-27*z+27; H(1,0,17)=-27*z; H(1,0,18)=27*z; H(1,0,19)=-27*z; + H(2,0,0)=18-27*x-27*y-27*z; H(2,0,1)=0; H(2,0,2)=0; H(2,0,3)=0; H(2,0,4)=54*x+27*y+27*z-22.5; H(2,0,5)=-27*x+4.5; H(2,0,6)=0; H(2,0,7)=0; H(2,0,8)=0; H(2,0,9)=27*y; H(2,0,10)=27*x+27*y+54*z-22.5; H(2,0,11)=-27*z+4.5; H(2,0,12)=27*x-4.5; H(2,0,13)=27*z-4.5; H(2,0,14)=0; H(2,0,15)=0; H(2,0,16)=-27*y; H(2,0,17)=-54*x-27*y-54*z+27; H(2,0,18)=27*y; H(2,0,19)=-27*y; + + H(0,1,0)=18-27*x-27*y-27*z; H(0,1,1)=0; H(0,1,2)=0; H(0,1,3)=0; H(0,1,4)=54*x+27*y+27*z-22.5; H(0,1,5)=-27*x+4.5; H(0,1,6)=27*x-4.5; H(0,1,7)=27*y-4.5; H(0,1,8)=-27*y+4.5; H(0,1,9)=27*x+54*y+27*z-22.5; H(0,1,10)=27*z; H(0,1,11)=0; H(0,1,12)=0; H(0,1,13)=0; H(0,1,14)=0; H(0,1,15)=0; H(0,1,16)=-54*x-54*y-27*z+27; H(0,1,17)=-27*z; H(0,1,18)=27*z; H(0,1,19)=-27*z; + H(1,1,0)=18-27*x-27*y-27*z; H(1,1,1)=0; H(1,1,2)=27*y-9; H(1,1,3)=0; H(1,1,4)=27*x; H(1,1,5)=0; H(1,1,6)=0; H(1,1,7)=27*x; H(1,1,8)=-27*x-81*y-27*z+36; H(1,1,9)=54*x+81*y+54*z-45; H(1,1,10)=27*z; H(1,1,11)=0; H(1,1,12)=0; H(1,1,13)=0; H(1,1,14)=27*z; H(1,1,15)=0; H(1,1,16)=-54*x; H(1,1,17)=0; H(1,1,18)=0; H(1,1,19)=-54*z; + H(2,1,0)=18-27*x-27*y-27*z; H(2,1,1)=0; H(2,1,2)=0; H(2,1,3)=0; H(2,1,4)=27*x; H(2,1,5)=0; H(2,1,6)=0; H(2,1,7)=0; H(2,1,8)=-27*y+4.5; H(2,1,9)=27*x+54*y+27*z-22.5; H(2,1,10)=27*x+27*y+54*z-22.5; H(2,1,11)=-27*z+4.5; H(2,1,12)=0; H(2,1,13)=0; H(2,1,14)=27*y-4.5; H(2,1,15)=27*z-4.5; H(2,1,16)=-27*x; H(2,1,17)=-27*x; H(2,1,18)=27*x; H(2,1,19)=-27*x-54*y-54*z+27; + + H(0,2,0)=18-27*x-27*y-27*z; H(0,2,1)=0; H(0,2,2)=0; H(0,2,3)=0; H(0,2,4)=54*x+27*y+27*z-22.5; H(0,2,5)=-27*x+4.5; H(0,2,6)=0; H(0,2,7)=0; H(0,2,8)=0; H(0,2,9)=27*y; H(0,2,10)=27*x+27*y+54*z-22.5; H(0,2,11)=-27*z+4.5; H(0,2,12)=27*x-4.5; H(0,2,13)=27*z-4.5; H(0,2,14)=0; H(0,2,15)=0; H(0,2,16)=-27*y; H(0,2,17)=-54*x-27*y-54*z+27; H(0,2,18)=27*y; H(0,2,19)=-27*y; + H(1,2,0)=18-27*x-27*y-27*z; H(1,2,1)=0; H(1,2,2)=0; H(1,2,3)=0; H(1,2,4)=27*x; H(1,2,5)=0; H(1,2,6)=0; H(1,2,7)=0; H(1,2,8)=-27*y+4.5; H(1,2,9)=27*x+54*y+27*z-22.5; H(1,2,10)=27*x+27*y+54*z-22.5; H(1,2,11)=-27*z+4.5; H(1,2,12)=0; H(1,2,13)=0; H(1,2,14)=27*y-4.5; H(1,2,15)=27*z-4.5; H(1,2,16)=-27*x; H(1,2,17)=-27*x; H(1,2,18)=27*x; H(1,2,19)=-27*x-54*y-54*z+27; + H(2,2,0)=18-27*x-27*y-27*z; H(2,2,1)=0; H(2,2,2)=0; H(2,2,3)=27*z-9; H(2,2,4)=27*x; H(2,2,5)=0; H(2,2,6)=0; H(2,2,7)=0; H(2,2,8)=0; H(2,2,9)=27*y; H(2,2,10)=54*x+54*y+81*z-45; H(2,2,11)=-27*x-27*y-81*z+36; H(2,2,12)=0; H(2,2,13)=27*x; H(2,2,14)=0; H(2,2,15)=27*y; H(2,2,16)=0; H(2,2,17)=-54*x; H(2,2,18)=0; H(2,2,19)=-54*y; + #undef H +} + unsigned int cg3_3dshape[] = { 1, 2, 1, 0 }; double cg3_3dnodes[] = { @@ -794,6 +830,7 @@ fespace cg3_3d = { .nodes = cg3_3dnodes, .ifn = cg3_3dinterpolate, .gfn = cg3_3dgrad, + .hfn = cg3_3dhess, .eldefn = cg3_3deldefn, .lower = cg3_3d_lower }; diff --git a/test/field/discretizations/cg2/cg2_vol_in_3d_hess.morpho b/test/field/discretizations/cg2/cg2_vol_in_3d_hess.morpho new file mode 100644 index 000000000..42cabb78f --- /dev/null +++ b/test/field/discretizations/cg2/cg2_vol_in_3d_hess.morpho @@ -0,0 +1,32 @@ +// CG2 FunctionSpace hessian in three dimensions + +import meshtools + +var cube = [ [0,0,0], [1,0,0], [0,1,0], [1,1,0], + [0,0,1], [1,0,1], [0,1,1], [1,1,1] ] + +var pts = [] +for (x in cube) pts.append(Matrix(x)) + +var m = DelaunayMesh(pts) +m.addgrade(1) + +var fe = FiniteElementSpace("CG2", grade=3) +var f = Field(m, fn (x,y,z) x^2 + x*y + 3*y^2 + 2*x*z + 4*y*z + 5*z^2, finiteelementspace=fe) + +var out = true +var expected = Matrix([[2,1,2], + [1,6,4], + [2,4,10]]) + +fn integrand(x, q) { + var h = hess(q) + if ((h-expected).norm() > 1e-8) out = false + return 0 +} + +print VolumeIntegral(integrand, f, method={}).total(m) +// expect: 0 + +print out +// expect: true diff --git a/test/field/discretizations/cg3/cg3_vol_in_3d_hess.morpho b/test/field/discretizations/cg3/cg3_vol_in_3d_hess.morpho new file mode 100644 index 000000000..4832a07ed --- /dev/null +++ b/test/field/discretizations/cg3/cg3_vol_in_3d_hess.morpho @@ -0,0 +1,32 @@ +// CG3 FunctionSpace hessian in three dimensions + +import meshtools + +var cube = [ [0,0,0], [1,0,0], [0,1,0], [1,1,0], + [0,0,1], [1,0,1], [0,1,1], [1,1,1] ] + +var pts = [] +for (x in cube) pts.append(Matrix(x)) + +var m = DelaunayMesh(pts) +m.addgrade(1) + +var fe = FiniteElementSpace("CG3", grade=3) +var f = Field(m, fn (x,y,z) x^3 + 2*x*y*z + z^3, finiteelementspace=fe) + +var out = true + +fn integrand(x, q) { + var h = hess(q) + var ex = Matrix([[6*x[0], 2*x[2], 2*x[1]], + [2*x[2], 0, 2*x[0]], + [2*x[1], 2*x[0], 6*x[2]]]) + if ((h-ex).norm() > 1e-8) out = false + return 0 +} + +print VolumeIntegral(integrand, f, method={}).total(m) +// expect: 0 + +print out +// expect: true From 64fea0a7647a66cd04f438a9e31c71196cd3c104 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 00:31:21 +0200 Subject: [PATCH 418/473] Check lowering machinery --- .../cg3/cg3_area_in_3d_lower.morpho | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/field/discretizations/cg3/cg3_area_in_3d_lower.morpho diff --git a/test/field/discretizations/cg3/cg3_area_in_3d_lower.morpho b/test/field/discretizations/cg3/cg3_area_in_3d_lower.morpho new file mode 100644 index 000000000..f59d2d4ca --- /dev/null +++ b/test/field/discretizations/cg3/cg3_area_in_3d_lower.morpho @@ -0,0 +1,35 @@ +// Check lowering a CG3 tetrahedral field to its boundary faces. + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0, 0, 0]) +mb.addvertex([2, 0, 0]) +mb.addvertex([0, 3, 0]) +mb.addvertex([0, 0, 5]) +mb.addvolume([0, 1, 2, 3]) + +var m = mb.build() +m.addgrade(1) +m.addgrade(2) + +var bnd = Selection(m, boundary=true) + +var fe = FiniteElementSpace("CG3", grade=3) + +fn exact(x, y, z) { + return x^3 + 2*x^2*y + 3*x*y^2 + 5*y^3 + + 7*x^2*z + 11*x*y*z + 13*y^2*z + + 17*x*z^2 + 19*y*z^2 + 23*z^3 + + 29*x + 31*y + 37*z +} + +var f = Field(m, fn (x, y, z) exact(x, y, z), finiteelementspace=fe) + +var err = AreaIntegral(fn (x, q) { + var ex = exact(x[0], x[1], x[2]) + return (q-ex)^2 +}, f, method={}).total(m, bnd) + +print abs(err) < 1e-10 +// expect: true From c9f9b2835cbed69a436bf1790055eb4f9ec6e763 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 10:13:39 +0200 Subject: [PATCH 419/473] Jump tests --- test/functionals/jump/jump1d.morpho | 9 +++++++++ test/functionals/jump/jump2d.morpho | 18 ++++++++++++++++++ test/functionals/jump/jump3d.morpho | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 test/functionals/jump/jump1d.morpho create mode 100644 test/functionals/jump/jump2d.morpho create mode 100644 test/functionals/jump/jump3d.morpho diff --git a/test/functionals/jump/jump1d.morpho b/test/functionals/jump/jump1d.morpho new file mode 100644 index 000000000..9b78f2dbb --- /dev/null +++ b/test/functionals/jump/jump1d.morpho @@ -0,0 +1,9 @@ +import meshtools + +var m = LineMesh(fn (u) [u,0,0], 0..1:0.5) + +var fe = FiniteElementSpace("CG1", grade=1) +var f = Field(m, fn (x,y,z) x^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f).total(m) - 1) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump2d.morpho b/test/functionals/jump/jump2d.morpho new file mode 100644 index 000000000..4bcc937ea --- /dev/null +++ b/test/functionals/jump/jump2d.morpho @@ -0,0 +1,18 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG1", grade=2) +var f = Field(m, fn (x,y,z) x*y, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f).total(m) - 2*sqrt(2)) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump3d.morpho b/test/functionals/jump/jump3d.morpho new file mode 100644 index 000000000..14f43c1e2 --- /dev/null +++ b/test/functionals/jump/jump3d.morpho @@ -0,0 +1,20 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvertex([0,0,-1]) +mb.addvolume([0,1,2,3]) +mb.addvolume([0,1,2,4]) + +var m = mb.build() +m.addgrade(1) +m.addgrade(2) + +var fe = FiniteElementSpace("CG1", grade=3) +var f = Field(m, fn (x,y,z) z^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f).total(m) - 2) < 1e-8 +// expect: true From 618ab1da7ffaa9e5974440d0650c1d31b517e776 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 11:08:10 +0200 Subject: [PATCH 420/473] Jump interface references. --- src/geometry/functional.c | 224 ++++++++++++++++++++++++++++++++++++++ src/geometry/functional.h | 5 + 2 files changed, 229 insertions(+) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 1af843e32..61b0113f4 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -9,6 +9,7 @@ #include #include +#include #include "functional.h" #include "morpho.h" @@ -3917,6 +3918,8 @@ typedef struct { bool weightbyref; // Use reference mesh for the element } integralref; +typedef struct jumpref_s jumpref; + /* ---------------------------------------------- * Integrand functions * ---------------------------------------------- */ @@ -3991,6 +3994,72 @@ objectintegralelementref *integral_getelementref(vm *v) { return NULL; } +/* ---------------------------------------------- + * Jump interface references + * ---------------------------------------------- */ + +/** Thread-local interface context for Jump functionals. */ +typedef struct { + object obj; + objectmesh *mesh; // The current mesh object + + jumpref *jref; // Shared Jump reference + + grade g; // Interface grade + elementid id; // Interface id + int nv; // Number of interface vertices + int *vid; // Interface vertex ids + double **vertexposn; // Interface vertex positions + double interfacesize; // Size/measure of the interface + + elementid plusid; // Canonical + parent element id + elementid minusid; // Canonical - parent element id + + int plusnv, minusnv; // Number of vertices in parent elements + int *plusvid, *minusvid; // Vertex ids in parent elements + + objectmatrix *normal; // Canonical interface normal + + value *qplusgrad; // Per-side cached gradients, later + value *qminusgrad; + value *qplushess; // Per-side cached Hessians, later + value *qminushess; +} objectjumpinterfaceref; + +size_t objectjumpinterfaceref_sizefn(object *obj) { + return sizeof(objectjumpinterfaceref); +} + +void objectjumpinterfaceref_printfn(object *obj, void *v) { + morpho_printf(v, ""); +} + +objecttypedefn objectjumpinterfacerefdefn = { + .printfn=objectjumpinterfaceref_printfn, + .markfn=NULL, + .freefn=NULL, + .sizefn=objectjumpinterfaceref_sizefn, + .hashfn=NULL, + .cmpfn=NULL +}; + +objecttype objectjumpinterfacereftype; +#define OBJECT_JUMPINTERFACEREF objectjumpinterfacereftype + +#define MORPHO_ISJUMPINTERFACEREF(val) object_istype(val, OBJECT_JUMPINTERFACEREF) +#define MORPHO_GETJUMPINTERFACEREF(val) ((objectjumpinterfaceref *) MORPHO_GETOBJECT(val)) +#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .g=grade, .id=id, .nv=nv, .vid=vid, .normal=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } + +int jumpinterfacehandle; + +static objectjumpinterfaceref *jump_getinterfaceref(vm *v) { + value iref=MORPHO_NIL; + vm_gettlvar(v, jumpinterfacehandle, &iref); + if (MORPHO_ISJUMPINTERFACEREF(iref)) return MORPHO_GETJUMPINTERFACEREF(iref); + + return NULL; +} + /* -------- * Tangent * -------- */ @@ -5056,6 +5125,156 @@ MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, VolumeIntegral_gradient, BUILTIN_FLAGS MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, VolumeIntegral_fieldgradient, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS +/* ---------------------------------------------- + * Jump + * ---------------------------------------------- */ + +struct jumpref_s { + integralref integral; + grade parentgrade; + grade interfacegrade; + objectsparse *interfaceparents; + objectsparse *parentvertices; +}; + +static value Jump_notimplemented(vm *v, int nargs, value *args) { + morpho_runtimeerror(v, JUMP_UNIMPL); + return MORPHO_NIL; +} + +/** Initialize a Jump object. + For now this matches the existing integral optional-argument surface: + 'method', 'mref' and 'weightbyreference'. */ +static value Jump_init(vm *v, int nargs, value *args) { + return LineIntegral_init(v, nargs, args); +} + +/** Prepare a jump reference. + For now this only identifies the codimension-1 interface grade and the + interface-to-parent incidence matrix needed to find adjacent elements. */ +static bool jump_prepareref(objectinstance *self, objectmesh *mesh, objectselection *sel, jumpref *ref) { + if (!integral_prepareref(self, mesh, 0, sel, &ref->integral)) return false; + + ref->parentgrade=mesh_maxgrade(mesh); + if (ref->parentgrade<1) return false; + + ref->interfacegrade=ref->parentgrade-1; + ref->interfaceparents=mesh_addconnectivityelement(mesh, ref->parentgrade, ref->interfacegrade); + ref->parentvertices=mesh_getconnectivityelement(mesh, 0, ref->parentgrade); + + return (ref->interfaceparents!=NULL && ref->parentvertices!=NULL); +} + +/** Get the adjacent parent elements for an interface. */ +static bool jump_getadjacentparents(jumpref *ref, elementid interfaceid, int *nparents, int **parents) { + if (!ref->interfaceparents) return false; + return mesh_getconnectivity(ref->interfaceparents, interfaceid, nparents, parents); +} + +static void jump_orderparents(int *parents, elementid *plusid, elementid *minusid) { + if (parents[0]interfacegrade, id, nv, vid); + iref->jref=ref; + + jump_orderparents(parents, &iref->plusid, &iref->minusid); + + if (!mesh_getconnectivity(ref->parentvertices, iref->plusid, &plusnv, &plusvid)) return false; + if (!mesh_getconnectivity(ref->parentvertices, iref->minusid, &minusnv, &minusvid)) return false; + + iref->plusnv=plusnv; + iref->plusvid=plusvid; + iref->minusnv=minusnv; + iref->minusvid=minusvid; + + vm_settlvar(v, jumpinterfacehandle, MORPHO_OBJECT(iref)); + return true; +} + +/** Basic Jump scan over codimension-1 entities. + This currently only identifies interior interfaces by checking that they + have exactly two adjacent parent elements. */ +static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *r, double *out) { + jumpref *ref = (jumpref *) r; + int nparents=0, *parents=NULL; + + if (!jump_getadjacentparents(ref, id, &nparents, &parents)) return false; + + /* Boundary interfaces or malformed topology are ignored for now. */ + if (nparents!=2) { *out=0.0; return true; } + + objectjumpinterfaceref iref; + if (!jump_prepareinterfaceref(v, mesh, ref, id, nv, vid, parents, &iref)) return false; + + fprintf(stderr, "Jump interface %d -> parent elements %d, %d\n", id, iref.plusid, iref.minusid); + + /* Placeholder until the two-sided trace machinery is implemented. */ + *out=0.0; + return true; +} + +static value Jump_integrand(vm *v, int nargs, value *args) { + functional_mapinfo info; + jumpref ref; + value out=MORPHO_NIL; + + if (functional_validateargs(v, nargs, args, &info)) { + if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, info.sel, &ref)) { + info.g=ref.interfacegrade; + info.integrand=jump_scan_integrand; + info.ref=&ref; + functional_mapintegrand(v, &info, &out); + } else morpho_runtimeerror(v, JUMP_UNIMPL); + } + if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); + return out; +} + +static value Jump_total(vm *v, int nargs, value *args) { + functional_mapinfo info; + jumpref ref; + value out=MORPHO_NIL; + + if (functional_validateargs(v, nargs, args, &info)) { + if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, info.sel, &ref)) { + info.g=ref.interfacegrade; + info.integrand=jump_scan_integrand; + info.ref=&ref; + functional_sumintegrand(v, &info, &out); + } else morpho_runtimeerror(v, JUMP_UNIMPL); + } + + return out; +} + +static value integral_jumpdnfn(vm *v, int nargs, value *args) { + objectintegralelementref *elref = integral_getelementref(v); + if (!elref) { + morpho_runtimeerror(v, INTEGRAL_SPCLFN, JUMPDN_FUNCTION); + } else { + morpho_runtimeerror(v, JUMP_UNIMPL); + } + return MORPHO_NIL; +} + +MORPHO_BEGINCLASS(Jump) +MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Jump_init, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Jump_integrand, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Jump_total, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Jump_notimplemented, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, Jump_notimplemented, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Jump_notimplemented, BUILTIN_FLAGSEMPTY) +MORPHO_ENDCLASS + /* ********************************************************************** * Initialization * ********************************************************************** */ @@ -5109,6 +5328,7 @@ void functional_initialize(void) { builtin_addclass(LINEINTEGRAL_CLASSNAME, MORPHO_GETCLASSDEFINITION(LineIntegral), objclass); builtin_addclass(AREAINTEGRAL_CLASSNAME, MORPHO_GETCLASSDEFINITION(AreaIntegral), objclass); builtin_addclass(VOLUMEINTEGRAL_CLASSNAME, MORPHO_GETCLASSDEFINITION(VolumeIntegral), objclass); + builtin_addclass(JUMP_CLASSNAME, MORPHO_GETCLASSDEFINITION(Jump), objclass); builtin_addclass(NEMATIC_CLASSNAME, MORPHO_GETCLASSDEFINITION(Nematic), objclass); builtin_addclass(NEMATICELECTRIC_CLASSNAME, MORPHO_GETCLASSDEFINITION(NematicElectric), objclass); @@ -5117,6 +5337,7 @@ void functional_initialize(void) { builtin_addfunction(GRAD_FUNCTION, integral_gradfn, BUILTIN_FLAGSEMPTY); builtin_addfunction(HESS_FUNCTION, integral_hessfn, BUILTIN_FLAGSEMPTY); builtin_addfunction(CGTENSOR_FUNCTION, integral_cgfn, BUILTIN_FLAGSEMPTY); + builtin_addfunction(JUMPDN_FUNCTION, integral_jumpdnfn, BUILTIN_FLAGSEMPTY); morpho_defineerror(VOLUMEENCLOSED_ZERO, ERROR_HALT, VOLUMEENCLOSED_ZERO_MSG); morpho_defineerror(FUNC_INTEGRAND_MESH, ERROR_HALT, FUNC_INTEGRAND_MESH_MSG); @@ -5148,11 +5369,14 @@ void functional_initialize(void) { morpho_defineerror(INTEGRAL_SPCLFN, ERROR_HALT, INTEGRAL_SPCLFN_MSG); morpho_defineerror(INTEGRAL_GRDEVL, ERROR_HALT, INTEGRAL_GRDEVL_MSG); morpho_defineerror(INTEGRAL_HSSEVL, ERROR_HALT, INTEGRAL_HSSEVL_MSG); + morpho_defineerror(JUMP_UNIMPL, ERROR_HALT, JUMP_UNIMPL_MSG); functional_poolinitialized = false; objectintegralelementreftype=object_addtype(&objectintegralelementrefdefn); + objectjumpinterfacereftype=object_addtype(&objectjumpinterfacerefdefn); elementhandle=vm_addtlvar(); + jumpinterfacehandle=vm_addtlvar(); tangenthandle=vm_addtlvar(); normlhandle=vm_addtlvar(); cauchygreenhandle=vm_addtlvar(); diff --git a/src/geometry/functional.h b/src/geometry/functional.h index eb6ddd2a3..b4f66fe52 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -61,6 +61,7 @@ #define GRAD_FUNCTION "grad" #define HESS_FUNCTION "hess" #define CGTENSOR_FUNCTION "cgtensor" +#define JUMPDN_FUNCTION "jumpdn" /* Functional names */ #define LENGTH_CLASSNAME "Length" @@ -81,6 +82,7 @@ #define LINEINTEGRAL_CLASSNAME "LineIntegral" #define AREAINTEGRAL_CLASSNAME "AreaIntegral" #define VOLUMEINTEGRAL_CLASSNAME "VolumeIntegral" +#define JUMP_CLASSNAME "Jump" #define NEMATIC_CLASSNAME "Nematic" #define NEMATICELECTRIC_CLASSNAME "NematicElectric" @@ -118,6 +120,9 @@ #define INTEGRAL_SPCLFN "IntgrlSpclFn" #define INTEGRAL_SPCLFN_MSG "Special function '%s' must not be called outside of an Integral." +#define JUMP_UNIMPL "JumpUnimpl" +#define JUMP_UNIMPL_MSG "Jump is not implemented yet." + #define INTEGRAL_NFLDS "IntgrlNFlds" #define INTEGRAL_NFLDS_MSG "Incorrect number of Fields provided for integrand function." From e93a607b1f0b235a25367878e12373e373a3621a Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 11:14:53 +0200 Subject: [PATCH 421/473] Clean up jump_prepareref. --- src/geometry/functional.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 61b0113f4..90c5f8531 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -5137,6 +5137,17 @@ struct jumpref_s { objectsparse *parentvertices; }; +static bool jump_preparetopology(objectmesh *mesh, jumpref *ref) { + ref->parentgrade=mesh_maxgrade(mesh); + if (ref->parentgrade<1) return false; + + ref->interfacegrade=ref->parentgrade-1; + ref->interfaceparents=mesh_addconnectivityelement(mesh, ref->parentgrade, ref->interfacegrade); + ref->parentvertices=mesh_getconnectivityelement(mesh, 0, ref->parentgrade); + + return (ref->interfaceparents!=NULL && ref->parentvertices!=NULL); +} + static value Jump_notimplemented(vm *v, int nargs, value *args) { morpho_runtimeerror(v, JUMP_UNIMPL); return MORPHO_NIL; @@ -5150,19 +5161,16 @@ static value Jump_init(vm *v, int nargs, value *args) { } /** Prepare a jump reference. - For now this only identifies the codimension-1 interface grade and the - interface-to-parent incidence matrix needed to find adjacent elements. */ -static bool jump_prepareref(objectinstance *self, objectmesh *mesh, objectselection *sel, jumpref *ref) { - if (!integral_prepareref(self, mesh, 0, sel, &ref->integral)) return false; + Shared functional metadata is handled by integral_prepareref; Jump only adds + codimension-1 topology needed for interior-interface traversal. */ +static bool jump_prepareref(objectinstance *self, objectmesh *mesh, grade g, objectselection *sel, jumpref *ref) { + ref->parentgrade=0; + ref->interfacegrade=0; + ref->interfaceparents=NULL; + ref->parentvertices=NULL; - ref->parentgrade=mesh_maxgrade(mesh); - if (ref->parentgrade<1) return false; - - ref->interfacegrade=ref->parentgrade-1; - ref->interfaceparents=mesh_addconnectivityelement(mesh, ref->parentgrade, ref->interfacegrade); - ref->parentvertices=mesh_getconnectivityelement(mesh, 0, ref->parentgrade); - - return (ref->interfaceparents!=NULL && ref->parentvertices!=NULL); + if (!integral_prepareref(self, mesh, g, sel, &ref->integral)) return false; + return jump_preparetopology(mesh, ref); } /** Get the adjacent parent elements for an interface. */ @@ -5228,7 +5236,7 @@ static value Jump_integrand(vm *v, int nargs, value *args) { value out=MORPHO_NIL; if (functional_validateargs(v, nargs, args, &info)) { - if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, info.sel, &ref)) { + if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; info.ref=&ref; @@ -5245,7 +5253,7 @@ static value Jump_total(vm *v, int nargs, value *args) { value out=MORPHO_NIL; if (functional_validateargs(v, nargs, args, &info)) { - if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, info.sel, &ref)) { + if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; info.ref=&ref; From 3eb5489ef53b801e629766e8681d7bf88a841c16 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 11:25:17 +0200 Subject: [PATCH 422/473] jumpsides --- src/geometry/functional.c | 54 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 90c5f8531..af0604b61 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -3920,6 +3920,12 @@ typedef struct { typedef struct jumpref_s jumpref; +typedef struct { + int nv; + int *vid; + quantity *quantities; +} jumpside; + /* ---------------------------------------------- * Integrand functions * ---------------------------------------------- */ @@ -4018,6 +4024,9 @@ typedef struct { int plusnv, minusnv; // Number of vertices in parent elements int *plusvid, *minusvid; // Vertex ids in parent elements + jumpside qplus; + jumpside qminus; + objectmatrix *normal; // Canonical interface normal value *qplusgrad; // Per-side cached gradients, later @@ -4048,7 +4057,7 @@ objecttype objectjumpinterfacereftype; #define MORPHO_ISJUMPINTERFACEREF(val) object_istype(val, OBJECT_JUMPINTERFACEREF) #define MORPHO_GETJUMPINTERFACEREF(val) ((objectjumpinterfaceref *) MORPHO_GETOBJECT(val)) -#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .g=grade, .id=id, .nv=nv, .vid=vid, .normal=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } +#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .g=grade, .id=id, .nv=nv, .vid=vid, .qplus={0}, .qminus={0}, .normal=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } int jumpinterfacehandle; @@ -5179,6 +5188,42 @@ static bool jump_getadjacentparents(jumpref *ref, elementid interfaceid, int *np return mesh_getconnectivity(ref->interfaceparents, interfaceid, nparents, parents); } +static bool jump_preparejumpside(jumpref *ref, int nv, int *vid, jumpside *trace) { + trace->nv=nv; + trace->vid=vid; + trace->quantities=MORPHO_MALLOC(sizeof(quantity)*ref->integral.nfields); + if (!trace->quantities) return false; + + for (int i=0; iintegral.nfields; i++) { + trace->quantities[i].nnodes=0; + trace->quantities[i].vals=NULL; + trace->quantities[i].ifn=NULL; + trace->quantities[i].ndof=0; + } + + if (!integral_preparequantities(&ref->integral, nv, vid, trace->quantities)) { + integral_clearquantities(ref->integral.nfields, trace->quantities); + MORPHO_FREE(trace->quantities); + trace->quantities=NULL; + return false; + } + + return true; +} + +static void jump_clearjumpside(jumpref *ref, jumpside *trace) { + if (trace->quantities) { + integral_clearquantities(ref->integral.nfields, trace->quantities); + MORPHO_FREE(trace->quantities); + trace->quantities=NULL; + } +} + +static void jump_clearinterfaceref(objectjumpinterfaceref *iref) { + jump_clearjumpside(iref->jref, &iref->qplus); + jump_clearjumpside(iref->jref, &iref->qminus); +} + static void jump_orderparents(int *parents, elementid *plusid, elementid *minusid) { if (parents[0]minusnv=minusnv; iref->minusvid=minusvid; + if (!jump_preparejumpside(ref, iref->plusnv, iref->plusvid, &iref->qplus)) return false; + if (!jump_preparejumpside(ref, iref->minusnv, iref->minusvid, &iref->qminus)) { + jump_clearjumpside(ref, &iref->qplus); + return false; + } + vm_settlvar(v, jumpinterfacehandle, MORPHO_OBJECT(iref)); return true; } @@ -5227,6 +5278,7 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i /* Placeholder until the two-sided trace machinery is implemented. */ *out=0.0; + jump_clearinterfaceref(&iref); return true; } From 981180d382d99fbfc6b77e4048cc3c4d82b763db Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 11:32:50 +0200 Subject: [PATCH 423/473] Normals etc. --- src/geometry/functional.c | 118 +++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 3 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index af0604b61..d71a9a284 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -5222,6 +5222,10 @@ static void jump_clearjumpside(jumpref *ref, jumpside *trace) { static void jump_clearinterfaceref(objectjumpinterfaceref *iref) { jump_clearjumpside(iref->jref, &iref->qplus); jump_clearjumpside(iref->jref, &iref->qminus); + if (iref->normal) { + object_free((object *) iref->normal); + iref->normal=NULL; + } } static void jump_orderparents(int *parents, elementid *plusid, elementid *minusid) { @@ -5232,7 +5236,103 @@ static void jump_orderparents(int *parents, elementid *plusid, elementid *minusi } } -static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elementid id, int nv, int *vid, int *parents, objectjumpinterfaceref *iref) { +static bool jump_getinterfacevertexpositions(objectmesh *mesh, int nv, int *vid, double **x) { + for (int i=0; idim; + for (int i=0; imesh->dim; + double pluscentroid[dim], minuscentroid[dim], d[dim]; + + if (!jump_getelementcentroid(iref->mesh, iref->plusnv, iref->plusvid, pluscentroid)) return false; + if (!jump_getelementcentroid(iref->mesh, iref->minusnv, iref->minusvid, minuscentroid)) return false; + + functional_vecsub(dim, minuscentroid, pluscentroid, d); + + objectmatrix *mnormal = object_newmatrix(dim, 1, false); + if (!mnormal) return false; + + for (int i=0; ielements[i]=0.0; + + if (iref->g==0) { + for (int i=0; ielements[i]=d[i]; + } else if (iref->g==1) { + double t[dim], n[dim]; + + functional_vecsub(dim, iref->vertexposn[1], iref->vertexposn[0], t); + double tnorm=functional_vecnorm(dim, t); + if (tnormelements); + } else if (iref->g==2) { + if (dim!=3) { object_free((object *) mnormal); return false; } + + double s0[3], s1[3]; + functional_vecsub(3, iref->vertexposn[1], iref->vertexposn[0], s0); + functional_vecsub(3, iref->vertexposn[2], iref->vertexposn[1], s1); + functional_veccross(s0, s1, mnormal->elements); + } else { + object_free((object *) mnormal); + return false; + } + + double nnorm=functional_vecnorm(dim, mnormal->elements); + if (nnormelements, d)<0.0) { + functional_vecscale(dim, -1.0, mnormal->elements, mnormal->elements); + } + + nnorm=functional_vecnorm(dim, mnormal->elements); + if (nnormelements, mnormal->elements); + + iref->normal=mnormal; + return true; +} + +static bool jump_preparegeometry(vm *v, objectjumpinterfaceref *iref, double **vertexposn) { + iref->vertexposn=vertexposn; + if (iref->g==0) iref->interfacesize=1.0; + else if (!functional_elementsize(v, iref->mesh, iref->g, iref->id, iref->nv, iref->vid, &iref->interfacesize)) return false; + + return jump_preparenormal(v, iref); +} + +static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elementid id, int nv, int *vid, double **vertexposn, int *parents, objectjumpinterfaceref *iref) { int plusnv=0, minusnv=0; int *plusvid=NULL, *minusvid=NULL; @@ -5255,6 +5355,11 @@ static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elem return false; } + if (!jump_preparegeometry(v, iref, vertexposn)) { + jump_clearinterfaceref(iref); + return false; + } + vm_settlvar(v, jumpinterfacehandle, MORPHO_OBJECT(iref)); return true; } @@ -5265,16 +5370,23 @@ static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elem static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *r, double *out) { jumpref *ref = (jumpref *) r; int nparents=0, *parents=NULL; + double *x[nv]; if (!jump_getadjacentparents(ref, id, &nparents, &parents)) return false; /* Boundary interfaces or malformed topology are ignored for now. */ if (nparents!=2) { *out=0.0; return true; } + if (!jump_getinterfacevertexpositions(mesh, nv, vid, x)) return false; + objectjumpinterfaceref iref; - if (!jump_prepareinterfaceref(v, mesh, ref, id, nv, vid, parents, &iref)) return false; + if (!jump_prepareinterfaceref(v, mesh, ref, id, nv, vid, x, parents, &iref)) return false; - fprintf(stderr, "Jump interface %d -> parent elements %d, %d\n", id, iref.plusid, iref.minusid); + fprintf(stderr, "Jump interface %d -> parent elements %d, %d normal [", id, iref.plusid, iref.minusid); + for (int i=0; idim; i++) { + fprintf(stderr, "%s%.15g", (i>0 ? ", " : ""), iref.normal->elements[i]); + } + fprintf(stderr, "]\n"); /* Placeholder until the two-sided trace machinery is implemented. */ *out=0.0; From 272ad91f2596cfb92d5f540cc9d1a90a4fad14c9 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 11:56:49 +0200 Subject: [PATCH 424/473] Centroid jump penalty --- src/geometry/functional.c | 198 +++++++++++++++++++++++++++++++++++--- src/geometry/functional.h | 4 + 2 files changed, 191 insertions(+), 11 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index d71a9a284..79a79ce55 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -3920,6 +3920,11 @@ typedef struct { typedef struct jumpref_s jumpref; +typedef enum { + JUMP_STRATEGY_CENTROID_MODE, + JUMP_STRATEGY_QUADRATURE_MODE +} jumpstrategy; + typedef struct { int nv; int *vid; @@ -4029,6 +4034,11 @@ typedef struct { objectmatrix *normal; // Canonical interface normal + double *pluslambda; // Parent-element barycentric coordinates on + side + double *minuslambda; // Parent-element barycentric coordinates on - side + double *posn; // Current physical position + value *qinterpolated; // Current interpolated quantities passed to the integrand + value *qplusgrad; // Per-side cached gradients, later value *qminusgrad; value *qplushess; // Per-side cached Hessians, later @@ -4057,7 +4067,7 @@ objecttype objectjumpinterfacereftype; #define MORPHO_ISJUMPINTERFACEREF(val) object_istype(val, OBJECT_JUMPINTERFACEREF) #define MORPHO_GETJUMPINTERFACEREF(val) ((objectjumpinterfaceref *) MORPHO_GETOBJECT(val)) -#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .g=grade, .id=id, .nv=nv, .vid=vid, .qplus={0}, .qminus={0}, .normal=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } +#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .g=grade, .id=id, .nv=nv, .vid=vid, .qplus={0}, .qminus={0}, .normal=NULL, .pluslambda=NULL, .minuslambda=NULL, .posn=NULL, .qinterpolated=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } int jumpinterfacehandle; @@ -5144,6 +5154,7 @@ struct jumpref_s { grade interfacegrade; objectsparse *interfaceparents; objectsparse *parentvertices; + jumpstrategy strategy; }; static bool jump_preparetopology(objectmesh *mesh, jumpref *ref) { @@ -5157,6 +5168,31 @@ static bool jump_preparetopology(objectmesh *mesh, jumpref *ref) { return (ref->interfaceparents!=NULL && ref->parentvertices!=NULL); } +static bool jump_preparestrategy(jumpref *ref) { + ref->strategy=JUMP_STRATEGY_CENTROID_MODE; + + if (!MORPHO_ISDICTIONARY(ref->integral.method)) return true; + + objectdictionary *dict=MORPHO_GETDICTIONARY(ref->integral.method); + objectstring strategylabel = MORPHO_STATICSTRING(JUMP_STRATEGY_LABEL); + value val=MORPHO_NIL; + + if (!dictionary_get(&dict->dict, MORPHO_OBJECT(&strategylabel), &val)) return true; + if (!MORPHO_ISSTRING(val)) return false; + + char *strategy=MORPHO_GETCSTRING(val); + if (strcmp(strategy, JUMP_STRATEGY_CENTROID)==0) { + ref->strategy=JUMP_STRATEGY_CENTROID_MODE; + return true; + } + if (strcmp(strategy, JUMP_STRATEGY_QUADRATURE)==0) { + ref->strategy=JUMP_STRATEGY_QUADRATURE_MODE; + return true; + } + + return false; +} + static value Jump_notimplemented(vm *v, int nargs, value *args) { morpho_runtimeerror(v, JUMP_UNIMPL); return MORPHO_NIL; @@ -5177,9 +5213,11 @@ static bool jump_prepareref(objectinstance *self, objectmesh *mesh, grade g, obj ref->interfacegrade=0; ref->interfaceparents=NULL; ref->parentvertices=NULL; + ref->strategy=JUMP_STRATEGY_CENTROID_MODE; if (!integral_prepareref(self, mesh, g, sel, &ref->integral)) return false; - return jump_preparetopology(mesh, ref); + if (!jump_preparetopology(mesh, ref)) return false; + return jump_preparestrategy(ref); } /** Get the adjacent parent elements for an interface. */ @@ -5243,6 +5281,14 @@ static bool jump_getinterfacevertexpositions(objectmesh *mesh, int nv, int *vid, return true; } +static void jump_centroid(unsigned int dim, int nv, double **x, double *out) { + for (unsigned int i=0; idim; for (int i=0; innodes; + double wts[nnodes]; + + if (q->ifn) { + (q->ifn) (lambda, wts); + } else { + if (nnodes!=1) return false; + wts[0]=1.0; + } + + return integrator_sumquantityweighted(nnodes, wts, q->vals, out); +} + +static bool jump_evaluatesidegradient(objectjumpinterfaceref *iref, int ifld, bool plus, double *grad) { + objectfield *fld = MORPHO_GETFIELD(iref->jref->integral.fields[ifld]); + jumpside *side = (plus ? &iref->qplus : &iref->qminus); + int nv = (plus ? iref->plusnv : iref->minusnv); + int *vid = (plus ? iref->plusvid : iref->minusvid); + double *lambda = (plus ? iref->pluslambda : iref->minuslambda); + int dim = iref->mesh->dim; + grade g = iref->jref->parentgrade; + + if (!MORPHO_ISFESPACE(fld->fnspc) || !MORPHO_ISNIL(fld->prototype)) return false; + + fespace *disc = MORPHO_GETFESPACE(fld->fnspc)->fespace; + if (!FESPACE_HASGRADIENT(disc)) return false; + + double *x[nv]; + if (!jump_getinterfacevertexpositions(iref->mesh, nv, vid, x)) return false; + + double invjdata[g*dim]; + objectmatrix invj = MORPHO_STATICMATRIX(invjdata, g, dim); + if (!integral_prepareinvjacobian(dim, g, x, &invj)) return false; + + int nnodes = disc->nnodes; + double gdata[nnodes*g]; + double fdata[nnodes*dim]; + objectmatrix gmat = MORPHO_STATICMATRIX(gdata, nnodes, g); + objectmatrix fmat = MORPHO_STATICMATRIX(fdata, nnodes, dim); + + fespace_gradient(disc, lambda, &gmat); + if (matrix_mul(&gmat, &invj, &fmat)!=MATRIX_OK) return false; + + for (int i=0; iquantities[ifld].vals, &sum)) return false; + if (!morpho_valuetofloat(sum, &grad[i])) return false; + } + + return true; +} + static bool jump_preparenormal(vm *v, objectjumpinterfaceref *iref) { int dim=iref->mesh->dim; double pluscentroid[dim], minuscentroid[dim], d[dim]; @@ -5379,17 +5495,51 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i if (!jump_getinterfacevertexpositions(mesh, nv, vid, x)) return false; + if (ref->strategy!=JUMP_STRATEGY_CENTROID_MODE) { + morpho_runtimeerror(v, JUMP_UNIMPL); + return false; + } + objectjumpinterfaceref iref; if (!jump_prepareinterfaceref(v, mesh, ref, id, nv, vid, x, parents, &iref)) return false; - fprintf(stderr, "Jump interface %d -> parent elements %d, %d normal [", id, iref.plusid, iref.minusid); - for (int i=0; idim; i++) { - fprintf(stderr, "%s%.15g", (i>0 ? ", " : ""), iref.normal->elements[i]); + double posn[mesh->dim]; + double pluslambda[iref.plusnv], minuslambda[iref.minusnv]; + value qinterp[ref->integral.nfields+1], outval=MORPHO_NIL; + objectmatrix mposn = MORPHO_STATICMATRIX(posn, mesh->dim, 1); + value args[ref->integral.nfields+1]; + double *xplus[iref.plusnv], *xminus[iref.minusnv]; + + jump_centroid(mesh->dim, nv, x, posn); + if (!jump_getinterfacevertexpositions(mesh, iref.plusnv, iref.plusvid, xplus) || + !jump_getinterfacevertexpositions(mesh, iref.minusnv, iref.minusvid, xminus) || + !jump_parentlambda(mesh->dim, ref->parentgrade, xplus, posn, pluslambda) || + !jump_parentlambda(mesh->dim, ref->parentgrade, xminus, posn, minuslambda)) { + jump_clearinterfaceref(&iref); + return false; } - fprintf(stderr, "]\n"); - /* Placeholder until the two-sided trace machinery is implemented. */ - *out=0.0; + iref.pluslambda=pluslambda; + iref.minuslambda=minuslambda; + iref.posn=posn; + iref.qinterpolated=qinterp; + + args[0]=MORPHO_OBJECT(&mposn); + for (int i=0; iintegral.nfields; i++) { + if (!jump_interpolatequantity(&iref.qplus.quantities[i], ref->parentgrade, pluslambda, &qinterp[i])) { + jump_clearinterfaceref(&iref); + return false; + } + args[i+1]=qinterp[i]; + } + + if (!morpho_call(v, ref->integral.integrand, ref->integral.nfields+1, args, &outval) || + !morpho_valuetofloat(outval, out)) { + jump_clearinterfaceref(&iref); + return false; + } + + *out *= iref.interfacesize; jump_clearinterfaceref(&iref); return true; } @@ -5429,11 +5579,37 @@ static value Jump_total(vm *v, int nargs, value *args) { } static value integral_jumpdnfn(vm *v, int nargs, value *args) { - objectintegralelementref *elref = integral_getelementref(v); - if (!elref) { + objectjumpinterfaceref *iref = jump_getinterfaceref(v); + if (!iref) { morpho_runtimeerror(v, INTEGRAL_SPCLFN, JUMPDN_FUNCTION); } else { - morpho_runtimeerror(v, JUMP_UNIMPL); + value q = MORPHO_GETARG(args, 0); + int ifld, xfld=-1; + + for (ifld=0; ifldjref->integral.nfields; ifld++) { + if (MORPHO_ISFIELD(q) && MORPHO_ISSAME(iref->jref->integral.originalfields[ifld], q)) break; + else if (iref->qinterpolated && MORPHO_ISSAME(iref->qinterpolated[ifld], q)) { + if (xfld>=0) { morpho_runtimeerror(v, INTEGRAL_AMBGSFLD); return MORPHO_NIL; } + xfld=ifld; + } + } + if (xfld>=0) ifld=xfld; + + if (ifld>=iref->jref->integral.nfields) { + morpho_runtimeerror(v, INTEGRAL_FLD); + return MORPHO_NIL; + } + + double gradplus[iref->mesh->dim], gradminus[iref->mesh->dim]; + if (!jump_evaluatesidegradient(iref, ifld, true, gradplus) || + !jump_evaluatesidegradient(iref, ifld, false, gradminus)) { + morpho_runtimeerror(v, JUMP_UNIMPL); + return MORPHO_NIL; + } + + double jp = functional_vecdot(iref->mesh->dim, gradplus, iref->normal->elements); + double jm = functional_vecdot(iref->mesh->dim, gradminus, iref->normal->elements); + return MORPHO_FLOAT(jp-jm); } return MORPHO_NIL; } diff --git a/src/geometry/functional.h b/src/geometry/functional.h index b4f66fe52..736105fb4 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -47,6 +47,10 @@ #define INTEGRAL_METHOD_PROPERTY "method" +#define JUMP_STRATEGY_LABEL "strategy" +#define JUMP_STRATEGY_QUADRATURE "quadrature" +#define JUMP_STRATEGY_CENTROID "centroid" + /* Functional methods */ #define FUNCTIONAL_INTEGRAND_METHOD "integrand" #define FUNCTIONAL_TOTAL_METHOD "total" From 08834d468cb15c067b5daa7220eacd1c433e9f78 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sat, 16 May 2026 22:11:12 +0200 Subject: [PATCH 425/473] First step towards quadrature --- src/geometry/functional.c | 85 ++++++++++++------- test/functionals/jump/jump1d.morpho | 2 +- .../functionals/jump/jump1d_quadrature.morpho | 9 ++ test/functionals/jump/jump2d.morpho | 2 +- .../functionals/jump/jump2d_quadrature.morpho | 18 ++++ test/functionals/jump/jump3d.morpho | 2 +- .../functionals/jump/jump3d_quadrature.morpho | 20 +++++ 7 files changed, 104 insertions(+), 34 deletions(-) create mode 100644 test/functionals/jump/jump1d_quadrature.morpho create mode 100644 test/functionals/jump/jump2d_quadrature.morpho create mode 100644 test/functionals/jump/jump3d_quadrature.morpho diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 79a79ce55..10c7581ae 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -5334,6 +5334,44 @@ static bool jump_interpolatequantity(quantity *q, grade g, double *lambda, value return integrator_sumquantityweighted(nnodes, wts, q->vals, out); } +static bool jump_preparepointdata(objectjumpinterfaceref *iref, double *posn, value *qinterp) { + jumpref *ref=iref->jref; + double *xplus[iref->plusnv], *xminus[iref->minusnv]; + + if (!jump_getinterfacevertexpositions(iref->mesh, iref->plusnv, iref->plusvid, xplus) || + !jump_getinterfacevertexpositions(iref->mesh, iref->minusnv, iref->minusvid, xminus) || + !jump_parentlambda(iref->mesh->dim, ref->parentgrade, xplus, posn, iref->pluslambda) || + !jump_parentlambda(iref->mesh->dim, ref->parentgrade, xminus, posn, iref->minuslambda)) return false; + + iref->posn=posn; + iref->qinterpolated=qinterp; + + for (int i=0; iintegral.nfields; i++) { + if (!jump_interpolatequantity(&iref->qplus.quantities[i], ref->parentgrade, iref->pluslambda, &qinterp[i])) return false; + } + + return true; +} + +static bool jump_callintegrand(objectjumpinterfaceref *iref, double *posn, double *out) { + jumpref *ref=iref->jref; + value qinterp[ref->integral.nfields+1], args[ref->integral.nfields+1], outval=MORPHO_NIL; + objectmatrix mposn = MORPHO_STATICMATRIX(posn, iref->mesh->dim, 1); + + if (!jump_preparepointdata(iref, posn, qinterp)) return false; + + args[0]=MORPHO_OBJECT(&mposn); + for (int i=0; iintegral.nfields; i++) args[i+1]=qinterp[i]; + + if (!morpho_call(ref->integral.v, ref->integral.integrand, ref->integral.nfields+1, args, &outval)) return false; + return morpho_valuetofloat(outval, out); +} + +static bool jump_integrandfn(unsigned int dim, double *t, double *x, unsigned int nquantity, value *quantity, void *ref, double *fout) { + objectjumpinterfaceref *iref = (objectjumpinterfaceref *) ref; + return jump_callintegrand(iref, x, fout); +} + static bool jump_evaluatesidegradient(objectjumpinterfaceref *iref, int ifld, bool plus, double *grad) { objectfield *fld = MORPHO_GETFIELD(iref->jref->integral.fields[ifld]); jumpside *side = (plus ? &iref->qplus : &iref->qminus); @@ -5488,6 +5526,8 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i int nparents=0, *parents=NULL; double *x[nv]; + ref->integral.v=v; + if (!jump_getadjacentparents(ref, id, &nparents, &parents)) return false; /* Boundary interfaces or malformed topology are ignored for now. */ @@ -5495,51 +5535,34 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i if (!jump_getinterfacevertexpositions(mesh, nv, vid, x)) return false; - if (ref->strategy!=JUMP_STRATEGY_CENTROID_MODE) { - morpho_runtimeerror(v, JUMP_UNIMPL); - return false; - } - objectjumpinterfaceref iref; if (!jump_prepareinterfaceref(v, mesh, ref, id, nv, vid, x, parents, &iref)) return false; - double posn[mesh->dim]; double pluslambda[iref.plusnv], minuslambda[iref.minusnv]; - value qinterp[ref->integral.nfields+1], outval=MORPHO_NIL; - objectmatrix mposn = MORPHO_STATICMATRIX(posn, mesh->dim, 1); - value args[ref->integral.nfields+1]; - double *xplus[iref.plusnv], *xminus[iref.minusnv]; - - jump_centroid(mesh->dim, nv, x, posn); - if (!jump_getinterfacevertexpositions(mesh, iref.plusnv, iref.plusvid, xplus) || - !jump_getinterfacevertexpositions(mesh, iref.minusnv, iref.minusvid, xminus) || - !jump_parentlambda(mesh->dim, ref->parentgrade, xplus, posn, pluslambda) || - !jump_parentlambda(mesh->dim, ref->parentgrade, xminus, posn, minuslambda)) { - jump_clearinterfaceref(&iref); - return false; - } - iref.pluslambda=pluslambda; iref.minuslambda=minuslambda; - iref.posn=posn; - iref.qinterpolated=qinterp; - args[0]=MORPHO_OBJECT(&mposn); - for (int i=0; iintegral.nfields; i++) { - if (!jump_interpolatequantity(&iref.qplus.quantities[i], ref->parentgrade, pluslambda, &qinterp[i])) { + if (ref->strategy==JUMP_STRATEGY_CENTROID_MODE || ref->interfacegrade==0) { + double posn[mesh->dim]; + jump_centroid(mesh->dim, nv, x, posn); + if (!jump_callintegrand(&iref, posn, out)) { jump_clearinterfaceref(&iref); return false; } - args[i+1]=qinterp[i]; - } - - if (!morpho_call(v, ref->integral.integrand, ref->integral.nfields+1, args, &outval) || - !morpho_valuetofloat(outval, out)) { + *out *= iref.interfacesize; + } else if (ref->strategy==JUMP_STRATEGY_QUADRATURE_MODE) { + double err=0.0; + if (!integrate(jump_integrandfn, MORPHO_GETDICTIONARY(ref->integral.method), morpho_geterror(v), mesh->dim, ref->interfacegrade, x, 0, NULL, &iref, out, &err)) { + jump_clearinterfaceref(&iref); + return false; + } + *out *= iref.interfacesize; + } else { + morpho_runtimeerror(v, JUMP_UNIMPL); jump_clearinterfaceref(&iref); return false; } - *out *= iref.interfacesize; jump_clearinterfaceref(&iref); return true; } diff --git a/test/functionals/jump/jump1d.morpho b/test/functionals/jump/jump1d.morpho index 9b78f2dbb..2a6690d4c 100644 --- a/test/functionals/jump/jump1d.morpho +++ b/test/functionals/jump/jump1d.morpho @@ -5,5 +5,5 @@ var m = LineMesh(fn (u) [u,0,0], 0..1:0.5) var fe = FiniteElementSpace("CG1", grade=1) var f = Field(m, fn (x,y,z) x^2, finiteelementspace=fe) -print abs(Jump(fn (x, q) jumpdn(q)^2, f).total(m) - 1) < 1e-8 +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "centroid" }).total(m) - 1) < 1e-8 // expect: true diff --git a/test/functionals/jump/jump1d_quadrature.morpho b/test/functionals/jump/jump1d_quadrature.morpho new file mode 100644 index 000000000..1b239cc4c --- /dev/null +++ b/test/functionals/jump/jump1d_quadrature.morpho @@ -0,0 +1,9 @@ +import meshtools + +var m = LineMesh(fn (u) [u,0,0], 0..1:0.5) + +var fe = FiniteElementSpace("CG1", grade=1) +var f = Field(m, fn (x,y,z) x^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }).total(m) - 1) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump2d.morpho b/test/functionals/jump/jump2d.morpho index 4bcc937ea..b703bd81e 100644 --- a/test/functionals/jump/jump2d.morpho +++ b/test/functionals/jump/jump2d.morpho @@ -14,5 +14,5 @@ m.addgrade(1) var fe = FiniteElementSpace("CG1", grade=2) var f = Field(m, fn (x,y,z) x*y, finiteelementspace=fe) -print abs(Jump(fn (x, q) jumpdn(q)^2, f).total(m) - 2*sqrt(2)) < 1e-8 +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "centroid" }).total(m) - 2*sqrt(2)) < 1e-8 // expect: true diff --git a/test/functionals/jump/jump2d_quadrature.morpho b/test/functionals/jump/jump2d_quadrature.morpho new file mode 100644 index 000000000..8b84f9ac5 --- /dev/null +++ b/test/functionals/jump/jump2d_quadrature.morpho @@ -0,0 +1,18 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG1", grade=2) +var f = Field(m, fn (x,y,z) x*y, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }).total(m) - 2*sqrt(2)) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump3d.morpho b/test/functionals/jump/jump3d.morpho index 14f43c1e2..e497fcceb 100644 --- a/test/functionals/jump/jump3d.morpho +++ b/test/functionals/jump/jump3d.morpho @@ -16,5 +16,5 @@ m.addgrade(2) var fe = FiniteElementSpace("CG1", grade=3) var f = Field(m, fn (x,y,z) z^2, finiteelementspace=fe) -print abs(Jump(fn (x, q) jumpdn(q)^2, f).total(m) - 2) < 1e-8 +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "centroid" }).total(m) - 2) < 1e-8 // expect: true diff --git a/test/functionals/jump/jump3d_quadrature.morpho b/test/functionals/jump/jump3d_quadrature.morpho new file mode 100644 index 000000000..d08b6cad5 --- /dev/null +++ b/test/functionals/jump/jump3d_quadrature.morpho @@ -0,0 +1,20 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvertex([0,0,-1]) +mb.addvolume([0,1,2,3]) +mb.addvolume([0,1,2,4]) + +var m = mb.build() +m.addgrade(1) +m.addgrade(2) + +var fe = FiniteElementSpace("CG1", grade=3) +var f = Field(m, fn (x,y,z) z^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }).total(m) - 2) < 1e-8 +// expect: true From 57ee435a2295275035012e7dc014e50ddea41142 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 17 May 2026 08:30:37 +0200 Subject: [PATCH 426/473] Tests with centroids and quadrature --- test/functionals/jump/jump2d_cg2.morpho | 18 +++++++++++++++++ .../jump/jump2d_cg2_quadrature.morpho | 18 +++++++++++++++++ test/functionals/jump/jump2d_cg3.morpho | 18 +++++++++++++++++ .../jump/jump2d_cg3_quadrature.morpho | 18 +++++++++++++++++ .../jump/jump3d_cg3_quadrature.morpho | 20 +++++++++++++++++++ 5 files changed, 92 insertions(+) create mode 100644 test/functionals/jump/jump2d_cg2.morpho create mode 100644 test/functionals/jump/jump2d_cg2_quadrature.morpho create mode 100644 test/functionals/jump/jump2d_cg3.morpho create mode 100644 test/functionals/jump/jump2d_cg3_quadrature.morpho create mode 100644 test/functionals/jump/jump3d_cg3_quadrature.morpho diff --git a/test/functionals/jump/jump2d_cg2.morpho b/test/functionals/jump/jump2d_cg2.morpho new file mode 100644 index 000000000..1e60cc77c --- /dev/null +++ b/test/functionals/jump/jump2d_cg2.morpho @@ -0,0 +1,18 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG2", grade=2) +var f = Field(m, fn (x,y,z) x*y^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "centroid" }).total(m) - 0) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump2d_cg2_quadrature.morpho b/test/functionals/jump/jump2d_cg2_quadrature.morpho new file mode 100644 index 000000000..147587279 --- /dev/null +++ b/test/functionals/jump/jump2d_cg2_quadrature.morpho @@ -0,0 +1,18 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG2", grade=2) +var f = Field(m, fn (x,y,z) x*y^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }).total(m) - 0.23570226039551584) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump2d_cg3.morpho b/test/functionals/jump/jump2d_cg3.morpho new file mode 100644 index 000000000..1c1549cb3 --- /dev/null +++ b/test/functionals/jump/jump2d_cg3.morpho @@ -0,0 +1,18 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y,z) x^3*y, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "centroid" }).total(m) - 0.00218242836478002) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump2d_cg3_quadrature.morpho b/test/functionals/jump/jump2d_cg3_quadrature.morpho new file mode 100644 index 000000000..d950f0b59 --- /dev/null +++ b/test/functionals/jump/jump2d_cg3_quadrature.morpho @@ -0,0 +1,18 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y,z) x^3*y, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }).total(m) - 0.024443198339536116) < 1e-8 +// expect: true diff --git a/test/functionals/jump/jump3d_cg3_quadrature.morpho b/test/functionals/jump/jump3d_cg3_quadrature.morpho new file mode 100644 index 000000000..d334d45a0 --- /dev/null +++ b/test/functionals/jump/jump3d_cg3_quadrature.morpho @@ -0,0 +1,20 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvertex([0,0,-1]) +mb.addvolume([0,1,2,3]) +mb.addvolume([0,1,2,4]) + +var m = mb.build() +m.addgrade(1) +m.addgrade(2) + +var fe = FiniteElementSpace("CG3", grade=3) +var f = Field(m, fn (x,y,z) x*y*z^2, finiteelementspace=fe) + +print abs(Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }).total(m) - 1/405) < 1e-8 +// expect: true From c7e9d3ed810e3599b578d0ca8e29cd7a32b30f30 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 17 May 2026 09:18:23 +0200 Subject: [PATCH 427/473] Fix dependencies --- src/geometry/functional.c | 108 ++++++++++++++++-- .../jump/jump2d_cg3_gradient.morpho | 29 +++++ .../jump/jump3d_cg3_gradient.morpho | 27 +++++ 3 files changed, 156 insertions(+), 8 deletions(-) create mode 100644 test/functionals/jump/jump2d_cg3_gradient.morpho create mode 100644 test/functionals/jump/jump3d_cg3_gradient.morpho diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 10c7581ae..944c45f1a 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -5193,11 +5193,6 @@ static bool jump_preparestrategy(jumpref *ref) { return false; } -static value Jump_notimplemented(vm *v, int nargs, value *args) { - morpho_runtimeerror(v, JUMP_UNIMPL); - return MORPHO_NIL; -} - /** Initialize a Jump object. For now this matches the existing integral optional-argument surface: 'method', 'mref' and 'weightbyreference'. */ @@ -5220,12 +5215,73 @@ static bool jump_prepareref(objectinstance *self, objectmesh *mesh, grade g, obj return jump_preparestrategy(ref); } +/** Clone a jump reference with a substituted field. */ +static void *jump_cloneref(void *ref, objectfield *field, objectfield *sub) { + jumpref *nref = (jumpref *) ref; + jumpref *clone = MORPHO_MALLOC(sizeof(jumpref)); + + if (clone) { + *clone = *nref; + clone->integral.originalfields=nref->integral.originalfields; + clone->integral.fields=MORPHO_MALLOC(sizeof(value)*clone->integral.nfields); + if (!clone->integral.fields) { MORPHO_FREE(clone); return NULL; } + + for (int i=0; iintegral.nfields; i++) { + clone->integral.fields[i]=nref->integral.fields[i]; + if (MORPHO_ISFIELD(nref->integral.fields[i]) && + MORPHO_GETFIELD(nref->integral.fields[i])==field) { + clone->integral.fields[i]=MORPHO_OBJECT(sub); + } + } + } + + return clone; +} + +/** Free a cloned jump reference. */ +static void jump_freeref(void *ref) { + jumpref *nref = (jumpref *) ref; + MORPHO_FREE(nref->integral.fields); + MORPHO_FREE(ref); +} + /** Get the adjacent parent elements for an interface. */ static bool jump_getadjacentparents(jumpref *ref, elementid interfaceid, int *nparents, int **parents) { if (!ref->interfaceparents) return false; return mesh_getconnectivity(ref->interfaceparents, interfaceid, nparents, parents); } +/** Return mesh vertices outside the interface that still influence the jump term + through the two adjacent parent elements. */ +static bool jump_dependencies(functional_mapinfo *info, elementid id, varray_elementid *out) { + jumpref *ref = (jumpref *) info->ref; + int nparents=0, *parents=NULL; + + if (!jump_getadjacentparents(ref, id, &nparents, &parents)) return false; + if (nparents!=2) return true; + + int interface_nv=0, *interface_vid=NULL; + objectsparse *ifaceverts=NULL; + int n=0; + + if (!functional_countelements(NULL, info->mesh, ref->interfacegrade, &n, &ifaceverts)) return false; + (void) n; + if (!ifaceverts) return false; + if (!sparseccs_getrowindices(&ifaceverts->ccs, id, &interface_nv, &interface_vid)) return false; + + for (int p=0; pparentvertices, parents[p], &parent_nv, &parent_vid)) return false; + for (int j=0; jnv=nv; trace->vid=vid; @@ -5601,6 +5657,43 @@ static value Jump_total(vm *v, int nargs, value *args) { return out; } +static value Jump_gradient(vm *v, int nargs, value *args) { + functional_mapinfo info; + jumpref ref; + value out=MORPHO_NIL; + + if (functional_validateargs(v, nargs, args, &info)) { + if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { + info.g=ref.interfacegrade; + info.integrand=jump_scan_integrand; + info.dependencies=jump_dependencies; + info.ref=&ref; + functional_mapnumericalgradient(v, &info, &out); + } else morpho_runtimeerror(v, JUMP_UNIMPL); + } + if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); + return out; +} + +static value Jump_fieldgradient(vm *v, int nargs, value *args) { + functional_mapinfo info; + jumpref ref; + value out=MORPHO_NIL; + + if (functional_validateargs(v, nargs, args, &info)) { + if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { + info.g=ref.interfacegrade; + info.integrand=jump_scan_integrand; + info.cloneref=jump_cloneref; + info.freeref=jump_freeref; + info.ref=&ref; + functional_mapnumericalfieldgradient(v, &info, &out); + } else morpho_runtimeerror(v, JUMP_UNIMPL); + } + if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); + return out; +} + static value integral_jumpdnfn(vm *v, int nargs, value *args) { objectjumpinterfaceref *iref = jump_getinterfaceref(v); if (!iref) { @@ -5641,9 +5734,8 @@ MORPHO_BEGINCLASS(Jump) MORPHO_METHOD(MORPHO_INITIALIZER_METHOD, Jump_init, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FUNCTIONAL_INTEGRAND_METHOD, Jump_integrand, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FUNCTIONAL_TOTAL_METHOD, Jump_total, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Jump_notimplemented, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, Jump_notimplemented, BUILTIN_FLAGSEMPTY), -MORPHO_METHOD(FUNCTIONAL_HESSIAN_METHOD, Jump_notimplemented, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(FUNCTIONAL_GRADIENT_METHOD, Jump_gradient, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FUNCTIONAL_FIELDGRADIENT_METHOD, Jump_fieldgradient, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/test/functionals/jump/jump2d_cg3_gradient.morpho b/test/functionals/jump/jump2d_cg3_gradient.morpho new file mode 100644 index 000000000..76b4c037d --- /dev/null +++ b/test/functionals/jump/jump2d_cg3_gradient.morpho @@ -0,0 +1,29 @@ +import meshtools +import "../numericalderivatives.morpho" + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([1,1,0]) +mb.addface([0,1,2]) +mb.addface([1,3,2]) + +var m = mb.build() +m.addgrade(1) + +var fe = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y,z) x^3*y, finiteelementspace=fe) + +var j = Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }) +var tol = 2e-5 + +print (j.gradient(m) - numericalgradient(j, m)).norm() < tol +// expect: true + +print (j.fieldgradient(m, f) - numericalfieldgradient(j, m, f)).linearize().norm() < tol +// expect: true + +print (j.gradient(m) - numericalgradient(j, m)).norm() + +print (j.fieldgradient(m, f) - numericalfieldgradient(j, m, f)).linearize().norm() diff --git a/test/functionals/jump/jump3d_cg3_gradient.morpho b/test/functionals/jump/jump3d_cg3_gradient.morpho new file mode 100644 index 000000000..20acb3290 --- /dev/null +++ b/test/functionals/jump/jump3d_cg3_gradient.morpho @@ -0,0 +1,27 @@ +import meshtools +import "../numericalderivatives.morpho" + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvertex([0,0,-1]) +mb.addvolume([0,1,2,3]) +mb.addvolume([0,1,2,4]) + +var m = mb.build() +m.addgrade(1) +m.addgrade(2) + +var fe = FiniteElementSpace("CG3", grade=3) +var f = Field(m, fn (x,y,z) x*y*z^2, finiteelementspace=fe) + +var j = Jump(fn (x, q) jumpdn(q)^2, f, method={ "strategy": "quadrature" }) +var tol = 2e-5 + +print (j.gradient(m) - numericalgradient(j, m)).norm() < tol +// expect: true + +print (j.fieldgradient(m, f) - numericalfieldgradient(j, m, f)).linearize().norm() < tol +// expect: true From b0e9bf76b8886e7eacde2c93c1eea5e2c57e7897 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 17 May 2026 10:04:21 +0200 Subject: [PATCH 428/473] Fieldgradients for jump --- examples/elementtypes/qtensorCG2.morpho | 1 - src/geometry/functional.c | 255 +++++++++++++++++- .../jump/jump2d_cg3_gradient.morpho | 4 - 3 files changed, 252 insertions(+), 8 deletions(-) diff --git a/examples/elementtypes/qtensorCG2.morpho b/examples/elementtypes/qtensorCG2.morpho index edc6a0920..50559d654 100644 --- a/examples/elementtypes/qtensorCG2.morpho +++ b/examples/elementtypes/qtensorCG2.morpho @@ -64,7 +64,6 @@ class QTensor { self.problem.addenergy(anchor, selection=self.bnd, prefactor = self.EA) // The elastic energy is the grad-squared of the q-tensor - fn elasticity(x, q) { var g = grad(q) return g[0].inner(g[0]) + g[1].inner(g[1]) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 944c45f1a..64f22bbdb 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -30,6 +30,10 @@ value functional_gradeproperty; value functional_fieldproperty; //static value functional_functionproperty; +typedef struct jumpref_s jumpref; +static bool jump_getadjacentparents(jumpref *ref, elementid interfaceid, int *nparents, int **parents); +static void jump_orderparents(int *parents, elementid *plusid, elementid *minusid); + /* ********************************************************************** * Utility functions * ********************************************************************** */ @@ -1315,13 +1319,52 @@ bool functional_numericalfieldgrad(vm *v, objectmesh *mesh, elementid eid, objec return true; } +/** Computes the field gradient of element eid with respect to a single field dof. */ +bool functional_numericalfieldgradentry(vm *v, objectmesh *mesh, elementid eid, objectfield *field, grade g, elementid i, int indx, int nv, int *vid, functional_integrand *integrand, void *ref, objectfield *grad) { + double fr, fl, eps=1e-6; + unsigned int nentries; + double *entry, *gentry; + + if (!field_getelementaslist(field, g, i, indx, &nentries, &entry)) return false; + if (!field_getelementaslist(grad, g, i, indx, &nentries, &gentry)) return false; + + for (unsigned int j=0; jinfo->g==0 ? 1 : 0), *vid=(tref->info->g==0 ? &remoteid : NULL); + + if (tref->conn) { + if (!sparseccs_getrowindices(&tref->conn->ccs, remoteid, &nv, &vid)) return false; + } + + return functional_numericalfieldgradentry(v, tref->info->mesh, remoteid, tref->field, g, i, indx, nv, vid, tref->integrand, tref->ref, grad); +} + /** Computes the gradient of element id with respect to its constituent vertices and any dependencies */ bool functional_numericalfieldgradientmapfn(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, void *out) { functional_numericalfieldgradientref *tref=(functional_numericalfieldgradientref *) ref; @@ -1332,13 +1375,41 @@ bool functional_numericalfieldgradientmapfn(vm *v, objectmesh *mesh, elementid i if (fespace_doftofieldindx(tref->field, tref->disc, nv, vid, findx)) { for (int k=0; kfield, findx[k].g, findx[k].id, nv, vid, tref->integrand, tref->ref, out)) return false; + if (!functional_numericalfieldgradentry(v, mesh, id, tref->field, findx[k].g, findx[k].id, findx[k].indx, nv, vid, tref->integrand, tref->ref, out)) return false; + + if (tref->info->dependencies) { + varray_elementid dependencies; + varray_elementidinit(&dependencies); + if ((tref->info->dependencies)(tref->info, id, &dependencies)) { + for (int j=0; jfield, MESH_GRADE_VERTEX, vid[k], nv, vid, tref->integrand, tref->ref, out)) return false; + + if (tref->info->dependencies) { + varray_elementid dependencies; + varray_elementidinit(&dependencies); + if ((tref->info->dependencies)(tref->info, id, &dependencies)) { + for (int j=0; jcloneref) { tref[i].ref=(info->cloneref) (info->ref, info->field, fieldclones[i]); } else UNREACHABLE("Functional calls numericalfieldgradient but doesn't provide cloneref"); + tref[i].info=info; tref[i].integrand=info->integrand; tref[i].field=fieldclones[i]; + tref[i].conn=mesh_getconnectivityelement(info->mesh, 0, info->g); tref[i].disc=NULL; if (MORPHO_ISFESPACE(tref[i].field->fnspc)) { tref[i].disc=MORPHO_GETFESPACE(tref[i].field->fnspc)->fespace; @@ -1421,6 +1494,159 @@ bool functional_mapnumericalfieldgradient(vm *v, functional_mapinfo *info, value return success; } +typedef struct { + functional_mapinfo *info; + objectfield *field; + fespace *disc; + objectsparse *conn; + objectsparse *parentvertices; + jumpref *ref; +} jump_numericalfieldgradientref; + +static bool jump_getelementvertices(objectsparse *conn, grade g, elementid id, int *nv, int **vid) { + if (conn) return sparseccs_getrowindices(&conn->ccs, id, nv, vid); + if (g==0) { + *nv=1; + *vid=&id; + return true; + } + return false; +} + +static bool jump_collectparentfieldentries(jump_numericalfieldgradientref *tref, elementid interfaceid, fieldindx *findxout, int *nentries) { + jumpref *ref=tref->ref; + int nparents=0, *parents=NULL; + int plusnv=0, minusnv=0, *plusvid=NULL, *minusvid=NULL; + + *nentries=0; + if (!jump_getadjacentparents(ref, interfaceid, &nparents, &parents)) return false; + if (nparents!=2) return true; + + elementid plusid, minusid; + jump_orderparents(parents, &plusid, &minusid); + + if (!mesh_getconnectivity(tref->parentvertices, plusid, &plusnv, &plusvid)) return false; + if (!mesh_getconnectivity(tref->parentvertices, minusid, &minusnv, &minusvid)) return false; + + fieldindx findx[tref->disc->nnodes]; + if (!fespace_doftofieldindx(tref->field, tref->disc, plusnv, plusvid, findx)) return false; + for (int i=0; idisc->nnodes; i++) { + bool found=false; + for (int j=0; j<*nentries; j++) { + if (findxout[j].g==findx[i].g && findxout[j].id==findx[i].id && findxout[j].indx==findx[i].indx) { found=true; break; } + } + if (!found) { + findxout[*nentries]=findx[i]; + (*nentries)++; + } + } + + if (!fespace_doftofieldindx(tref->field, tref->disc, minusnv, minusvid, findx)) return false; + for (int i=0; idisc->nnodes; i++) { + bool found=false; + for (int j=0; j<*nentries; j++) { + if (findxout[j].g==findx[i].g && findxout[j].id==findx[i].id && findxout[j].indx==findx[i].indx) { found=true; break; } + } + if (!found) { + findxout[*nentries]=findx[i]; + (*nentries)++; + } + } + + return true; +} + +static bool jump_numericalfieldgradientmapfn(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, void *ref, void *out) { + jump_numericalfieldgradientref *tref=(jump_numericalfieldgradientref *) ref; + fieldindx findx[2*tref->disc->nnodes]; + int nentries=0; + + if (!jump_collectparentfieldentries(tref, id, findx, &nentries)) return false; + + for (int k=0; kfield, findx[k].g, findx[k].id, findx[k].indx, nv, vid, tref->info->integrand, tref->ref, out)) return false; + + if (tref->info->dependencies) { + varray_elementid dependencies; + varray_elementidinit(&dependencies); + if ((tref->info->dependencies)(tref->info, id, &dependencies)) { + for (int j=0; jconn, tref->info->g, dependencies.data[j], &rnv, &rvid)) { + varray_elementidclear(&dependencies); + return false; + } + if (!functional_numericalfieldgradentry(v, mesh, dependencies.data[j], tref->field, findx[k].g, findx[k].id, findx[k].indx, rnv, rvid, tref->info->integrand, tref->ref, out)) { + varray_elementidclear(&dependencies); + return false; + } + } + } + varray_elementidclear(&dependencies); + } + } + + return true; +} + +static bool functional_mapjumpnumericalfieldgradient(vm *v, functional_mapinfo *info, objectsparse *parentvertices, void *baseref, value *out) { + int success=false; + int ntask=morpho_threadnumber(); + if (ntask<1) ntask=1; + functional_task task[ntask]; + + varray_elementid imageids; + varray_elementidinit(&imageids); + + objectfield *new[ntask]; + objectfield *fieldclones[ntask]; + jump_numericalfieldgradientref tref[ntask]; + for (int i=0; imesh, info->field->prototype, info->field->fnspc, info->field->dof); + if (!new[i]) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); goto functional_mapjumpfieldgradient_cleanup; } + field_zero(new[i]); + + fieldclones[i]=field_clone(info->field); + tref[i].field=fieldclones[i]; + tref[i].info=info; + tref[i].conn=mesh_getconnectivityelement(info->mesh, 0, info->g); + tref[i].parentvertices=parentvertices; + tref[i].ref=(jumpref *) ((info->cloneref) ? (info->cloneref)(baseref, info->field, fieldclones[i]) : baseref); + if (!tref[i].ref) goto functional_mapjumpfieldgradient_cleanup; + tref[i].disc=NULL; + if (MORPHO_ISFESPACE(tref[i].field->fnspc)) tref[i].disc=MORPHO_GETFESPACE(tref[i].field->fnspc)->fespace; + if (!tref[i].disc) goto functional_mapjumpfieldgradient_cleanup; + + task[i].ref=(void *) &tref[i]; + task[i].mapfn=jump_numericalfieldgradientmapfn; + task[i].result=(void *) new[i]; + } + + functional_parallelmap(ntask, task); + + for (int i=1; idata, &new[i]->data, &new[0]->data); + + success=true; + *out=MORPHO_OBJECT(new[0]); + +functional_mapjumpfieldgradient_cleanup: + for (int i=0; ifreeref && tref[i].ref) (info->freeref)(tref[i].ref); + else if (info->cloneref && tref[i].ref) MORPHO_FREE(tref[i].ref); + object_free((object *) fieldclones[i]); + if (i>0 && new[i]) object_free((object *) new[i]); + } + functional_cleanuptasks(v, ntask, task); + varray_elementidclear(&imageids); + return success; +} + /* ---------------------------- * Map numerical hessians * ---------------------------- */ @@ -5153,6 +5379,7 @@ struct jumpref_s { grade parentgrade; grade interfacegrade; objectsparse *interfaceparents; + objectsparse *parentinterfaces; objectsparse *parentvertices; jumpstrategy strategy; }; @@ -5163,9 +5390,10 @@ static bool jump_preparetopology(objectmesh *mesh, jumpref *ref) { ref->interfacegrade=ref->parentgrade-1; ref->interfaceparents=mesh_addconnectivityelement(mesh, ref->parentgrade, ref->interfacegrade); + ref->parentinterfaces=mesh_addconnectivityelement(mesh, ref->interfacegrade, ref->parentgrade); ref->parentvertices=mesh_getconnectivityelement(mesh, 0, ref->parentgrade); - return (ref->interfaceparents!=NULL && ref->parentvertices!=NULL); + return (ref->interfaceparents!=NULL && ref->parentinterfaces!=NULL && ref->parentvertices!=NULL); } static bool jump_preparestrategy(jumpref *ref) { @@ -5207,6 +5435,7 @@ static bool jump_prepareref(objectinstance *self, objectmesh *mesh, grade g, obj ref->parentgrade=0; ref->interfacegrade=0; ref->interfaceparents=NULL; + ref->parentinterfaces=NULL; ref->parentvertices=NULL; ref->strategy=JUMP_STRATEGY_CENTROID_MODE; @@ -5282,6 +5511,25 @@ static bool jump_dependencies(functional_mapinfo *info, elementid id, varray_ele return true; } +/** Return interface elements that share one of the adjacent parent elements. */ +static bool jump_fielddependencies(functional_mapinfo *info, elementid id, varray_elementid *out) { + jumpref *ref = (jumpref *) info->ref; + int nparents=0, *parents=NULL; + + if (!jump_getadjacentparents(ref, id, &nparents, &parents)) return false; + if (nparents!=2) return true; + + for (int p=0; pparentinterfaces, parents[p], &nifaces, &ifaces)) return false; + for (int j=0; jnv=nv; trace->vid=vid; @@ -5684,10 +5932,11 @@ static value Jump_fieldgradient(vm *v, int nargs, value *args) { if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; + info.dependencies=jump_fielddependencies; info.cloneref=jump_cloneref; info.freeref=jump_freeref; info.ref=&ref; - functional_mapnumericalfieldgradient(v, &info, &out); + functional_mapjumpnumericalfieldgradient(v, &info, ref.parentvertices, &ref, &out); } else morpho_runtimeerror(v, JUMP_UNIMPL); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); diff --git a/test/functionals/jump/jump2d_cg3_gradient.morpho b/test/functionals/jump/jump2d_cg3_gradient.morpho index 76b4c037d..08f8117b5 100644 --- a/test/functionals/jump/jump2d_cg3_gradient.morpho +++ b/test/functionals/jump/jump2d_cg3_gradient.morpho @@ -23,7 +23,3 @@ print (j.gradient(m) - numericalgradient(j, m)).norm() < tol print (j.fieldgradient(m, f) - numericalfieldgradient(j, m, f)).linearize().norm() < tol // expect: true - -print (j.gradient(m) - numericalgradient(j, m)).norm() - -print (j.fieldgradient(m, f) - numericalfieldgradient(j, m, f)).linearize().norm() From 587394bbb3f2b81f2c0f494d782b4db3f46ac866 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 17 May 2026 12:43:43 +0200 Subject: [PATCH 429/473] Fix multithreaded jump --- src/geometry/functional.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 64f22bbdb..e017e2794 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4239,6 +4239,7 @@ objectintegralelementref *integral_getelementref(vm *v) { typedef struct { object obj; objectmesh *mesh; // The current mesh object + vm *v; // Worker VM for callbacks on this interface jumpref *jref; // Shared Jump reference @@ -4293,7 +4294,7 @@ objecttype objectjumpinterfacereftype; #define MORPHO_ISJUMPINTERFACEREF(val) object_istype(val, OBJECT_JUMPINTERFACEREF) #define MORPHO_GETJUMPINTERFACEREF(val) ((objectjumpinterfaceref *) MORPHO_GETOBJECT(val)) -#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .g=grade, .id=id, .nv=nv, .vid=vid, .qplus={0}, .qminus={0}, .normal=NULL, .pluslambda=NULL, .minuslambda=NULL, .posn=NULL, .qinterpolated=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } +#define MORPHO_STATICJUMPINTERFACEREF(mesh, grade, id, nv, vid) { .obj.type=OBJECT_JUMPINTERFACEREF, .obj.status=OBJECT_ISUNMANAGED, .obj.next=NULL, .mesh=mesh, .v=NULL, .g=grade, .id=id, .nv=nv, .vid=vid, .qplus={0}, .qminus={0}, .normal=NULL, .pluslambda=NULL, .minuslambda=NULL, .posn=NULL, .qinterpolated=NULL, .qplusgrad=NULL, .qminusgrad=NULL, .qplushess=NULL, .qminushess=NULL } int jumpinterfacehandle; @@ -5564,6 +5565,14 @@ static void jump_clearjumpside(jumpref *ref, jumpside *trace) { static void jump_clearinterfaceref(objectjumpinterfaceref *iref) { jump_clearjumpside(iref->jref, &iref->qplus); jump_clearjumpside(iref->jref, &iref->qminus); + if (iref->pluslambda) { + MORPHO_FREE(iref->pluslambda); + iref->pluslambda=NULL; + } + if (iref->minuslambda) { + MORPHO_FREE(iref->minuslambda); + iref->minuslambda=NULL; + } if (iref->normal) { object_free((object *) iref->normal); iref->normal=NULL; @@ -5667,7 +5676,7 @@ static bool jump_callintegrand(objectjumpinterfaceref *iref, double *posn, doubl args[0]=MORPHO_OBJECT(&mposn); for (int i=0; iintegral.nfields; i++) args[i+1]=qinterp[i]; - if (!morpho_call(ref->integral.v, ref->integral.integrand, ref->integral.nfields+1, args, &outval)) return false; + if (!morpho_call(iref->v, ref->integral.integrand, ref->integral.nfields+1, args, &outval)) return false; return morpho_valuetofloat(outval, out); } @@ -5795,6 +5804,7 @@ static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elem int *plusvid=NULL, *minusvid=NULL; *iref = (objectjumpinterfaceref) MORPHO_STATICJUMPINTERFACEREF(mesh, ref->interfacegrade, id, nv, vid); + iref->v=v; iref->jref=ref; jump_orderparents(parents, &iref->plusid, &iref->minusid); @@ -5806,10 +5816,19 @@ static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elem iref->plusvid=plusvid; iref->minusnv=minusnv; iref->minusvid=minusvid; + iref->pluslambda=MORPHO_MALLOC(sizeof(double)*iref->plusnv); + iref->minuslambda=MORPHO_MALLOC(sizeof(double)*iref->minusnv); + if (!iref->pluslambda || !iref->minuslambda) { + jump_clearinterfaceref(iref); + return false; + } - if (!jump_preparejumpside(ref, iref->plusnv, iref->plusvid, &iref->qplus)) return false; + if (!jump_preparejumpside(ref, iref->plusnv, iref->plusvid, &iref->qplus)) { + jump_clearinterfaceref(iref); + return false; + } if (!jump_preparejumpside(ref, iref->minusnv, iref->minusvid, &iref->qminus)) { - jump_clearjumpside(ref, &iref->qplus); + jump_clearinterfaceref(iref); return false; } @@ -5818,7 +5837,6 @@ static bool jump_prepareinterfaceref(vm *v, objectmesh *mesh, jumpref *ref, elem return false; } - vm_settlvar(v, jumpinterfacehandle, MORPHO_OBJECT(iref)); return true; } @@ -5830,8 +5848,6 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i int nparents=0, *parents=NULL; double *x[nv]; - ref->integral.v=v; - if (!jump_getadjacentparents(ref, id, &nparents, &parents)) return false; /* Boundary interfaces or malformed topology are ignored for now. */ @@ -5841,15 +5857,13 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i objectjumpinterfaceref iref; if (!jump_prepareinterfaceref(v, mesh, ref, id, nv, vid, x, parents, &iref)) return false; - - double pluslambda[iref.plusnv], minuslambda[iref.minusnv]; - iref.pluslambda=pluslambda; - iref.minuslambda=minuslambda; + vm_settlvar(v, jumpinterfacehandle, MORPHO_OBJECT(&iref)); if (ref->strategy==JUMP_STRATEGY_CENTROID_MODE || ref->interfacegrade==0) { double posn[mesh->dim]; jump_centroid(mesh->dim, nv, x, posn); if (!jump_callintegrand(&iref, posn, out)) { + vm_settlvar(v, jumpinterfacehandle, MORPHO_NIL); jump_clearinterfaceref(&iref); return false; } @@ -5857,16 +5871,19 @@ static bool jump_scan_integrand(vm *v, objectmesh *mesh, elementid id, int nv, i } else if (ref->strategy==JUMP_STRATEGY_QUADRATURE_MODE) { double err=0.0; if (!integrate(jump_integrandfn, MORPHO_GETDICTIONARY(ref->integral.method), morpho_geterror(v), mesh->dim, ref->interfacegrade, x, 0, NULL, &iref, out, &err)) { + vm_settlvar(v, jumpinterfacehandle, MORPHO_NIL); jump_clearinterfaceref(&iref); return false; } *out *= iref.interfacesize; } else { morpho_runtimeerror(v, JUMP_UNIMPL); + vm_settlvar(v, jumpinterfacehandle, MORPHO_NIL); jump_clearinterfaceref(&iref); return false; } + vm_settlvar(v, jumpinterfacehandle, MORPHO_NIL); jump_clearinterfaceref(&iref); return true; } From 600ca7f05bf5a800ad5de9731965f741d773e4bc Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 18 May 2026 16:00:27 +0200 Subject: [PATCH 430/473] Fix error messages and checks --- src/geometry/field.c | 12 +- src/geometry/functional.c | 67 ++- src/geometry/functional.h | 11 +- src/geometry/integrate.c | 19 +- .../jump/jump2d_cg3_wave_diagnostics.morpho | 60 ++ test/functionals/smectic/qtensortools.xmorpho | 120 ++++ .../smectic_fieldgradient_diagnostic.xmorpho | 45 ++ .../smectic_stage_gradientcheck.xmorpho | 134 +++++ .../smectic/smectic_staged_demo.xmorpho | 518 ++++++++++++++++++ 9 files changed, 954 insertions(+), 32 deletions(-) create mode 100644 test/functionals/jump/jump2d_cg3_wave_diagnostics.morpho create mode 100644 test/functionals/smectic/qtensortools.xmorpho create mode 100644 test/functionals/smectic/smectic_fieldgradient_diagnostic.xmorpho create mode 100644 test/functionals/smectic/smectic_stage_gradientcheck.xmorpho create mode 100644 test/functionals/smectic/smectic_staged_demo.xmorpho diff --git a/src/geometry/field.c b/src/geometry/field.c index 211d0f375..65f0706a6 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -385,9 +385,19 @@ bool field_getelementwithindex(objectfield *field, int indx, value *out) { * @param[in] indx - index within the element * @param[out] out - the retrieved index * @return true on success */ +static bool field_validateaccess(objectfield *field, grade grade, elementid el, int indx) { + if (!field) return false; + if (grade<0 || grade>=field->ngrades) return false; + if (el<0) return false; + if (indx<0 || indx>=field->dof[grade]) return false; + return true; +} + bool field_getindex(objectfield *field, grade grade, elementid el, int indx, int *out) { + if (!out || !field_validateaccess(field, grade, el, indx)) return false; + int ix=field->offset[grade]+field->dof[grade]*el+indx; - if (!(ixoffset[grade+1] && indxdof[grade])) return false; + if (!(ixoffset[grade+1])) return false; *out=ix; return true; diff --git a/src/geometry/functional.c b/src/geometry/functional.c index e017e2794..e99cbfe35 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4909,9 +4909,10 @@ void integral_clearelref(objectintegralelementref *elref) { /** Prepares quantity list */ bool integral_preparequantities(integralref *iref, int nv, int *vid, quantity *quantities) { - bool success=false; + bool success=true; for (int k=0; knfields; k++) { objectfield *f=MORPHO_GETFIELD(iref->fields[k]); + quantities[k].vals=NULL; if (MORPHO_ISFESPACE(f->fnspc)) { fespace *disc=MORPHO_GETFESPACE(f->fnspc)->fespace; @@ -4923,21 +4924,23 @@ bool integral_preparequantities(integralref *iref, int nv, int *vid, quantity *q quantities[k].ifn=disc->ifn; fieldindx findx[disc->nnodes]; - fespace_doftofieldindx(f, disc, nv, vid, findx); + if (!fespace_doftofieldindx(f, disc, nv, vid, findx)) return false; quantities[k].vals=MORPHO_MALLOC(sizeof(value)*disc->nnodes); + if (!quantities[k].vals) return false; for (int i=0; innodes; i++) { int dof; - field_getindex(f, findx[i].g, findx[i].id, findx[i].indx, &dof); - field_getelementwithindex(f, dof, &quantities[k].vals[i]); + if (!field_getindex(f, findx[i].g, findx[i].id, findx[i].indx, &dof)) return false; + if (!field_getelementwithindex(f, dof, &quantities[k].vals[i])) return false; } success=true; } else { quantities[k].nnodes=nv; quantities[k].ifn=NULL; quantities[k].vals=MORPHO_MALLOC(sizeof(value)*nv); + if (!quantities[k].vals) return false; for (unsigned int i=0; idim, MESH_GRADE_LINE, x, iref.nfields, quantities, &iref, out, &err); @@ -5049,13 +5055,13 @@ bool lineintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * return success; } -FUNCTIONAL_METHOD(LineIntegral, integrand, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapintegrand, lineintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(LineIntegral, integrand, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapintegrand, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(LineIntegral, total, MESH_GRADE_LINE, integralref, integral_prepareref, functional_sumintegrand, lineintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(LineIntegral, total, MESH_GRADE_LINE, integralref, integral_prepareref, functional_sumintegrand, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(LineIntegral, gradient, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapnumericalgradient, lineintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(LineIntegral, gradient, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapnumericalgradient, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(LineIntegral, hessian, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapnumericalhessian, lineintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE) +FUNCTIONAL_METHOD(LineIntegral, hessian, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapnumericalhessian, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE) /** Initialize a LineIntegral object */ value LineIntegral_init(vm *v, int nargs, value *args) { @@ -5135,7 +5141,7 @@ value LineIntegral_fieldgradient(vm *v, int nargs, value *args) { info.freeref=integral_freeref; info.ref=&ref; functional_mapnumericalfieldgradient(v, &info, &out); - } else morpho_runtimeerror(v, GRADSQ_ARGS); + } else morpho_runtimeerror(v, LINEINTEGRAL_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); return out; @@ -5188,7 +5194,10 @@ bool areaintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * if (MORPHO_ISDICTIONARY(iref.method)) { double err; quantity quantities[iref.nfields+1]; - integral_preparequantities(&iref, nv, vid, quantities); + if (!integral_preparequantities(&iref, nv, vid, quantities)) { + integral_clearelref(&elref); + return false; + } elref.quantities=quantities; success=integrate(integral_integrandfn, MORPHO_GETDICTIONARY(iref.method), morpho_geterror(v), mesh->dim, MESH_GRADE_AREA, x, iref.nfields, quantities, &iref, out, &err); @@ -5228,11 +5237,11 @@ bool areaintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * return success; } -FUNCTIONAL_METHOD(AreaIntegral, integrand, MESH_GRADE_AREA, integralref, integral_prepareref, functional_mapintegrand, areaintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(AreaIntegral, integrand, MESH_GRADE_AREA, integralref, integral_prepareref, functional_mapintegrand, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(AreaIntegral, total, MESH_GRADE_AREA, integralref, integral_prepareref, functional_sumintegrand, areaintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(AreaIntegral, total, MESH_GRADE_AREA, integralref, integral_prepareref, functional_sumintegrand, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(AreaIntegral, gradient, MESH_GRADE_AREA, integralref, integral_prepareref, functional_mapnumericalgradient, areaintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(AreaIntegral, gradient, MESH_GRADE_AREA, integralref, integral_prepareref, functional_mapnumericalgradient, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); /** Field gradients for Area Integrals */ value AreaIntegral_fieldgradient(vm *v, int nargs, value *args) { @@ -5249,7 +5258,7 @@ value AreaIntegral_fieldgradient(vm *v, int nargs, value *args) { info.freeref=integral_freeref; info.ref=&ref; functional_mapnumericalfieldgradient(v, &info, &out); - } else morpho_runtimeerror(v, GRADSQ_ARGS); + } else morpho_runtimeerror(v, AREAINTEGRAL_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); return out; @@ -5297,7 +5306,10 @@ bool volumeintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int if (MORPHO_ISDICTIONARY(iref.method)) { double err; quantity quantities[iref.nfields+1]; - integral_preparequantities(&iref, nv, vid, quantities); + if (!integral_preparequantities(&iref, nv, vid, quantities)) { + integral_clearelref(&elref); + return false; + } elref.quantities=quantities; success=integrate(integral_integrandfn, MORPHO_GETDICTIONARY(iref.method), morpho_geterror(v), mesh->dim, MESH_GRADE_VOLUME, x, iref.nfields, quantities, &iref, out, &err); @@ -5336,11 +5348,11 @@ bool volumeintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int return success; } -FUNCTIONAL_METHOD(VolumeIntegral, integrand, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_mapintegrand, volumeintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(VolumeIntegral, integrand, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_mapintegrand, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(VolumeIntegral, total, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_sumintegrand, volumeintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(VolumeIntegral, total, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_sumintegrand, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(VolumeIntegral, gradient, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_mapnumericalgradient, volumeintegral_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD(VolumeIntegral, gradient, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_mapnumericalgradient, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); /** Field gradients for Volume Integrals */ value VolumeIntegral_fieldgradient(vm *v, int nargs, value *args) { @@ -5357,7 +5369,7 @@ value VolumeIntegral_fieldgradient(vm *v, int nargs, value *args) { info.freeref=integral_freeref; info.ref=&ref; functional_mapnumericalfieldgradient(v, &info, &out); - } else morpho_runtimeerror(v, GRADSQ_ARGS); + } else morpho_runtimeerror(v, VOLUMEINTEGRAL_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); return out; @@ -5512,7 +5524,11 @@ static bool jump_dependencies(functional_mapinfo *info, elementid id, varray_ele return true; } -/** Return interface elements that share one of the adjacent parent elements. */ +/** Return interface elements that share one of the adjacent parent elements. + This is appropriate for coordinate gradients, but not for FE field gradients: + in the FE case the local parent-element DOF collection already captures the + two-sided support of the interface term, and the outer interface traversal + accounts for neighboring interfaces exactly once. */ static bool jump_fielddependencies(functional_mapinfo *info, elementid id, varray_elementid *out) { jumpref *ref = (jumpref *) info->ref; int nparents=0, *parents=NULL; @@ -5949,7 +5965,7 @@ static value Jump_fieldgradient(vm *v, int nargs, value *args) { if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; - info.dependencies=jump_fielddependencies; + info.dependencies=NULL; info.cloneref=jump_cloneref; info.freeref=jump_freeref; info.ref=&ref; @@ -6089,8 +6105,11 @@ void functional_initialize(void) { morpho_defineerror(NEMATICELECTRIC_ARGS, ERROR_HALT, NEMATICELECTRIC_ARGS_MSG); morpho_defineerror(FUNCTIONAL_ARGS, ERROR_HALT, FUNCTIONAL_ARGS_MSG); - + morpho_defineerror(INTEGRAL_ARGS, ERROR_HALT, INTEGRAL_ARGS_MSG); + morpho_defineerror(LINEINTEGRAL_ARGS, ERROR_HALT, LINEINTEGRAL_ARGS_MSG); + morpho_defineerror(AREAINTEGRAL_ARGS, ERROR_HALT, AREAINTEGRAL_ARGS_MSG); + morpho_defineerror(VOLUMEINTEGRAL_ARGS, ERROR_HALT, VOLUMEINTEGRAL_ARGS_MSG); morpho_defineerror(INTEGRAL_NFLDS, ERROR_HALT, INTEGRAL_NFLDS_MSG); morpho_defineerror(INTEGRAL_MTHDDCT, ERROR_HALT, INTEGRAL_MTHDDCT_MSG); morpho_defineerror(INTEGRAL_FLD, ERROR_HALT, INTEGRAL_FLD_MSG); diff --git a/src/geometry/functional.h b/src/geometry/functional.h index 736105fb4..632d09c03 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -130,6 +130,15 @@ #define INTEGRAL_NFLDS "IntgrlNFlds" #define INTEGRAL_NFLDS_MSG "Incorrect number of Fields provided for integrand function." +#define LINEINTEGRAL_ARGS "LnIntArgs" +#define LINEINTEGRAL_ARGS_MSG "LineIntegral requires a callable argument, followed by zero or more Fields." + +#define AREAINTEGRAL_ARGS "ArIntArgs" +#define AREAINTEGRAL_ARGS_MSG "AreaIntegral requires a callable argument, followed by zero or more Fields." + +#define VOLUMEINTEGRAL_ARGS "VolIntArgs" +#define VOLUMEINTEGRAL_ARGS_MSG "VolumeIntegral requires a callable argument, followed by zero or more Fields." + #define VOLUMEENCLOSED_ZERO "VolEnclZero" #define VOLUMEENCLOSED_ZERO_MSG "VolumeEnclosed detected an element of zero size. Check that a mesh point is not coincident with the origin." @@ -353,7 +362,7 @@ value name##_hessian(vm *v, int nargs, value *args) { \ info.sym = symbhvr; \ info.g = grade; \ info.ref = &ref; \ - integrandfn(v, &info, &out); \ + if (!integrandfn(v, &info, &out) && !morpho_checkerror(morpho_geterror(v))) morpho_runtimeerror(v, err); \ } else morpho_runtimeerror(v, err); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ diff --git a/src/geometry/integrate.c b/src/geometry/integrate.c index 34e379bf1..2a8c23711 100644 --- a/src/geometry/integrate.c +++ b/src/geometry/integrate.c @@ -2215,11 +2215,12 @@ int integrator_addelement(integrator *integrate, int *vids) { } /** Process the list of quantities given */ -void integrator_initializequantities(integrator *integrate, int nq, quantity *quantity) { +bool integrator_initializequantities(integrator *integrate, int nq, quantity *quantity) { integrate->nquantity=nq; integrate->quantity=quantity; for (int i=0; iqval[i]=MORPHO_OBJECT(new); - } else return; + } else return false; } + return true; } /** Frees up any objects used in the quantities list */ void integrator_finalizequantities(integrator *integrate) { - for (int i=0; inquantity; i++) morpho_freeobject(integrate->qval[i]); + for (int i=0; inquantity; i++) { + if (MORPHO_ISOBJECT(integrate->qval[i])) morpho_freeobject(integrate->qval[i]); + } } /** Retrieves the vertex pointers given an elementid. @@ -2768,7 +2773,7 @@ bool integrator_integrate(integrator *integrate, integrandfunction *integrand, i value qval[nquantity+1]; integrate->qval=qval; - integrator_initializequantities(integrate, nquantity, quantity); + if (!integrator_initializequantities(integrate, nquantity, quantity)) return false; // Create first element, which corresponds to the reference element int vids[integrate->nbary]; @@ -2785,7 +2790,7 @@ bool integrator_integrate(integrator *integrate, integrandfunction *integrand, i quadratureworkitem work; work.weight = 1.0; work.elementid = elid; - integrator_quadrature(integrate, integrate->rule, &work); // Perform initial quadrature + if (!integrator_quadrature(integrate, integrate->rule, &work)) goto integrator_integrate_error; // Perform initial quadrature integrator_pushworkitem(integrate, &work); integrator_estimate(integrate); // Initial estimate @@ -2802,7 +2807,9 @@ bool integrator_integrate(integrator *integrate, integrandfunction *integrand, i quadratureworkitem newitems[integrate->subdivide->nels]; if (!integrator_subdivide(integrate, &work, &nels, newitems)) goto integrator_integrate_error; - for (int k=0; krule, &newitems[k]); + for (int k=0; krule, &newitems[k])) goto integrator_integrate_error; + } // Error estimate integrator_sharpenerrorestimate(integrate, &work, nels, newitems); diff --git a/test/functionals/jump/jump2d_cg3_wave_diagnostics.morpho b/test/functionals/jump/jump2d_cg3_wave_diagnostics.morpho new file mode 100644 index 000000000..066d18c58 --- /dev/null +++ b/test/functionals/jump/jump2d_cg3_wave_diagnostics.morpho @@ -0,0 +1,60 @@ +// Diagnostic cross-checks for the CG3 wave/jump penalty setup. +// +// This test is not an optimization run. It checks three things on the +// same flat embedded 2D mesh used by the wave penalty tests: +// 1. the exact wave satisfies the intended Helmholtz-like bulk operator; +// 2. the transverse perturbation excites the jump penalty more than the +// exact wave alone; +// 3. the combined field has larger bulk residual and jump penalty than +// the exact wave. + +import meshtools + +var m = AreaMesh(fn (x, y) [x, y, 0], 0..1:0.2, 0..1:0.2) + +var fe = FiniteElementSpace("CG3", grade=2) + +var qwave = Field(m, fn (x, y, z) sin(Pi*x), finiteelementspace=fe) +var qpert = Field(m, fn (x, y, z) 0.02*sin(3*Pi*x)*cos(2*Pi*y), finiteelementspace=fe) +var qmix = Field(m, fn (x, y, z) sin(Pi*x) + 0.02*sin(3*Pi*x)*cos(2*Pi*y), finiteelementspace=fe) + +var target = Matrix([[Pi^2, 0, 0], + [0, 0, 0], + [0, 0, 0]]) + +fn bulkintegrand(x, q) { + return (hess(q)+q*target).norm()^2 +} + +var bulkWave = AreaIntegral(bulkintegrand, qwave, method={}) +var bulkPert = AreaIntegral(bulkintegrand, qpert, method={}) +var bulkMix = AreaIntegral(bulkintegrand, qmix, method={}) + +var jumpWave = Jump(fn (x, q) jumpdn(q)^2, qwave, method={ "strategy": "quadrature" }) +var jumpPert = Jump(fn (x, q) jumpdn(q)^2, qpert, method={ "strategy": "quadrature" }) +var jumpMix = Jump(fn (x, q) jumpdn(q)^2, qmix, method={ "strategy": "quadrature" }) + +var bulkWaveVal = bulkWave.total(m) +var bulkPertVal = bulkPert.total(m) +var bulkMixVal = bulkMix.total(m) + +var jumpWaveVal = jumpWave.total(m) +var jumpPertVal = jumpPert.total(m) +var jumpMixVal = jumpMix.total(m) + +/*print "bulk(wave) = ${bulkWaveVal}" +print "bulk(pert) = ${bulkPertVal}" +print "bulk(mix) = ${bulkMixVal}" + +print "jump(wave) = ${jumpWaveVal}" +print "jump(pert) = ${jumpPertVal}" +print "jump(mix) = ${jumpMixVal}"*/ + +var ok = true +if (!(bulkPertVal > 10*bulkWaveVal)) ok = false +if (!(bulkMixVal > 10*bulkWaveVal)) ok = false +if (!(jumpPertVal > 3*jumpWaveVal)) ok = false +if (!(jumpMixVal > jumpPertVal)) ok = false + +print ok +// expect: true diff --git a/test/functionals/smectic/qtensortools.xmorpho b/test/functionals/smectic/qtensortools.xmorpho new file mode 100644 index 000000000..8a013f270 --- /dev/null +++ b/test/functionals/smectic/qtensortools.xmorpho @@ -0,0 +1,120 @@ +// Tools to work with the Q-tensor in 3D. The Q-tensor is a symmetric traceless 3x3 matrix that describes the local orientational order of liquid crystals. + +// The q tensor [ Qxx Qxy Qxz ] +// [ Qxy Qyy Qyz ] +// [ Qxz Qyz Qzz ] +// is symmetric and traceless. Hence there are 5 independent components: [ Qxx, Qxy, Qxz, Qyy, Qyz ] +// We will represent these as a vector. + +// Reconstruct Q-tensor from the q-vector +fn reconstructQ(qv) { + return Matrix( [ [ qv[0], qv[1], qv[2] ], [ qv[1], qv[3], qv[4] ], [ qv[2], qv[4], -qv[0]-qv[3] ] ]) +} + +// Reconstruct q-vector from Q-tensor +fn reconstructqv(Q) { + return Matrix([ Q[0,0], Q[0,1], Q[0,2], Q[1,1], Q[1,2] ]) +} + +// Function to get the scalar order parameter S from the Q-tensor +fn qtoorder(qv) { + var Q = reconstructQ(qv) + var ev = Q.eigenvalues() + return max(ev) +} + +// Reconstruct director from Q-tensor +fn qtodirector(qv) { + var Q = reconstructQ(qv) + var es = Q.eigensystem() + var order = es[0].order() // Find largest eigenvalue + var n = es[1].column(order[-1]) // Return associated eigenvector + n/=n.norm() + return n +} + +// Construct a Q tensor from S and n +fn constructQ(S, n) { + return S*(n.outer(n) - IdentityMatrix(3)/3) +} + +// Converts a q-vector to a Q-tensor +fn qtensor(q) { + return Matrix([ [q[0], q[1], q[2]], + [q[1], q[3], q[4]], + [q[2], q[4], -q[0]-q[3]] ]) +} + +// Convert our Q vector Field to a Q tensor field +fn qfield(Q) { + var m = Q.mesh() + var qq = Field(m, qtensor(Q[0,0])) + for (id in 0...m.count(0)) qq[0,id] = qtensor(Q[0,id]) + return qq +} + +// Radial initial condition +fn radialQ(x,y,z) { + var S0 = 0.6 + var n = Matrix([x,y,z]) + if (n.norm()>1e-6) n/=n.norm() + + return S0*Matrix([ n[0]^2 - 1/3, + n[0]*n[1], + n[0]*n[2], + n[1]^2 - 1/3, + n[1]*n[2] ]) +} + +// Uniform initial condition +fn uniformQ(x,y,z) { + var S0 = 0.6 + var n = Matrix([1,0,0]) + return S0*Matrix([ n[0]^2 - 1/3, + n[0]*n[1], + n[0]*n[2], + n[1]^2 - 1/3, + n[1]*n[2] ]) +} + + +fn radialQ(x,y) { return radialQ(x,y,0) } + +// Calculates Fields from Q tensor for visualization purposes +fn qvis(Q) { + var m = Q.mesh() + var e0=Field(m), e1=Field(m), e2=Field(m) + var nn=Field(m, Matrix([1,0,0])) + + for (id in 0...m.count(0)) { + var q = qtensor(Q[0,id]) + var es=q.eigensystem() + var order=es[0].order() + e0[0,id]=es[0][order[-1]] + e1[0,id]=es[0][order[-2]] + e2[0,id]=es[0][order[-3]] + nn[0,id]=es[1].column(order[-1]) + } + + return [e0, e1, e2, nn] +} + +fn _promote(x, n) { + var y = Matrix(n) + for (i in 0...x.count()) y[i] = x[i] + return y +} + +// Visualizes a director field as cylinders. +fn visdirector(n, lambda) { + var m = n.mesh() + var g = Graphics() + for (vid in 0...m.count()) { + var nn=n[0,vid] + if (nn.norm()>1e-6) nn/=nn.norm() + var x = m.vertexposition(vid) + if (x.count()0) print "${label}: grade ${g} count = ${n}" + } + } + + reportQTerms(label) { + fn landau(x, q) { + var trQQ = 2*(q.inner(q)+q[0]*q[3]) + var trQQQ = -3*(q[3]*(q[0]^2 - q[1]^2 + q[2]^2) - + 2*q[1]*q[2]*q[4] + + q[0]*(-q[1]^2 + q[3]^2 + q[4]^2)) + + return -(l/2)*trQQ - (l/3)*trQQQ + (l/2)*(trQQ^2) + } + + fn anchoring(x, q) { + var t = tangent() + var wxx = t[0]*t[0]-0.5 + var wxy = t[0]*t[1] + return (q[0]-wxx)^2+(q[1]-wxy)^2 + } + + fn coupling(x, rho, q) { + var h = hess(rho) + var Q = qtensor(q) + var u = (h + qsq*(Q+I3div3)*rho).norm() + return u*u + } + + var bulk = AreaIntegral(landau, self.Q, method={}).total(self.mesh) + var anchor = 0 + var couple = 0 + + if (EA!=0) anchor = EA*LineIntegral(anchoring, self.Q, method={}).total(self.mesh, selection=self.bnd) + if (Bcouple!=0) couple = Bcouple*AreaIntegral(coupling, self.rho, self.Q, method={}).total(self.mesh) + + print "${label}: Q bulk = ${bulk}" + print "${label}: Q anchor = ${anchor}" + print "${label}: Q couple = ${couple}" + print "${label}: Q total = ${bulk + anchor + couple}" + } + + reportRhoTerms(label) { + fn landauSmectic(x, rho) { + return A*rho^2/2 + B*rho^3/3 + C*rho^4/4 + } + + fn coupling(x, rho, q) { + var h = hess(rho) + var Q = qtensor(q) + var u = (h + qsq*(Q+I3div3)*rho).norm() + return u*u + } + + var landau = AreaIntegral(landauSmectic, self.rho, method={}).total(self.mesh) + var couple = 0 + var jump = 0 + + if (Bcouple!=0) couple = Bcouple*AreaIntegral(coupling, self.rho, self.Q, method={}).total(self.mesh) + if (self.rhoJumpPenalty!=0) { + jump = self.rhoJumpPenalty*Jump(fn (x, q) jumpdn(q)^2, self.rho, + method={ "strategy": "quadrature" }).total(self.mesh) + } + + print "${label}: rho landau = ${landau}" + print "${label}: rho couple = ${couple}" + print "${label}: rho jump = ${jump}" + print "${label}: rho total = ${landau + couple + jump}" + } + + initialMesh() { + var dom = fn (x) -(x[0]^2+x[1]^2-1) + var mg = MeshGen(dom, [-1..1:0.2, -1..1:0.2]) + var m = mg.build() + self.mesh = ChangeMeshDimension(m, 3) + } + + initialField() { + self.Q = Field(self.mesh, uniformQ) + + var cg3 = FiniteElementSpace("CG3", grade=2) + // Seed rho with a weak stripe at the preferred wavelength. + self.rho = Field(self.mesh, + fn (x, y, z) 0.3 + 0.05*cos(sqrt(qsq)*x), + finiteelementspace=cg3) + } + + initialSelection() { + self.bnd = Selection(self.mesh, boundary=true) + } + + initialParameters() { + self.rhoJumpPenalty = 0 + } + + jumpPenaltyBase() { + // Use a simple p^2 / h scaling for CG3 as a baseline. + var h = Length().total(self.mesh) / self.mesh.count(0) + return 9 / h + } + + buildQProblem() { + self.problem = OptimizationProblem(self.mesh) + + fn landau(x, q) { + var trQQ = 2*(q.inner(q)+q[0]*q[3]) + var trQQQ = -3*(q[3]*(q[0]^2 - q[1]^2 + q[2]^2) - + 2*q[1]*q[2]*q[4] + + q[0]*(-q[1]^2 + q[3]^2 + q[4]^2)) + + return -(l/2)*trQQ - (l/3)*trQQQ + (l/2)*(trQQ^2) + } + var bulk = AreaIntegral(landau, self.Q, method={}) + self.problem.addenergy(bulk) + + fn anchoring(x, q) { + var t = tangent() + var wxx = t[0]*t[0]-0.5 + var wxy = t[0]*t[1] + return (q[0]-wxx)^2+(q[1]-wxy)^2 + } + var anchor = LineIntegral(anchoring, self.Q, method={}) + if (EA!=0) self.problem.addenergy(anchor, selection=self.bnd, prefactor=EA) + + fn coupling(x, rho, q) { + var h = hess(rho) + var Q = qtensor(q) + var u = (h + qsq*(Q+I3div3)*rho).norm() + return u*u + } + var lcoupling = AreaIntegral(coupling, self.rho, self.Q, method={}) + if (Bcouple!=0) self.problem.addenergy(lcoupling, prefactor=Bcouple) + + return self.problem + } + + buildRhoProblem() { + self.problem = OptimizationProblem(self.mesh) + + fn landauSmectic(x, rho) { + return A*rho^2/2 + B*rho^3/3 + C*rho^4/4 + } + var lsmectic = AreaIntegral(landauSmectic, self.rho, method={}) + self.problem.addenergy(lsmectic) + + fn coupling(x, rho, q) { + var h = hess(rho) + var Q = qtensor(q) + var u = (h + qsq*(Q+I3div3)*rho).norm() + return u*u + } + var lcoupling = AreaIntegral(coupling, self.rho, self.Q, method={}) + if (Bcouple!=0) self.problem.addenergy(lcoupling, prefactor=Bcouple) + + var jump = Jump(fn (x, q) jumpdn(q)^2, self.rho, + method={ "strategy": "quadrature" }) + if (self.rhoJumpPenalty!=0) self.problem.addenergy(jump, prefactor=self.rhoJumpPenalty) + + self.jumpFunctional = jump + return self.problem + } + + buildQAdapter() { + self.adapter = ProblemAdapter(self.problem, self.Q) + return self.adapter + } + + buildRhoAdapter() { + self.adapter = ProblemAdapter(self.problem, self.rho) + return self.adapter + } + + build() { + self.initialMesh() + self.initialField() + self.initialSelection() + self.initialParameters() + self.buildQProblem() + return self.buildQAdapter() + } + + correctMesh() { + for (id in self.bnd.idlistforgrade(0)) { + var x = self.mesh.vertexposition(id) + self.mesh.setvertexposition(id, x/x.norm()) + } + } + + _maxgrade(f) { + var shape = f.shape() + var maxgrade = 0 + for (s, k in shape) if (s>0) maxgrade = k + return maxgrade + } + + correctField() { + self.reportFieldShape("Before correctField(rho)", self.rho) + if (self._maxgrade(self.rho)<1) return + var shape = self.rho.shape() + var nedgedof = shape[1] + if (nedgedof<=0) return + var conn = self.mesh.connectivitymatrix(0, 1) + for (id in 0...self.mesh.count(1)) { + var v = conn.rowindices(id) + var av = (self.rho[0,v[0]] + self.rho[0,v[1]])/2 + for (j in 0...nedgedof) self.rho[1,id,j] = av + } + self.reportFieldShape("After correctField(rho)", self.rho) + } + + refine() { + var srefine + var mr = CG3MeshRefiner([self.mesh, self.Q, self.rho, self.bnd]) + var refmap = mr.refine(selection=srefine) + + self.mesh = refmap[self.mesh] + self.Q = refmap[self.Q] + self.rho = refmap[self.rho] + self.bnd = refmap[self.bnd] + + print "After refmap:" + print "mesh vertices = ${self.mesh.count(0)}" + print "mesh edges = ${self.mesh.count(1)}" + print "mesh areas = ${self.mesh.count(2)}" + self.reportFieldShape("Refined Q", self.Q) + self.reportFieldShape("Refined rho", self.rho) + + self.correctMesh() + if (!(self.rho.shape().count()==3 && self.rho.shape()[0]==1 && self.rho.shape()[1]==2 && self.rho.shape()[2]==1)) { + self.correctField() + } else { + print "Skipping correctField(rho): CG3 prolongation handled by refiner." + } + equiangulate(self.mesh) + print "After equiangulate:" + print "mesh vertices = ${self.mesh.count(0)}" + print "mesh edges = ${self.mesh.count(1)}" + print "mesh areas = ${self.mesh.count(2)}" + self.reportFieldShape("Post-equiangulate Q", self.Q) + self.reportFieldShape("Post-equiangulate rho", self.rho) + } + + solveQ() { + self.rhoJumpPenalty = 0 + self.buildQProblem() + self.reportQTerms("Before solveQ") + var adapt = self.buildQAdapter() + var control = LBFGSController(adapt) + control.optimize(500) + self.reportQTerms("After solveQ") + } + + solveRhoStage(jumpPenalty) { + self.rhoJumpPenalty = jumpPenalty + self.buildRhoProblem() + self.reportRhoTerms("Before solveRho eta=${jumpPenalty}") + var adapt = self.buildRhoAdapter() + var control = LBFGSController(adapt) + control.optimize(200) + self.reportRhoTerms("After solveRho eta=${jumpPenalty}") + + if (jumpPenalty!=0) { + print "rho stage eta=${jumpPenalty}: jump = ${self.jumpFunctional.total(self.mesh)}" + } + } + + solveRhoSchedule() { + var base = self.jumpPenaltyBase() + var multipliers = [1, 3, 10] + for (mu in multipliers) { + self.solveRhoStage(mu*base) + } + } + + solveCycle() { + self.solveQ() + self.solveRhoSchedule() + } + + solveCycles(ncycles) { + for (k in 0...ncycles) { + print "Alternating cycle ${k+1}" + self.solveCycle() + } + } + + solve() { + self.solveCycles(1) + + print "Refining mesh" + self.refine() + + print "Continuing on refined mesh" + self.solveCycles(1) + } + + _estimateLength() { + return Length().total(self.mesh) / self.mesh.count(0) + } + + visualizeNematic() { + var qfields = qvis(self.Q) + var qplot = plotfield(qfields[0], style="interpolate", + scalebar=ScaleBar(posn=[1.2,0,0])) + return visdirector(qfields[3], self._estimateLength()/2) //+ qplot + } + + _lowerToCG1(u) { + var phi = Field(self.mesh, 0) + for (i in 0...self.mesh.count()) phi[i] = self.rho[0,i] + return phi + } + + visualizeSmectic() { + return plotfield(self._lowerToCG1(self.rho), style="interpolate", + scalebar=ScaleBar(posn=[1.2,0,0])) + } +} + +var sim = Smectic() +sim.build() +sim.solve() + +Show(sim.visualizeNematic() + sim.visualizeSmectic()) From 8f77b666c5a0634ebe3de37f1a7003ba91606e68 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 18 May 2026 16:30:35 +0200 Subject: [PATCH 431/473] Add ability to access element data from a FiniteElementSpace --- src/geometry/fespace.c | 59 ++++++++++- src/geometry/fespace.h | 2 + src/geometry/field.c | 100 ++++++++++++++++++ src/geometry/field.h | 2 + .../discretizations/cg3/cg3_nodecoords.morpho | 17 +++ test/field/eval_element.morpho | 27 +++++ 6 files changed, 206 insertions(+), 1 deletion(-) create mode 100644 test/field/discretizations/cg3/cg3_nodecoords.morpho create mode 100644 test/field/eval_element.morpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index c490f5904..5823e5f10 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -960,6 +960,24 @@ bool fespace_lower(fespace *disc, grade target, fespace **out) { return false; } +/** Returns the barycentric coordinates of a node in the reference element */ +bool fespace_getnodecoords(fespace *disc, int node, double *lambda) { + if (!disc || !lambda) return false; + if (node<0 || node>=disc->nnodes) return false; + + double l0 = 1.0; + + for (int i=0; igrade; i++) { + double li = disc->nodes[node*disc->grade+i]; + lambda[i+1] = li; + l0 -= li; + } + + lambda[0] = l0; + + return true; +} + /** Constructs a layout matrix that maps element ids (columns) to degree of freedom indices in a field */ bool fespace_layout(objectfield *field, fespace *disc, objectsparse **out) { objectsparse *conn = mesh_getconnectivityelement(field->mesh, 0, disc->grade); @@ -1070,8 +1088,47 @@ value FiniteElementSpace_layout(vm *v, int nargs, value *args) { return out; } +value FiniteElementSpace_nodecoords(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + objectfespace *slf = MORPHO_GETFESPACE(MORPHO_SELF(args)); + fespace *disc = slf->fespace; + int nrows = disc->grade+1; + + if (nargs==0) { + objectmatrix *new = object_newmatrix(nrows, disc->nnodes, true); + if (!new) return MORPHO_NIL; + + for (int i=0; innodes; i++) { + double lambda[nrows]; + if (!fespace_getnodecoords(disc, i, lambda)) { + object_free((object *) new); + return MORPHO_NIL; + } + matrix_setcolumn(new, i, lambda); + } + + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } else if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + double lambda[nrows]; + + if (fespace_getnodecoords(disc, i, lambda)) { + objectmatrix *new = object_newmatrix(nrows, 1, true); + if (new) { + matrix_setcolumn(new, 0, lambda); + out=MORPHO_OBJECT(new); + morpho_bindobjects(v, 1, &out); + } + } + } + + return out; +} + MORPHO_BEGINCLASS(FiniteElementSpace) -MORPHO_METHOD(FINITEELEMENTSPACE_LAYOUT_METHOD, FiniteElementSpace_layout, BUILTIN_FLAGSEMPTY) +MORPHO_METHOD(FINITEELEMENTSPACE_LAYOUT_METHOD, FiniteElementSpace_layout, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FINITEELEMENTSPACE_NODECOORDS_METHOD, FiniteElementSpace_nodecoords, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS /* ********************************************************************** diff --git a/src/geometry/fespace.h b/src/geometry/fespace.h index 49184ecad..eeb976105 100644 --- a/src/geometry/fespace.h +++ b/src/geometry/fespace.h @@ -76,6 +76,7 @@ typedef struct { #define FINITEELEMENTSPACE_CLASSNAME "FiniteElementSpace" #define FINITEELEMENTSPACE_LAYOUT_METHOD "layout" +#define FINITEELEMENTSPACE_NODECOORDS_METHOD "nodeCoords" /* ------------------------------------------------------- * Discretization error messages @@ -98,6 +99,7 @@ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids bool fespace_lower(fespace *disc, grade target, fespace **out); +bool fespace_getnodecoords(fespace *disc, int node, double *lambda); bool fespace_layout(objectfield *field, fespace *disc, objectsparse **out); void fespace_gradient(fespace *disc, double *lambda, objectmatrix *grad); void fespace_hessian(fespace *disc, double *lambda, objectmatrix *hess); diff --git a/src/geometry/field.c b/src/geometry/field.c index 65f0706a6..aa0f818db 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -428,6 +428,63 @@ bool field_getelementaslist(objectfield *field, grade grade, elementid el, int i return success; } +static bool field_getelementdofs(objectfield *field, fespace *disc, elementid el, fieldindx *findx) { + if (!field || !disc || !findx) return false; + + objectsparse *conn = mesh_getconnectivityelement(field->mesh, 0, disc->grade); + if (!conn) return false; + + int nv, *vids; + if (!mesh_getconnectivity(conn, el, &nv, &vids)) return false; + if (nv!=disc->grade+1) return false; + + return fespace_doftofieldindx(field, disc, nv, vids, findx); +} + +bool field_evalelement(objectfield *field, elementid el, double *lambda, value *out) { + if (!field || !lambda || !out) return false; + if (!MORPHO_ISFESPACE(field->fnspc)) return false; + + fespace *disc = MORPHO_GETFESPACE(field->fnspc)->fespace; + fieldindx findx[disc->nnodes]; + if (!field_getelementdofs(field, disc, el, findx)) return false; + + double wts[disc->nnodes]; + disc->ifn(lambda, wts); + + if (MORPHO_ISNIL(field->prototype)) { + double accum = 0.0; + for (int i=0; innodes; i++) { + value q; + double val; + if (!field_getelement(field, findx[i].g, findx[i].id, findx[i].indx, &q)) return false; + if (!morpho_valuetofloat(q, &val)) return false; + accum += wts[i]*val; + } + *out = MORPHO_FLOAT(accum); + return true; + } else if (MORPHO_ISMATRIX(field->prototype)) { + objectmatrix *proto = MORPHO_GETMATRIX(field->prototype); + objectmatrix *accum = object_newmatrix(proto->nrows, proto->ncols, true); + if (!accum) return false; + + for (int i=0; innodes; i++) { + unsigned int nentries; + double *entries; + if (!field_getelementaslist(field, findx[i].g, findx[i].id, findx[i].indx, &nentries, &entries)) { + object_free((object *) accum); + return false; + } + for (unsigned int j=0; jelements[j] += wts[i]*entries[j]; + } + + *out = MORPHO_OBJECT(accum); + return true; + } + + return false; +} + /** Sets the value of an entry in a field object * @param[in] field - field to use * @param[in] grade - grade to access @@ -953,6 +1010,48 @@ value Field_mesh(vm *v, int nargs, value *args) { return MORPHO_OBJECT(f->mesh); } +static bool field_readlambda(value arg, int nlambda, double *lambda) { + if (MORPHO_ISLIST(arg)) { + objectlist *list = MORPHO_GETLIST(arg); + if (list_length(list)!=(unsigned int) nlambda) return false; + for (int i=0; inrows!=(unsigned int) nlambda || mat->ncols!=1) return false; + for (int i=0; ielements[i]; + return true; + } + + return false; +} + +value Field_evalelement_method(vm *v, int nargs, value *args) { + value out = MORPHO_NIL; + objectfield *field=MORPHO_GETFIELD(MORPHO_SELF(args)); + if (!MORPHO_ISFESPACE(field->fnspc)) return out; + + fespace *disc = MORPHO_GETFESPACE(field->fnspc)->fespace; + int nlambda = disc->grade+1; + + if (nargs==2 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + elementid el = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + double lambda[nlambda]; + + if (field_readlambda(MORPHO_GETARG(args, 1), nlambda, lambda) && + field_evalelement(field, el, lambda, &out) && + MORPHO_ISOBJECT(out)) { + morpho_bindobjects(v, 1, &out); + } + } + + return out; +} + /** Get the matrix that stores the Field */ value Field_linearize(vm *v, int nargs, value *args) { objectfield *f=MORPHO_GETFIELD(MORPHO_SELF(args)); @@ -997,6 +1096,7 @@ MORPHO_METHOD(FIELD_SHAPE_METHOD, Field_shape, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_FESPACE_METHOD, Field_fnspace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_PROTOTYPE_METHOD, Field_prototype, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_MESH_METHOD, Field_mesh, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FIELD_EVALELEMENT_METHOD, Field_evalelement_method, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_LINEARIZE_METHOD, Field_linearize, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD__LINEARIZE_METHOD, Field_unsafelinearize, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/geometry/field.h b/src/geometry/field.h index 93ee56f03..6451fc34f 100644 --- a/src/geometry/field.h +++ b/src/geometry/field.h @@ -75,6 +75,7 @@ extern value field_gradeoption; #define FIELD_FESPACE_METHOD "finiteelementspace" #define FIELD_PROTOTYPE_METHOD "prototype" #define FIELD_MESH_METHOD "mesh" +#define FIELD_EVALELEMENT_METHOD "evalElement" #define FIELD_LINEARIZE_METHOD "linearize" #define FIELD__LINEARIZE_METHOD "__linearize" @@ -116,6 +117,7 @@ bool field_getelement(objectfield *field, grade grade, elementid el, int indx, v bool field_getelementwithindex(objectfield *field, int indx, value *out); bool field_getindex(objectfield *field, grade grade, elementid el, int indx, int *out); bool field_getelementaslist(objectfield *field, grade grade, elementid el, int indx, unsigned int *nentries, double **out); +bool field_evalelement(objectfield *field, elementid el, double *lambda, value *out); bool field_setelement(objectfield *field, grade grade, elementid el, int indx, value val); bool field_setelementwithindex(objectfield *field, int ix, value val); diff --git a/test/field/discretizations/cg3/cg3_nodecoords.morpho b/test/field/discretizations/cg3/cg3_nodecoords.morpho new file mode 100644 index 000000000..5e554211c --- /dev/null +++ b/test/field/discretizations/cg3/cg3_nodecoords.morpho @@ -0,0 +1,17 @@ +// FiniteElementSpace nodeCoords methods + +var l = FiniteElementSpace("CG3", grade=2) + +var nodes = l.nodeCoords() + +print nodes.dimensions() +// expect: [ 3, 10 ] + +print (nodes.column(0) - Matrix([1,0,0])).norm() < 1e-12 +// expect: true + +print (nodes.column(9) - Matrix([1/3,1/3,1/3])).norm() < 1e-12 +// expect: true + +print (l.nodeCoords(3) - Matrix([2/3,1/3,0])).norm() < 1e-12 +// expect: true diff --git a/test/field/eval_element.morpho b/test/field/eval_element.morpho new file mode 100644 index 000000000..f41bf8460 --- /dev/null +++ b/test/field/eval_element.morpho @@ -0,0 +1,27 @@ +// Field evalElement method + +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +var cg3 = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y) (x+y)^3, finiteelementspace=cg3) + +print abs(f.evalElement(0, [1/3,1/3,1/3]) - 8/27) < 1e-10 +// expect: true + +print abs(f.evalElement(0, cg3.nodeCoords(9)) - 8/27) < 1e-10 +// expect: true + +var cg2 = FiniteElementSpace("CG2", grade=2) +var g = Field(m, fn (x,y) Matrix([[x,y],[-y,x]]), finiteelementspace=cg2) +var val = g.evalElement(0, [1/2,1/4,1/4]) + +print (val - Matrix([[1/4,1/4],[-1/4,1/4]])).norm() < 1e-10 +// expect: true From de226642caf7b40a7134122797a12eb959ecd12d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 18 May 2026 16:57:53 +0200 Subject: [PATCH 432/473] Fix finiteElementSpace label; better CG3 refinement --- modules/meshtools.morpho | 2 +- src/geometry/field.h | 2 +- .../smectic/smectic_staged_demo.xmorpho | 81 +++---------------- 3 files changed, 13 insertions(+), 72 deletions(-) diff --git a/modules/meshtools.morpho b/modules/meshtools.morpho index 71a88095d..46b07ad85 100644 --- a/modules/meshtools.morpho +++ b/modules/meshtools.morpho @@ -653,7 +653,7 @@ class MeshAdaptiveRefiner { var prototype = field.enumerate(0) if (isobject(prototype)) prototype=prototype.clone() var shape = field.shape() - var fespace = field.finiteelementspace() + var fespace = field.finiteElementSpace() var result if (self.refinemap && prototype) { diff --git a/src/geometry/field.h b/src/geometry/field.h index 6451fc34f..d96d5d15a 100644 --- a/src/geometry/field.h +++ b/src/geometry/field.h @@ -72,7 +72,7 @@ extern value field_gradeoption; #define FIELD_OP_METHOD "op" #define FIELD_SHAPE_METHOD "shape" -#define FIELD_FESPACE_METHOD "finiteelementspace" +#define FIELD_FESPACE_METHOD "finiteElementSpace" #define FIELD_PROTOTYPE_METHOD "prototype" #define FIELD_MESH_METHOD "mesh" #define FIELD_EVALELEMENT_METHOD "evalElement" diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index 90f7d25fa..bc76e77ef 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -41,65 +41,13 @@ class CG3MeshRefiner is MeshRefiner { return [l0, l1, l2] } - _cg3weights(lambda) { - var l0 = lambda[0] - var l1 = lambda[1] - var l2 = lambda[2] - - return [ - l0*(1 + 4.5*(l0-1)*l0), - l1*(1 + 4.5*(l1-1)*l1), - l2*(1 + 4.5*(l2-1)*l2), - 4.5*l0*l1*(3*l0-1), - 4.5*l0*l1*(3*l1-1), - 4.5*l1*l2*(3*l1-1), - 4.5*l1*l2*(3*l2-1), - 4.5*l0*l2*(3*l2-1), - 4.5*l0*l2*(3*l0-1), - 27*l0*l1*l2 - ] - } - - _cg3dofs(field, faceid, faceconn, edgeconn, edgeids, cache) { - if (cache.contains(faceid)) return cache[faceid] - - var vids = faceconn.rowindices(faceid) - var dofs = [] - - for (vid in vids) dofs.append(field[0, vid]) - - var ledges = [[vids[0], vids[1]], [vids[1], vids[2]], [vids[2], vids[0]]] - for (pair in ledges) { - var eid = edgeids[self._edgekey(pair[0], pair[1])] - var everts = edgeconn.rowindices(eid) - var reversed = everts[0]==pair[1] && everts[1]==pair[0] - - if (reversed) { - dofs.append(field[1, eid, 1]) - dofs.append(field[1, eid, 0]) - } else { - dofs.append(field[1, eid, 0]) - dofs.append(field[1, eid, 1]) - } - } - - dofs.append(field[2, faceid, 0]) - cache[faceid] = dofs - return dofs - } - - _evalcg3(field, faceid, x, oldverts, oldfaces, oldedges, oldedgeids, cache) { + _eval(field, faceid, x, oldverts, oldfaces) { var vids = oldfaces.rowindices(faceid) var a = oldverts.column(vids[0]) var b = oldverts.column(vids[1]) var c = oldverts.column(vids[2]) var lambda = self._barycentric(a, b, c, x) - var wts = self._cg3weights(lambda) - var dofs = self._cg3dofs(field, faceid, oldfaces, oldedges, oldedgeids, cache) - var sum = dofs[0]*0 - - for (i in 0...wts.count()) sum += dofs[i]*wts[i] - return sum + return field.evalElement(faceid, lambda) } adaptcg3field(field) { @@ -107,17 +55,11 @@ class CG3MeshRefiner is MeshRefiner { var prototype = field.enumerate(0) if (isobject(prototype)) prototype = prototype.clone() - var result = Field(self.new, prototype, grade=field.shape(), finiteelementspace=field.finiteelementspace()) + var result = Field(self.new, prototype, grade=field.shape(), finiteelementspace=field.finiteElementSpace()) var oldmesh = self.mesh() var oldverts = oldmesh.vertexmatrix() var oldfaces = oldmesh.connectivitymatrix(0, 2) - var oldedges = oldmesh.connectivitymatrix(0, 1) - var oldedgeids = Dictionary() - for (eid in 0...oldmesh.count(1)) { - var ev = oldedges.rowindices(eid) - oldedgeids[self._edgekey(ev[0], ev[1])] = eid - } var newverts = self.new.vertexmatrix() var newfaces = self.new.connectivitymatrix(0, 2) @@ -130,7 +72,6 @@ class CG3MeshRefiner is MeshRefiner { var vertexdone = Dictionary() var edgedone = Dictionary() - var facecache = Dictionary() for (newfid in self.refinemap[2]) { var oldfid = self.refinemap[2][newfid] @@ -138,8 +79,8 @@ class CG3MeshRefiner is MeshRefiner { for (vid in fvids) { if (vertexdone.contains(vid)) continue - result[0, vid] = self._evalcg3(field, oldfid, newverts.column(vid), - oldverts, oldfaces, oldedges, oldedgeids, facecache) + result[0, vid] = self._eval(field, oldfid, newverts.column(vid), + oldverts, oldfaces) vertexdone[vid] = true } @@ -152,16 +93,16 @@ class CG3MeshRefiner is MeshRefiner { var xa = newverts.column(everts[0]) var xb = newverts.column(everts[1]) - result[1, eid, 0] = self._evalcg3(field, oldfid, (2*xa+xb)/3, - oldverts, oldfaces, oldedges, oldedgeids, facecache) - result[1, eid, 1] = self._evalcg3(field, oldfid, (xa+2*xb)/3, - oldverts, oldfaces, oldedges, oldedgeids, facecache) + result[1, eid, 0] = self._eval(field, oldfid, (2*xa+xb)/3, + oldverts, oldfaces) + result[1, eid, 1] = self._eval(field, oldfid, (xa+2*xb)/3, + oldverts, oldfaces) edgedone[eid] = true } var centroid = (newverts.column(fvids[0]) + newverts.column(fvids[1]) + newverts.column(fvids[2]))/3 - result[2, newfid, 0] = self._evalcg3(field, oldfid, centroid, - oldverts, oldfaces, oldedges, oldedgeids, facecache) + result[2, newfid, 0] = self._eval(field, oldfid, centroid, + oldverts, oldfaces) } return result From 35efe02cfcad8f4725f65303049b5140a2f08b95 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 18 May 2026 17:37:37 +0200 Subject: [PATCH 433/473] Fix output --- test/functionals/smectic/smectic_staged_demo.xmorpho | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index bc76e77ef..4c4e5ef2e 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -133,7 +133,7 @@ var I3div3 = IdentityMatrix(3)/3 class Smectic { reportFieldShape(label, f) { print "${label}: shape = ${f.shape()}" - for (g, n in f.shape()) { + for (n, g in f.shape()) { if (n>0) print "${label}: grade ${g} count = ${n}" } } From 1dc954f2209640cdd47283685282344a5b03f10f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 18 May 2026 18:02:22 +0200 Subject: [PATCH 434/473] grade and count object for the FiniteElementSpace class --- src/geometry/fespace.c | 12 ++ src/geometry/fespace.h | 1 + .../smectic/smectic_staged_demo.xmorpho | 128 ++++++++++++++---- 3 files changed, 116 insertions(+), 25 deletions(-) diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 5823e5f10..4975c1c7f 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -1073,6 +1073,16 @@ value fespace_constructor(vm *v, int nargs, value *args) { return out; } +value FiniteElementSpace_count(vm *v, int nargs, value *args) { + objectfespace *slf = MORPHO_GETFESPACE(MORPHO_SELF(args)); + return MORPHO_INTEGER(slf->fespace->nnodes); +} + +value FiniteElementSpace_grade(vm *v, int nargs, value *args) { + objectfespace *slf = MORPHO_GETFESPACE(MORPHO_SELF(args)); + return MORPHO_INTEGER(slf->fespace->grade); +} + value FiniteElementSpace_layout(vm *v, int nargs, value *args) { value out=MORPHO_NIL; objectfespace *slf = MORPHO_GETFESPACE(MORPHO_SELF(args)); @@ -1127,6 +1137,8 @@ value FiniteElementSpace_nodecoords(vm *v, int nargs, value *args) { } MORPHO_BEGINCLASS(FiniteElementSpace) +MORPHO_METHOD(MORPHO_COUNT_METHOD, FiniteElementSpace_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FINITEELEMENTSPACE_GRADE_METHOD, FiniteElementSpace_grade, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FINITEELEMENTSPACE_LAYOUT_METHOD, FiniteElementSpace_layout, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FINITEELEMENTSPACE_NODECOORDS_METHOD, FiniteElementSpace_nodecoords, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/geometry/fespace.h b/src/geometry/fespace.h index eeb976105..cc7ae22fd 100644 --- a/src/geometry/fespace.h +++ b/src/geometry/fespace.h @@ -75,6 +75,7 @@ typedef struct { #define FINITEELEMENTSPACE_CLASSNAME "FiniteElementSpace" +#define FINITEELEMENTSPACE_GRADE_METHOD "grade" #define FINITEELEMENTSPACE_LAYOUT_METHOD "layout" #define FINITEELEMENTSPACE_NODECOORDS_METHOD "nodeCoords" diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index 4c4e5ef2e..895d8db3b 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -12,9 +12,17 @@ import optimize4 import "qtensortools.xmorpho" class CG3MeshRefiner is MeshRefiner { + _tol() { return 1e-10 } + _iscg3surfacefield(field) { + var fespace = field.finiteElementSpace() + if (!fespace) return false + var shape = field.shape() - return shape.count()==3 && shape[0]==1 && shape[1]==2 && shape[2]==1 + return fespace.grade()==2 && + fespace.count()==10 && + shape.count()==3 && + shape[0]==1 && shape[1]==2 && shape[2]==1 } _edgekey(a, b) { @@ -50,12 +58,57 @@ class CG3MeshRefiner is MeshRefiner { return field.evalElement(faceid, lambda) } + _point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x + } + + _edgeparameter(xa, xb, x) { + var dx = xb-xa + return (x-xa).inner(dx)/dx.inner(dx) + } + + _edgepositions(nodes) { + var pos = [] + var tol = self._tol() + + for (i in 0...nodes.dimensions()[1]) { + var lambda = nodes.column(i) + var zero = -1 + var nzero = 0 + + for (j in 0...lambda.count()) { + if (abs(lambda[j])=0) { + var vid = fvids[vertex] + if (!vertexdone.contains(vid)) { + result[0, vid] = val + vertexdone[vid] = true + } + continue + } + + var zero = [] + for (j in 0...lambda.count()) if (abs(lambda[j]) Date: Mon, 18 May 2026 22:16:33 +0200 Subject: [PATCH 435/473] FiniteElementIndex.nodeElementIndex --- src/geometry/fespace.c | 73 ++++++++++++--- src/geometry/fespace.h | 2 + .../smectic/smectic_staged_demo.xmorpho | 92 ++++--------------- 3 files changed, 79 insertions(+), 88 deletions(-) diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 4975c1c7f..a716e4787 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -893,6 +893,41 @@ static int fespace_orientedquantity(fespace *disc, grade g, fespacesubelement *s return nedgeq-indx-1; } +/** Returns the FE-local field index tuple (grade, subelement id, local dof index) for a node. */ +bool fespace_nodefieldindex(fespace *disc, int node, grade *g, int *sid, int *indx) { + if (node<0 || node>=disc->nnodes) return false; + + int k=0; + for (eldefninstruction *instr=disc->eldefn; instr!=NULL && *instr!=ENDDEFN; ) { + eldefninstruction op=FETCH(instr); + switch(op) { + case LINE_OPCODE: + case AREA_OPCODE: + FETCH(instr); // local subelement id + for (int i=0; i<=op; i++) FETCH(instr); // local vertex ids + break; + case QUANTITY_OPCODE: + { + grade qg = FETCH(instr); + int qsid = FETCH(instr); + int qindx = FETCH(instr); + if (k==node) { + if (g) *g=qg; + if (sid) *sid=qsid; + if (indx) *indx=qindx; + return true; + } + k++; + } + break; + default: + UNREACHABLE("Error in finite element definition"); + } + } + + return false; +} + /** Steps through an element definition, generating subelements and identifying quantities */ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids, fieldindx *findx) { fespacesubelement subel[disc->nsubel+1]; // Element IDs and orientation of subelements @@ -1062,10 +1097,7 @@ value fespace_constructor(vm *v, int nargs, value *args) { if (d) { objectfespace *obj=objectfespace_new(d); - if (obj) { - out = MORPHO_OBJECT(obj); - morpho_bindobjects(v, 1, &out); - } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + out = morpho_wrapandbind(v, (object *) obj); } else morpho_runtimeerror(v, FNSPC_NOTFOUND, label, MORPHO_GETINTEGERVALUE(grd)); } else morpho_runtimeerror(v, FNSPC_ARGS); @@ -1090,11 +1122,27 @@ value FiniteElementSpace_layout(vm *v, int nargs, value *args) { objectfield *field = MORPHO_GETFIELD(MORPHO_GETARG(args, 0)); objectsparse *new; - if (fespace_layout(field, slf->fespace, &new)) { - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); + if (fespace_layout(field, slf->fespace, &new)) out=morpho_wrapandbind(v, (object *) new); + } + return out; +} + +value FiniteElementSpace_nodeelementindex(vm *v, int nargs, value *args) { + value out=MORPHO_NIL; + objectfespace *slf = MORPHO_GETFESPACE(MORPHO_SELF(args)); + + if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + grade g; + int sid, indx; + + if (fespace_nodefieldindex(slf->fespace, i, &g, &sid, &indx)) { + value entries[3] = { MORPHO_INTEGER(g), MORPHO_INTEGER(sid), MORPHO_INTEGER(indx) }; + objecttuple *new = object_newtuple(3, entries); + out=morpho_wrapandbind(v, (object *) new); } } + return out; } @@ -1117,19 +1165,15 @@ value FiniteElementSpace_nodecoords(vm *v, int nargs, value *args) { matrix_setcolumn(new, i, lambda); } - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); + out=morpho_wrapandbind(v, (object *) new); } else if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { int i = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); double lambda[nrows]; if (fespace_getnodecoords(disc, i, lambda)) { objectmatrix *new = object_newmatrix(nrows, 1, true); - if (new) { - matrix_setcolumn(new, 0, lambda); - out=MORPHO_OBJECT(new); - morpho_bindobjects(v, 1, &out); - } + if (new) matrix_setcolumn(new, 0, lambda); + out=morpho_wrapandbind(v, (object *) new); } } @@ -1140,6 +1184,7 @@ MORPHO_BEGINCLASS(FiniteElementSpace) MORPHO_METHOD(MORPHO_COUNT_METHOD, FiniteElementSpace_count, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FINITEELEMENTSPACE_GRADE_METHOD, FiniteElementSpace_grade, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FINITEELEMENTSPACE_LAYOUT_METHOD, FiniteElementSpace_layout, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FINITEELEMENTSPACE_NODEELEMENTINDEX_METHOD, FiniteElementSpace_nodeelementindex, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FINITEELEMENTSPACE_NODECOORDS_METHOD, FiniteElementSpace_nodecoords, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/geometry/fespace.h b/src/geometry/fespace.h index cc7ae22fd..3aadb1f2b 100644 --- a/src/geometry/fespace.h +++ b/src/geometry/fespace.h @@ -77,6 +77,7 @@ typedef struct { #define FINITEELEMENTSPACE_GRADE_METHOD "grade" #define FINITEELEMENTSPACE_LAYOUT_METHOD "layout" +#define FINITEELEMENTSPACE_NODEELEMENTINDEX_METHOD "nodeElementIndex" #define FINITEELEMENTSPACE_NODECOORDS_METHOD "nodeCoords" /* ------------------------------------------------------- @@ -97,6 +98,7 @@ fespace *fespace_find(char *name, grade g); fespace *fespace_findlinear(grade g); bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids, fieldindx *findx); +bool fespace_nodefieldindex(fespace *disc, int node, grade *g, int *sid, int *indx); bool fespace_lower(fespace *disc, grade target, fespace **out); diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index 895d8db3b..17db98749 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -12,8 +12,6 @@ import optimize4 import "qtensortools.xmorpho" class CG3MeshRefiner is MeshRefiner { - _tol() { return 1e-10 } - _iscg3surfacefield(field) { var fespace = field.finiteElementSpace() if (!fespace) return false @@ -64,38 +62,11 @@ class CG3MeshRefiner is MeshRefiner { return x } - _edgeparameter(xa, xb, x) { - var dx = xb-xa - return (x-xa).inner(dx)/dx.inner(dx) - } - - _edgepositions(nodes) { - var pos = [] - var tol = self._tol() - - for (i in 0...nodes.dimensions()[1]) { - var lambda = nodes.column(i) - var zero = -1 - var nzero = 0 - - for (j in 0...lambda.count()) { - if (abs(lambda[j])=0) { - var vid = fvids[vertex] + if (g==0) { + var vid = fvids[sid] if (!vertexdone.contains(vid)) { result[0, vid] = val vertexdone[vid] = true } - continue - } - - var zero = [] - for (j in 0...lambda.count()) if (abs(lambda[j]) Date: Mon, 18 May 2026 22:49:46 +0200 Subject: [PATCH 436/473] Barycentric coordinates helper --- src/geometry/mesh.c | 87 +++++++++++++++++++ src/geometry/mesh.h | 11 +++ .../smectic/smectic_staged_demo.xmorpho | 35 ++------ test/mesh/barycentric.morpho | 16 ++++ 4 files changed, 119 insertions(+), 30 deletions(-) create mode 100644 test/mesh/barycentric.morpho diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 903268a6d..fecc7d398 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -163,6 +163,52 @@ bool mesh_getvertexcoordinatesasvalues(objectmesh *mesh, elementid id, value *va return success; } +bool mesh_getbarycentriccoordinates(objectmesh *mesh, grade g, elementid id, double *x, double *lambda) { + if (g<1 || g>mesh_maxgrade(mesh)) return false; + + objectsparse *conn=mesh_getconnectivityelement(mesh, 0, g); + if (!conn) return false; + + int nentries, *entries; + if (!mesh_getconnectivity(conn, id, &nentries, &entries) || nentries!=g+1) return false; + + double *verts[4]; + for (int i=0; idim], edges[g][mesh->dim]; + objectmatrix gram = MORPHO_STATICMATRIX(gramdata, g, g); + objectmatrix rhs = MORPHO_STATICMATRIX(rhsdata, g, 1); + objectmatrix alpha = MORPHO_STATICMATRIX(alphadata, g, 1); + matrix_zero(&gram); + matrix_zero(&rhs); + + functional_vecsub(mesh->dim, x, verts[0], dx); + for (int i=0; idim, verts[i+1], verts[0], edges[i]); + } + + for (int i=0; idim, edges[i], dx); + for (int j=0; jdim, edges[i], edges[j]); + } + } + bool success=(matrix_divs(&gram, &rhs, &alpha)==MATRIX_OK); + if (success) { + double sum=0.0; + for (int i=0; idim @@ -1276,6 +1322,43 @@ value Mesh_count(vm *v, int nargs, value *args) { return out; } +value Mesh_barycentric(vm *v, int nargs, value *args) { + objectmesh *m=MORPHO_GETMESH(MORPHO_SELF(args)); + value out=MORPHO_NIL; + + if (nargs==3 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0)) && + MORPHO_ISINTEGER(MORPHO_GETARG(args, 1)) && + MORPHO_ISMATRIX(MORPHO_GETARG(args, 2))) { + grade g=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + elementid id=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + objectmatrix *x=MORPHO_GETMATRIX(MORPHO_GETARG(args, 2)); + + if (x->nrows!=m->dim || x->ncols!=1) { + morpho_runtimeerror(v, MESH_BARYDIM); + return MORPHO_NIL; + } + if (g<1 || g>mesh_maxgrade(m)) { + morpho_runtimeerror(v, MESH_BARYFAILED); + return MORPHO_NIL; + } + + objectmatrix *lambda=object_newmatrix(g+1, 1, true); + if (!lambda) { + morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + return MORPHO_NIL; + } + if (!mesh_getbarycentriccoordinates(m, g, id, x->elements, lambda->elements)) { + object_free((object *) lambda); + morpho_runtimeerror(v, MESH_BARYFAILED); + return MORPHO_NIL; + } + + out=morpho_wrapandbind(v, (object *) lambda); + } else morpho_runtimeerror(v, MESH_BARYARGS); + + return out; +} + /** Clones a mesh */ value Mesh_clone(vm *v, int nargs, value *args) { value out=MORPHO_NIL; @@ -1302,6 +1385,7 @@ MORPHO_METHOD(MESH_REMOVEGRADE_METHOD, Mesh_removegrade, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MESH_ADDSYMMETRY_METHOD, Mesh_addsymmetry, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MESH_MAXGRADE_METHOD, Mesh_maxgrade, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_COUNT_METHOD, Mesh_count, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(MESH_BARYCENTRIC_METHOD, Mesh_barycentric, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(MORPHO_CLONE_METHOD, Mesh_clone, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS @@ -1337,6 +1421,9 @@ void mesh_initialize(void) { morpho_defineerror(MESH_INVLDID, ERROR_HALT, MESH_INVLDID_MSG); morpho_defineerror(MESH_CNNMTXARGS, ERROR_HALT, MESH_CNNMTXARGS_MSG); morpho_defineerror(MESH_ADDGRDARGS, ERROR_HALT, MESH_ADDGRDARGS_MSG); + morpho_defineerror(MESH_BARYARGS, ERROR_HALT, MESH_BARYARGS_MSG); + morpho_defineerror(MESH_BARYDIM, ERROR_HALT, MESH_BARYDIM_MSG); + morpho_defineerror(MESH_BARYFAILED, ERROR_HALT, MESH_BARYFAILED_MSG); morpho_defineerror(MESH_ADDGRDOOB, ERROR_HALT, MESH_ADDGRDOOB_MSG); morpho_defineerror(MESH_ADDSYMARGS, ERROR_HALT, MESH_ADDSYMARGS_MSG); morpho_defineerror(MESH_ADDSYMMSNGTRNSFRM, ERROR_HALT, MESH_ADDSYMMSNGTRNSFRM_MSG); diff --git a/src/geometry/mesh.h b/src/geometry/mesh.h index 0a530fa77..f1a59767c 100644 --- a/src/geometry/mesh.h +++ b/src/geometry/mesh.h @@ -62,6 +62,7 @@ objectmesh *object_newmesh(unsigned int dim, unsigned int nv, double *v); #define MESH_REMOVEGRADE_METHOD "removegrade" #define MESH_MAXGRADE_METHOD "maxgrade" #define MESH_ADDSYMMETRY_METHOD "addsymmetry" +#define MESH_BARYCENTRIC_METHOD "barycentric" #define MESH_TRANSFORM_METHOD "transform" @@ -120,6 +121,15 @@ DECLARE_VARRAY(elementid, elementid); #define MESH_ADDSYMARGS "MshAddSymArgs" #define MESH_ADDSYMARGS_MSG "Method 'addsymmetry' expects an object that provides a method 'transform' and an optional selection." +#define MESH_BARYARGS "MshBaryArgs" +#define MESH_BARYARGS_MSG "Method 'barycentric' expects a grade, an element id and a position matrix." + +#define MESH_BARYDIM "MshBaryDim" +#define MESH_BARYDIM_MSG "Position matrix dimensions inconsistent with mesh." + +#define MESH_BARYFAILED "MshBaryFailed" +#define MESH_BARYFAILED_MSG "Unable to compute barycentric coordinates for the given element." + #define MESH_ADDSYMMSNGTRNSFRM "MshAddSymMsngTrnsfrm" #define MESH_ADDSYMMSNGTRNSFRM_MSG "Method 'addsymmetry' expects an object that provides a method 'transform'." @@ -156,6 +166,7 @@ void mesh_resetconnectivity(objectmesh *m); bool mesh_getvertexcoordinates(objectmesh *mesh, elementid id, double *val); bool mesh_getvertexcoordinatesaslist(objectmesh *mesh, elementid id, double **out); bool mesh_getvertexcoordinatesasvalues(objectmesh *mesh, elementid id, value *val); +bool mesh_getbarycentriccoordinates(objectmesh *mesh, grade g, elementid id, double *x, double *lambda); bool mesh_getsynonyms(objectmesh *mesh, grade g, elementid id, varray_elementid *synonymids); int mesh_findneighbors(objectmesh *mesh, grade g, elementid id, grade target, varray_elementid *neighbors); diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index 17db98749..ad4022fae 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -28,31 +28,8 @@ class CG3MeshRefiner is MeshRefiner { return "${b}:${a}" } - _barycentric(a, b, c, p) { - var v0 = b-a - var v1 = c-a - var v2 = p-a - - var d00 = v0.inner(v0) - var d01 = v0.inner(v1) - var d11 = v1.inner(v1) - var d20 = v2.inner(v0) - var d21 = v2.inner(v1) - var denom = d00*d11 - d01*d01 - - var l1 = (d11*d20 - d01*d21)/denom - var l2 = (d00*d21 - d01*d20)/denom - var l0 = 1-l1-l2 - - return [l0, l1, l2] - } - - _eval(field, faceid, x, oldverts, oldfaces) { - var vids = oldfaces.rowindices(faceid) - var a = oldverts.column(vids[0]) - var b = oldverts.column(vids[1]) - var c = oldverts.column(vids[2]) - var lambda = self._barycentric(a, b, c, x) + _eval(field, oldmesh, faceid, x) { + var lambda = oldmesh.barycentric(field.finiteElementSpace().grade(), faceid, x) return field.evalElement(faceid, lambda) } @@ -80,8 +57,6 @@ class CG3MeshRefiner is MeshRefiner { var nodes = fespace.nodeCoords() var oldmesh = self.mesh() - var oldverts = oldmesh.vertexmatrix() - var oldfaces = oldmesh.connectivitymatrix(0, 2) var newverts = self.new.vertexmatrix() var newfaces = self.new.connectivitymatrix(0, 2) @@ -95,8 +70,8 @@ class CG3MeshRefiner is MeshRefiner { var vertexdone = Dictionary() var edgedone = Dictionary() - for (newfid in self.refinemap[2]) { - var oldfid = self.refinemap[2][newfid] + for (newfid in self.refinemap[fespace.grade()]) { + var oldfid = self.refinemap[fespace.grade()][newfid] var fvids = newfaces.rowindices(newfid) for (i in 0...fespace.count()) { @@ -106,7 +81,7 @@ class CG3MeshRefiner is MeshRefiner { var sid = findx[1] var indx = findx[2] var x = self._point(lambda, fvids, newverts) - var val = self._eval(field, oldfid, x, oldverts, oldfaces) + var val = self._eval(field, oldmesh, oldfid, x) if (g==0) { var vid = fvids[sid] diff --git a/test/mesh/barycentric.morpho b/test/mesh/barycentric.morpho new file mode 100644 index 000000000..73cbef857 --- /dev/null +++ b/test/mesh/barycentric.morpho @@ -0,0 +1,16 @@ +var a = Mesh("square.mesh") + +print a.barycentric(2, 0, Matrix([0, 0, 0])) +// expect: [ 1 ] +// expect: [ 0 ] +// expect: [ 0 ] + +print a.barycentric(2, 0, Matrix([0.25, 0.25, 0])) +// expect: [ 0.5 ] +// expect: [ 0.25 ] +// expect: [ 0.25 ] + +print a.barycentric(2, 1, Matrix([0.75, 0.75, 0])) +// expect: [ 0.25 ] +// expect: [ 0.25 ] +// expect: [ 0.5 ] From 90d93a66bc85cfdfa1bc2cd38bbd71ed7ec67a05 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 18 May 2026 23:39:56 +0200 Subject: [PATCH 437/473] Field_elementdofs_method --- src/geometry/field.c | 50 ++++++++++++++++++++++++++++++++++ src/geometry/field.h | 1 + test/field/element_dofs.morpho | 41 ++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 test/field/element_dofs.morpho diff --git a/src/geometry/field.c b/src/geometry/field.c index aa0f818db..15ccebea9 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -1052,6 +1052,55 @@ value Field_evalelement_method(vm *v, int nargs, value *args) { return out; } +value Field_elementdofs_method(vm *v, int nargs, value *args) { + value out = MORPHO_NIL; + objectfield *field=MORPHO_GETFIELD(MORPHO_SELF(args)); + objectlist *list = NULL; + if (!MORPHO_ISFESPACE(field->fnspc)) return out; + + fespace *disc = MORPHO_GETFESPACE(field->fnspc)->fespace; + if (nargs==1 && MORPHO_ISINTEGER(MORPHO_GETARG(args, 0))) { + elementid el = MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + fieldindx findx[disc->nnodes]; + if (!field_getelementdofs(field, disc, el, findx)) return out; + + list = object_newlist(0, NULL); + if (!list) goto field_elementdofs_cleanup; + + for (int i=0; innodes; i++) { + value entries[3] = { + MORPHO_INTEGER(findx[i].g), + MORPHO_INTEGER(findx[i].id), + MORPHO_INTEGER(findx[i].indx) + }; + objecttuple *tuple = object_newtuple(3, entries); + if (!tuple) goto field_elementdofs_cleanup; + list_append(list, MORPHO_OBJECT(tuple)); + } + + /* Temporarily append a self reference so everything can be bound in one go. */ + list_append(list, MORPHO_OBJECT(list)); + morpho_bindobjects(v, list->val.count, list->val.data); + list->val.count--; + out = MORPHO_OBJECT(list); + } + + return out; + +field_elementdofs_cleanup: + morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); + + if (list) { + for (unsigned int i=0; ival.count; i++) { + value el=list->val.data[i]; + if (MORPHO_ISOBJECT(el)) object_free(MORPHO_GETOBJECT(el)); + } + object_free((object *) list); + } + + return MORPHO_NIL; +} + /** Get the matrix that stores the Field */ value Field_linearize(vm *v, int nargs, value *args) { objectfield *f=MORPHO_GETFIELD(MORPHO_SELF(args)); @@ -1097,6 +1146,7 @@ MORPHO_METHOD(FIELD_FESPACE_METHOD, Field_fnspace, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_PROTOTYPE_METHOD, Field_prototype, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_MESH_METHOD, Field_mesh, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_EVALELEMENT_METHOD, Field_evalelement_method, BUILTIN_FLAGSEMPTY), +MORPHO_METHOD(FIELD_ELEMENTDOFS_METHOD, Field_elementdofs_method, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD_LINEARIZE_METHOD, Field_linearize, BUILTIN_FLAGSEMPTY), MORPHO_METHOD(FIELD__LINEARIZE_METHOD, Field_unsafelinearize, BUILTIN_FLAGSEMPTY) MORPHO_ENDCLASS diff --git a/src/geometry/field.h b/src/geometry/field.h index d96d5d15a..52a531776 100644 --- a/src/geometry/field.h +++ b/src/geometry/field.h @@ -76,6 +76,7 @@ extern value field_gradeoption; #define FIELD_PROTOTYPE_METHOD "prototype" #define FIELD_MESH_METHOD "mesh" #define FIELD_EVALELEMENT_METHOD "evalElement" +#define FIELD_ELEMENTDOFS_METHOD "elementDofs" #define FIELD_LINEARIZE_METHOD "linearize" #define FIELD__LINEARIZE_METHOD "__linearize" diff --git a/test/field/element_dofs.morpho b/test/field/element_dofs.morpho new file mode 100644 index 000000000..ea99dd22b --- /dev/null +++ b/test/field/element_dofs.morpho @@ -0,0 +1,41 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +var cg3 = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y) (x+y)^3, finiteelementspace=cg3) +var dofs = f.elementDofs(0) + +print dofs.count() +// expect: 10 + +print dofs[0] +// expect: (0, 0, 0) +print dofs[1] +// expect: (0, 1, 0) +print dofs[2] +// expect: (0, 2, 0) + +print dofs[3] +// expect: (1, 0, 0) +print dofs[4] +// expect: (1, 0, 1) + +print dofs[5] +// expect: (1, 2, 0) +print dofs[6] +// expect: (1, 2, 1) + +print dofs[7] +// expect: (1, 1, 1) +print dofs[8] +// expect: (1, 1, 0) + +print dofs[9] +// expect: (2, 0, 0) From cb860f6a7e532adbb623940e8e32f68cc1c681b1 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 19 May 2026 11:20:19 +0200 Subject: [PATCH 438/473] Fixed 3D refinement and FE refinement --- modules/meshtools.morpho | 105 +++++++++++++++--- src/geometry/fespace.c | 20 ++-- src/geometry/field.c | 4 +- src/linalg/sparse.c | 4 +- test/field/element_dofs_3d_cg2.morpho | 33 ++++++ test/field/element_dofs_3d_cg3.morpho | 33 ++++++ .../smectic/smectic_staged_demo.xmorpho | 102 +---------------- .../meshtools/debug_elementdofs_3d.morpho | 82 ++++++++++++++ .../meshtools/refine1d_topology.morpho | 20 ++++ .../meshtools/refine2d_topology.morpho | 33 ++++++ .../meshtools/refine3d_topology.morpho | 45 ++++++++ .../meshtools/refine3d_topology_2tets.morpho | 40 +++++++ test/modules/meshtools/refinecg2.morpho | 62 +++++++++++ test/modules/meshtools/refinecg2_3d.morpho | 67 +++++++++++ test/modules/meshtools/refinecg3.morpho | 62 +++++++++++ test/modules/meshtools/refinecg3_3d.morpho | 67 +++++++++++ 16 files changed, 651 insertions(+), 128 deletions(-) create mode 100644 test/field/element_dofs_3d_cg2.morpho create mode 100644 test/field/element_dofs_3d_cg3.morpho create mode 100644 test/modules/meshtools/debug_elementdofs_3d.morpho create mode 100644 test/modules/meshtools/refine1d_topology.morpho create mode 100644 test/modules/meshtools/refine2d_topology.morpho create mode 100644 test/modules/meshtools/refine3d_topology.morpho create mode 100644 test/modules/meshtools/refine3d_topology_2tets.morpho create mode 100644 test/modules/meshtools/refinecg2.morpho create mode 100644 test/modules/meshtools/refinecg2_3d.morpho create mode 100644 test/modules/meshtools/refinecg3.morpho create mode 100644 test/modules/meshtools/refinecg3_3d.morpho diff --git a/modules/meshtools.morpho b/modules/meshtools.morpho index 46b07ad85..f6e985f2c 100644 --- a/modules/meshtools.morpho +++ b/modules/meshtools.morpho @@ -648,14 +648,66 @@ class MeshAdaptiveRefiner { // Subclasses should replace this method with their own version adaptmesh(selection) { } + _evalfield(field, oldmesh, elid, x) { + var lambda = oldmesh.barycentric(field.finiteElementSpace().grade(), elid, x) + return field.evalElement(elid, lambda) + } + + _point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x + } + + _setdof(field, dof, val) { + if (dof[0]==0) field[0, dof[1]] = val + else field[dof[0], dof[1], dof[2]] = val + } + + adaptfefield(field) { + if (!self.refinemap) return nil + + var fespace = field.finiteElementSpace() + var prototype = field.enumerate(0) + if (isobject(prototype)) prototype = prototype.clone() + if (!prototype) return nil + + var result = Field(self.new, prototype, grade=field.shape(), finiteelementspace=fespace) + var nodes = fespace.nodeCoords() + var oldmesh = self.mesh() + var newverts = self.new.vertexmatrix() + var newconn = self.new.connectivitymatrix(0, fespace.grade()) + var refineel = self.refinemap[fespace.grade()] + var done = Dictionary() + + for (newid in refineel) { + var oldid = refineel[newid] + var vids = newconn.rowindices(newid) + var dofs = result.elementDofs(newid) + + for (i in 0...fespace.count()) { + var dof = dofs[i] + if (done.contains(dof)) continue + + var x = self._point(nodes.column(i), vids, newverts) + var val = self._evalfield(field, oldmesh, oldid, x) + self._setdof(result, dof, val) + done[dof] = true + } + } + + return result + } + adaptfield(field) { // Maps a field onto a new mesh - var mesh = self.mesh() var prototype = field.enumerate(0) if (isobject(prototype)) prototype=prototype.clone() var shape = field.shape() var fespace = field.finiteElementSpace() var result + if (fespace) return self.adaptfefield(field) + if (self.refinemap && prototype) { result = Field(self.new, prototype, grade=shape, finiteelementspace=fespace) @@ -874,18 +926,45 @@ class MeshRefiner is MeshAdaptiveRefiner { localmap[i]=el[i] } + fn _pairkey(i, j) { + if (i0) { + for (e in t.sets(2)) self.addelement(id, lineGrade, _mapel(e), nil) + } + + if (nel[2]>0) { + for (e in t.sets(3)) self.addelement(id, areaGrade, _mapel(e), nil) } } return true diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index a716e4787..929595927 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -882,7 +882,8 @@ typedef struct { /** Remaps an edge-local quantity index if the matched line orientation is reversed. */ static int fespace_orientedquantity(fespace *disc, grade g, fespacesubelement *subel, int sid, int indx) { - if (g!=MESH_GRADE_LINE || !subel[sid].reversed) return indx; + int stride = disc->nsubel+1; + if (g!=MESH_GRADE_LINE || !subel[g*stride+sid].reversed) return indx; fespace *lower; if (!fespace_lower(disc, g, &lower)) return indx; @@ -930,7 +931,8 @@ bool fespace_nodefieldindex(fespace *disc, int node, grade *g, int *sid, int *in /** Steps through an element definition, generating subelements and identifying quantities */ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids, fieldindx *findx) { - fespacesubelement subel[disc->nsubel+1]; // Element IDs and orientation of subelements + int stride = disc->nsubel+1; + fespacesubelement subel[(disc->grade+1)*stride]; // Element IDs and orientation of subelements int sid, svids[nv], nmatch, k=0; objectsparse *vmatrix[disc->grade+1]; // Vertex->elementid connectivity matrices @@ -952,16 +954,19 @@ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids sid = FETCH(instr); for (int i=0; i<=op; i++) svids[i] = vids[FETCH(instr)]; - if (!mesh_matchelements(vmatrix[op], op, op+1, svids, 1, &nmatch, &subel[sid].id)) return false; + fespacesubelement *matched = &subel[op*stride+sid]; + matched->id = -1; + if (!mesh_matchelements(vmatrix[op], op, op+1, svids, 1, &nmatch, &matched->id)) return false; + if (nmatch!=1 || matched->id<0) return false; - subel[sid].reversed=false; + matched->reversed=false; if (op==LINE_OPCODE) { int nlinev, *linevids; - if (!lineconn || !mesh_getconnectivity(lineconn, subel[sid].id, &nlinev, &linevids)) return false; + if (!lineconn || !mesh_getconnectivity(lineconn, matched->id, &nlinev, &linevids)) return false; if (nlinev!=2) return false; if (linevids[0]==svids[1] && linevids[1]==svids[0]) { - subel[sid].reversed=true; + matched->reversed=true; } else if (!(linevids[0]==svids[0] && linevids[1]==svids[1])) { return false; } @@ -972,7 +977,7 @@ bool fespace_doftofieldindx(objectfield *field, fespace *disc, int nv, int *vids { findx[k].g=FETCH(instr); int sid=FETCH(instr); - findx[k].id=(findx[k].g==0 ? vids[sid]: subel[sid].id); + findx[k].id=(findx[k].g==0 ? vids[sid]: subel[findx[k].g*stride+sid].id); findx[k].indx=fespace_orientedquantity(disc, findx[k].g, subel, sid, FETCH(instr)); k++; } @@ -1016,6 +1021,7 @@ bool fespace_getnodecoords(fespace *disc, int node, double *lambda) { /** Constructs a layout matrix that maps element ids (columns) to degree of freedom indices in a field */ bool fespace_layout(objectfield *field, fespace *disc, objectsparse **out) { objectsparse *conn = mesh_getconnectivityelement(field->mesh, 0, disc->grade); + if (!conn) conn = mesh_addconnectivityelement(field->mesh, 0, disc->grade); elementid nel=mesh_nelements(conn); objectsparse *new = object_newsparse(NULL, NULL); diff --git a/src/geometry/field.c b/src/geometry/field.c index 15ccebea9..68d398ac8 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -209,6 +209,7 @@ bool field_applyfunctiontoelements(vm *v, objectmesh *mesh, value fn, value fnsp fespace *disc = MORPHO_GETFESPACE(fnspc)->fespace; objectsparse *conn = mesh_getconnectivityelement(mesh, 0, disc->grade); + if (!conn) conn = mesh_addconnectivityelement(mesh, 0, disc->grade); if (!conn) return false; elementid nel = mesh_nelements(conn); @@ -432,6 +433,7 @@ static bool field_getelementdofs(objectfield *field, fespace *disc, elementid el if (!field || !disc || !findx) return false; objectsparse *conn = mesh_getconnectivityelement(field->mesh, 0, disc->grade); + if (!conn) conn = mesh_addconnectivityelement(field->mesh, 0, disc->grade); if (!conn) return false; int nv, *vids; @@ -1066,6 +1068,7 @@ value Field_elementdofs_method(vm *v, int nargs, value *args) { list = object_newlist(0, NULL); if (!list) goto field_elementdofs_cleanup; + out = MORPHO_OBJECT(list); for (int i=0; innodes; i++) { value entries[3] = { @@ -1082,7 +1085,6 @@ value Field_elementdofs_method(vm *v, int nargs, value *args) { list_append(list, MORPHO_OBJECT(list)); morpho_bindobjects(v, list->val.count, list->val.data); list->val.count--; - out = MORPHO_OBJECT(list); } return out; diff --git a/src/linalg/sparse.c b/src/linalg/sparse.c index 5606cb01f..55e4659ff 100644 --- a/src/linalg/sparse.c +++ b/src/linalg/sparse.c @@ -1606,8 +1606,8 @@ value Sparse_rowindices(vm *v, int nargs, value *args) { if (sparseccs_getrowindices(&s->ccs, col, &nentries, &entries)) { objectlist *new = object_newlist(nentries, NULL); if (new) { - for (int i=0; ival.data[i]=MORPHO_INTEGER(entries[i]); + new->val.count=nentries; out=MORPHO_OBJECT(new); morpho_bindobjects(v, 1, &out); } else morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); diff --git a/test/field/element_dofs_3d_cg2.morpho b/test/field/element_dofs_3d_cg2.morpho new file mode 100644 index 000000000..65609ea66 --- /dev/null +++ b/test/field/element_dofs_3d_cg2.morpho @@ -0,0 +1,33 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvolume([0,1,2,3]) +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var cg2 = FiniteElementSpace("CG2", grade=3) +var f = Field(m, fn (x,y,z) x^2 + y*z - z, finiteelementspace=cg2) +var dofs = f.elementDofs(0) + +var counts = [0, 0, 0, 0] +var seen = Dictionary() +for (dof in dofs) { + counts[dof[0]] += 1 + seen[dof] = true +} + +print dofs.count() +// expect: 10 + +print counts +// expect: [ 4, 6, 0, 0 ] + +print seen.count() +// expect: 10 + diff --git a/test/field/element_dofs_3d_cg3.morpho b/test/field/element_dofs_3d_cg3.morpho new file mode 100644 index 000000000..3d9da367a --- /dev/null +++ b/test/field/element_dofs_3d_cg3.morpho @@ -0,0 +1,33 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvolume([0,1,2,3]) +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var cg3 = FiniteElementSpace("CG3", grade=3) +var f = Field(m, fn (x,y,z) x^3 - x*y + 2*y*z + z^2, finiteelementspace=cg3) +var dofs = f.elementDofs(0) + +var counts = [0, 0, 0, 0] +var seen = Dictionary() +for (dof in dofs) { + counts[dof[0]] += 1 + seen[dof] = true +} + +print dofs.count() +// expect: 20 + +print counts +// expect: [ 4, 12, 4, 0 ] + +print seen.count() +// expect: 20 + diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index ad4022fae..205e1c600 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -11,106 +11,6 @@ import plot import optimize4 import "qtensortools.xmorpho" -class CG3MeshRefiner is MeshRefiner { - _iscg3surfacefield(field) { - var fespace = field.finiteElementSpace() - if (!fespace) return false - - var shape = field.shape() - return fespace.grade()==2 && - fespace.count()==10 && - shape.count()==3 && - shape[0]==1 && shape[1]==2 && shape[2]==1 - } - - _edgekey(a, b) { - if (a1e-10) return false + } + } + + return true +} + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +var fespace = FiniteElementSpace("CG2", grade=2) +var f = Field(m, fn (x,y) exact([x,y]), finiteelementspace=fespace) +var oldm = m +var oldf = f +var mr = MeshRefiner([m, f]) +var refmap = mr.refine() + +m = refmap[m] +f = refmap[f] + +print m.count(0)==6 +// expect: true +print m.count(1)==9 +// expect: true +print m.count(2)==4 +// expect: true +print f.shape()[0]==1 && f.shape()[1]==1 && f.shape()[2]==0 +// expect: true +print preservesfield(f, oldf, oldm) +// expect: true diff --git a/test/modules/meshtools/refinecg2_3d.morpho b/test/modules/meshtools/refinecg2_3d.morpho new file mode 100644 index 000000000..5cd2ce677 --- /dev/null +++ b/test/modules/meshtools/refinecg2_3d.morpho @@ -0,0 +1,67 @@ +import meshtools + +fn point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x +} + +fn exact(x) { + return x[0]^3 - 0.5*x[0]*x[1] + 2*x[1]^2 + x[2]^3 - x[0]*x[2] + x[1]*x[2] +} + +fn preservesfield(field, oldfield, oldmesh) { + var mesh = field.mesh() + var fespace = field.finiteElementSpace() + var verts = mesh.vertexmatrix() + var cells = mesh.connectivitymatrix(0, 3) + var nodes = fespace.nodeCoords() + + for (cid in 0...mesh.count(3)) { + var vids = cells.rowindices(cid) + for (i in 0...fespace.count()) { + var lambda = nodes.column(i) + var x = point(lambda, vids, verts) + var oldlambda = oldmesh.barycentric(fespace.grade(), 0, x) + var expected = oldfield.evalElement(0, oldlambda) + var val = field.evalElement(cid, lambda) + if (abs(val-expected)>1e-10) return false + } + } + + return true +} + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvolume([0,1,2,3]) +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var fespace = FiniteElementSpace("CG2", grade=3) +var f = Field(m, fn (x,y,z) exact([x,y,z]), finiteelementspace=fespace) +var oldm = m +var oldf = f +var mr = MeshRefiner([m, f]) +var refmap = mr.refine() + +m = refmap[m] +f = refmap[f] + +print m.count(0)==10 +// expect: true +print m.count(1)==25 +// expect: true +print m.count(2)==24 +// expect: true +print m.count(3)==8 +// expect: true +print f.shape()[0]==1 && f.shape()[1]==1 && f.shape()[2]==0 && f.shape()[3]==0 +// expect: true +print preservesfield(f, oldf, oldm) +// expect: true diff --git a/test/modules/meshtools/refinecg3.morpho b/test/modules/meshtools/refinecg3.morpho new file mode 100644 index 000000000..5e96833ce --- /dev/null +++ b/test/modules/meshtools/refinecg3.morpho @@ -0,0 +1,62 @@ +import meshtools + +fn point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x +} + +fn exact(x) { + return x[0]^3 - 0.5*x[0]*x[1] + 2*x[1]^2 +} + +fn preservesfield(field, oldfield, oldmesh) { + var mesh = field.mesh() + var fespace = field.finiteElementSpace() + var verts = mesh.vertexmatrix() + var faces = mesh.connectivitymatrix(0, 2) + var nodes = fespace.nodeCoords() + + for (fid in 0...mesh.count(2)) { + var vids = faces.rowindices(fid) + for (i in 0...fespace.count()) { + var lambda = nodes.column(i) + var x = point(lambda, vids, verts) + var oldlambda = oldmesh.barycentric(fespace.grade(), 0, x) + var expected = oldfield.evalElement(0, oldlambda) + var val = field.evalElement(fid, lambda) + if (abs(val-expected)>1e-10) return false + } + } + + return true +} + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +var fespace = FiniteElementSpace("CG3", grade=2) +var f = Field(m, fn (x,y) exact([x,y]), finiteelementspace=fespace) +var oldm = m +var oldf = f +var mr = MeshRefiner([m, f]) +var refmap = mr.refine() + +m = refmap[m] +f = refmap[f] + +print m.count(0)==6 +// expect: true +print m.count(1)==9 +// expect: true +print m.count(2)==4 +// expect: true +print f.shape()[0]==1 && f.shape()[1]==2 && f.shape()[2]==1 +// expect: true +print preservesfield(f, oldf, oldm) +// expect: true diff --git a/test/modules/meshtools/refinecg3_3d.morpho b/test/modules/meshtools/refinecg3_3d.morpho new file mode 100644 index 000000000..f713b271b --- /dev/null +++ b/test/modules/meshtools/refinecg3_3d.morpho @@ -0,0 +1,67 @@ +import meshtools + +fn point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x +} + +fn exact(x) { + return x[0]^3 - 0.5*x[0]*x[1] + 2*x[1]^2 + x[2]^3 - x[0]*x[2] + x[1]*x[2] +} + +fn preservesfield(field, oldfield, oldmesh) { + var mesh = field.mesh() + var fespace = field.finiteElementSpace() + var verts = mesh.vertexmatrix() + var cells = mesh.connectivitymatrix(0, 3) + var nodes = fespace.nodeCoords() + + for (cid in 0...mesh.count(3)) { + var vids = cells.rowindices(cid) + for (i in 0...fespace.count()) { + var lambda = nodes.column(i) + var x = point(lambda, vids, verts) + var oldlambda = oldmesh.barycentric(fespace.grade(), 0, x) + var expected = oldfield.evalElement(0, oldlambda) + var val = field.evalElement(cid, lambda) + if (abs(val-expected)>1e-10) return false + } + } + + return true +} + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvolume([0,1,2,3]) +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var fespace = FiniteElementSpace("CG3", grade=3) +var f = Field(m, fn (x,y,z) exact([x,y,z]), finiteelementspace=fespace) +var oldm = m +var oldf = f +var mr = MeshRefiner([m, f]) +var refmap = mr.refine() + +m = refmap[m] +f = refmap[f] + +print m.count(0)==10 +// expect: true +print m.count(1)==25 +// expect: true +print m.count(2)==24 +// expect: true +print m.count(3)==8 +// expect: true +print f.shape()[0]==1 && f.shape()[1]==2 && f.shape()[2]==1 && f.shape()[3]==0 +// expect: true +print preservesfield(f, oldf, oldm) +// expect: true From e6918898b6a74b789ca03538100e349290666e6c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 19 May 2026 11:25:17 +0200 Subject: [PATCH 439/473] Cleanup of MeshRefiner --- modules/meshtools.morpho | 59 ++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/modules/meshtools.morpho b/modules/meshtools.morpho index f6e985f2c..df803712e 100644 --- a/modules/meshtools.morpho +++ b/modules/meshtools.morpho @@ -917,70 +917,57 @@ class MeshRefiner is MeshAdaptiveRefiner { } refine3(id, el, vert, nel, dict) { // refine volumes - var nv = el.count() // Number of vertices in the element - var pts = [] // Points defining the element - var localmap = Dictionary() // Maps local ids in pts to correct ids - - for (i in 0...nv) { // Find vertex positions and ids - pts.append(vert.column(el[i])) - localmap[i]=el[i] - } - fn _pairkey(i, j) { if (i0) { - for (e in t.sets(2)) self.addelement(id, lineGrade, _mapel(e), nil) + for (e in t.sets(2)) self.addelement(id, lineGrade, e, nil) } if (nel[2]>0) { - for (e in t.sets(3)) self.addelement(id, areaGrade, _mapel(e), nil) + for (e in t.sets(3)) self.addelement(id, areaGrade, e, nil) } } return true From d6446f97da9822845ab70e2a50a62aec76f18e04 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 19 May 2026 11:30:36 +0200 Subject: [PATCH 440/473] Additional cleanup for the MeshRefiner --- modules/meshtools.morpho | 69 +++++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/modules/meshtools.morpho b/modules/meshtools.morpho index df803712e..b73264571 100644 --- a/modules/meshtools.morpho +++ b/modules/meshtools.morpho @@ -27,6 +27,19 @@ var lineGrade = 1 var areaGrade = 2 var volumeGrade = 3 +// A fixed red refinement of a tetrahedron into four corner tets plus four +// tets that split the central octahedron along the (m01, m23) diagonal. +var _tetRedRefinement = [ + [0, 4, 5, 6], + [1, 4, 7, 8], + [2, 5, 7, 9], + [3, 6, 8, 9], + [4, 5, 6, 9], + [4, 5, 7, 9], + [4, 6, 8, 9], + [4, 7, 8, 9] +] + class MeshBuilder { init(dimension=nil) { self.vertices = [] @@ -918,12 +931,8 @@ class MeshRefiner is MeshAdaptiveRefiner { refine3(id, el, vert, nel, dict) { // refine volumes fn _pairkey(i, j) { - if (i0) { - for (e in t.sets(2)) self.addelement(id, lineGrade, e, nil) + for (e in subtet.sets(2)) self.addelement(id, lineGrade, e, nil) } if (nel[2]>0) { - for (e in t.sets(3)) self.addelement(id, areaGrade, e, nil) + for (e in subtet.sets(3)) self.addelement(id, areaGrade, e, nil) } } return true From 35bbd32cd53fd82cf4618de353b8f07f12afbbd9 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 19 May 2026 11:51:54 +0200 Subject: [PATCH 441/473] Additional regressions for finite element refinement --- test/functionals/smectic/qtensortools.xmorpho | 2 + ...> smectic_fieldgradient_diagnostic.morpho} | 12 +-- ...pho => smectic_stage_gradientcheck.morpho} | 44 +++++----- .../meshtools/refinecg2_3d_2tets.morpho | 84 +++++++++++++++++++ .../meshtools/refinecg3_3d_2tets.morpho | 84 +++++++++++++++++++ 5 files changed, 195 insertions(+), 31 deletions(-) rename test/functionals/smectic/{smectic_fieldgradient_diagnostic.xmorpho => smectic_fieldgradient_diagnostic.morpho} (78%) rename test/functionals/smectic/{smectic_stage_gradientcheck.xmorpho => smectic_stage_gradientcheck.morpho} (76%) create mode 100644 test/modules/meshtools/refinecg2_3d_2tets.morpho create mode 100644 test/modules/meshtools/refinecg3_3d_2tets.morpho diff --git a/test/functionals/smectic/qtensortools.xmorpho b/test/functionals/smectic/qtensortools.xmorpho index 8a013f270..bb1f4877d 100644 --- a/test/functionals/smectic/qtensortools.xmorpho +++ b/test/functionals/smectic/qtensortools.xmorpho @@ -1,5 +1,7 @@ // Tools to work with the Q-tensor in 3D. The Q-tensor is a symmetric traceless 3x3 matrix that describes the local orientational order of liquid crystals. +import graphics + // The q tensor [ Qxx Qxy Qxz ] // [ Qxy Qyy Qyz ] // [ Qxz Qyz Qzz ] diff --git a/test/functionals/smectic/smectic_fieldgradient_diagnostic.xmorpho b/test/functionals/smectic/smectic_fieldgradient_diagnostic.morpho similarity index 78% rename from test/functionals/smectic/smectic_fieldgradient_diagnostic.xmorpho rename to test/functionals/smectic/smectic_fieldgradient_diagnostic.morpho index 653bedb38..0bd1426bb 100644 --- a/test/functionals/smectic/smectic_fieldgradient_diagnostic.xmorpho +++ b/test/functionals/smectic/smectic_fieldgradient_diagnostic.morpho @@ -1,5 +1,4 @@ import meshgen -import plot import "../numericalderivatives.morpho" import "qtensortools.xmorpho" @@ -8,7 +7,7 @@ var I3div3 = IdentityMatrix(3)/3 var tol = 5e-5 var dom = fn (x) -(x[0]^2 + x[1]^2 - 1) -var mg = MeshGen(dom, [-1..1:0.3, -1..1:0.3], quiet=true) +var mg = MeshGen(dom, [-1..1:0.4, -1..1:0.4], quiet=true) var m = ChangeMeshDimension(mg.build(), 3) var feQ = FiniteElementSpace("CG1", grade=2) @@ -27,19 +26,14 @@ fn coupling(x, rho, q) { var area = AreaIntegral(coupling, rho, Q, method={}) var jump = Jump(fn (x, q) jumpdn(q)^2, rho, method={ "strategy": "quadrature" }) -print "area total = ${area.total(m)}" -print "jump total = ${jump.total(m)}" - var areafg = area.fieldgradient(m, rho) var areanum = numericalfieldgradient(area, m, rho) var areaerr = (areafg - areanum).linearize().norm() -print "area fg err = ${areaerr}" -print "area fg ok = ${areaerr < tol}" +print areaerr < tol // expect: true var jumpfg = jump.fieldgradient(m, rho) var jumpnum = numericalfieldgradient(jump, m, rho) var jumperr = (jumpfg - jumpnum).linearize().norm() -print "jump fg err = ${jumperr}" -print "jump fg ok = ${jumperr < tol}" +print jumperr < tol // expect: true diff --git a/test/functionals/smectic/smectic_stage_gradientcheck.xmorpho b/test/functionals/smectic/smectic_stage_gradientcheck.morpho similarity index 76% rename from test/functionals/smectic/smectic_stage_gradientcheck.xmorpho rename to test/functionals/smectic/smectic_stage_gradientcheck.morpho index 9fbaa0cdd..829352ff2 100644 --- a/test/functionals/smectic/smectic_stage_gradientcheck.xmorpho +++ b/test/functionals/smectic/smectic_stage_gradientcheck.morpho @@ -1,5 +1,4 @@ import meshgen -import plot import "../numericalderivatives.morpho" import "qtensortools.xmorpho" @@ -55,10 +54,7 @@ fn checkfunctional(name, func, m, f) { var fg = func.fieldgradient(m, f) var num = numericalfieldgradient(func, m, f) var err = (fg - num).linearize().norm() - print "${name}: total = ${func.total(m)}" - print "${name}: fg err = ${err}" - print "${name}: ok = ${err < tol}" - return fg + return err < tol } fn checkstage(name, functionals, prefactors, m, f) { @@ -68,10 +64,7 @@ fn checkstage(name, functionals, prefactors, m, f) { var fg = combinedfieldgradient(f, gradients, prefactors) var num = numericalstagefieldgradient(functionals, prefactors, m, f) var err = (fg - num).linearize().norm() - - print "${name}: total = ${totalforstage(functionals, prefactors, m)}" - print "${name}: fg err = ${err}" - print "${name}: ok = ${err < tol}" + return err < tol } fn jumpPenaltyBase(m) { @@ -112,23 +105,30 @@ var rho = Field(m, fn (x, y, z) 0.3 + 0.05*cos(sqrt(qsq)*x), finiteelementspace= var qbulk = AreaIntegral(landauQ, Q, method={}) var qcoupling = AreaIntegral(coupling, rho, Q, method={}) -print "== Q components ==" -checkfunctional("q bulk", qbulk, m, Q) -checkfunctional("q coupling", qcoupling, m, Q) -checkstage("Q stage", [qbulk, qcoupling], [1, Bcouple], m, Q) +print checkfunctional("q bulk", qbulk, m, Q) +// expect: true +print checkfunctional("q coupling", qcoupling, m, Q) +// expect: true +print checkstage("Q stage", [qbulk, qcoupling], [1, Bcouple], m, Q) +// expect: true var rholandau = AreaIntegral(landauRho, rho, method={}) var rhocoupling = AreaIntegral(coupling, rho, Q, method={}) var jump = Jump(fn (x, q) jumpdn(q)^2, rho, method={ "strategy": "quadrature" }) -print "== rho components ==" -checkfunctional("rho landau", rholandau, m, rho) -checkfunctional("rho coupling", rhocoupling, m, rho) -checkfunctional("rho jump", jump, m, rho) +print checkfunctional("rho landau", rholandau, m, rho) +// expect: true +print checkfunctional("rho coupling", rhocoupling, m, rho) +// expect: true +print checkfunctional("rho jump", jump, m, rho) +// expect: true var base = jumpPenaltyBase(m) -for (mu in [0, 1, 3, 10]) { - var eta = mu*base - print "== rho stage eta=${eta} ==" - checkstage("rho stage", [rholandau, rhocoupling, jump], [1, Bcouple, eta], m, rho) -} +print checkstage("rho stage", [rholandau, rhocoupling, jump], [1, Bcouple, 0*base], m, rho) +// expect: true +print checkstage("rho stage", [rholandau, rhocoupling, jump], [1, Bcouple, 1*base], m, rho) +// expect: true +print checkstage("rho stage", [rholandau, rhocoupling, jump], [1, Bcouple, 3*base], m, rho) +// expect: true +print checkstage("rho stage", [rholandau, rhocoupling, jump], [1, Bcouple, 10*base], m, rho) +// expect: true diff --git a/test/modules/meshtools/refinecg2_3d_2tets.morpho b/test/modules/meshtools/refinecg2_3d_2tets.morpho new file mode 100644 index 000000000..257540ccc --- /dev/null +++ b/test/modules/meshtools/refinecg2_3d_2tets.morpho @@ -0,0 +1,84 @@ +import meshtools + +fn point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x +} + +fn exact(x) { + return x[0]^3 - 0.5*x[0]*x[1] + 2*x[1]^2 + x[2]^3 - x[0]*x[2] + x[1]*x[2] +} + +fn contains(lambda, tol=1e-10) { + for (l in lambda) { + if (l<-tol || l>1+tol) return false + } + return true +} + +fn coarsevalue(field, mesh, x) { + for (cid in 0...mesh.count(3)) { + var lambda = mesh.barycentric(3, cid, x) + if (contains(lambda)) return field.evalElement(cid, lambda) + } + return nil +} + +fn preservesfield(field, oldfield, oldmesh) { + var mesh = field.mesh() + var fespace = field.finiteElementSpace() + var verts = mesh.vertexmatrix() + var cells = mesh.connectivitymatrix(0, 3) + var nodes = fespace.nodeCoords() + + for (cid in 0...mesh.count(3)) { + var vids = cells.rowindices(cid) + for (i in 0...fespace.count()) { + var lambda = nodes.column(i) + var x = point(lambda, vids, verts) + var expected = coarsevalue(oldfield, oldmesh, x) + if (expected==nil) return false + var val = field.evalElement(cid, lambda) + if (abs(val-expected)>1e-10) return false + } + } + + return true +} + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvertex([0,0,-1]) +mb.addvolume([0,1,2,3]) +mb.addvolume([0,1,2,4]) +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var fespace = FiniteElementSpace("CG2", grade=3) +var f = Field(m, fn (x,y,z) exact([x,y,z]), finiteelementspace=fespace) +var oldm = m +var oldf = f +var mr = MeshRefiner([m, f]) +var refmap = mr.refine() + +m = refmap[m] +f = refmap[f] + +print m.count(0)==14 +// expect: true +print m.count(1)==41 +// expect: true +print m.count(2)==44 +// expect: true +print m.count(3)==16 +// expect: true +print f.shape()[0]==1 && f.shape()[1]==1 && f.shape()[2]==0 && f.shape()[3]==0 +// expect: true +print preservesfield(f, oldf, oldm) +// expect: true diff --git a/test/modules/meshtools/refinecg3_3d_2tets.morpho b/test/modules/meshtools/refinecg3_3d_2tets.morpho new file mode 100644 index 000000000..ca53f88a1 --- /dev/null +++ b/test/modules/meshtools/refinecg3_3d_2tets.morpho @@ -0,0 +1,84 @@ +import meshtools + +fn point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x +} + +fn exact(x) { + return x[0]^3 - 0.5*x[0]*x[1] + 2*x[1]^2 + x[2]^3 - x[0]*x[2] + x[1]*x[2] +} + +fn contains(lambda, tol=1e-10) { + for (l in lambda) { + if (l<-tol || l>1+tol) return false + } + return true +} + +fn coarsevalue(field, mesh, x) { + for (cid in 0...mesh.count(3)) { + var lambda = mesh.barycentric(3, cid, x) + if (contains(lambda)) return field.evalElement(cid, lambda) + } + return nil +} + +fn preservesfield(field, oldfield, oldmesh) { + var mesh = field.mesh() + var fespace = field.finiteElementSpace() + var verts = mesh.vertexmatrix() + var cells = mesh.connectivitymatrix(0, 3) + var nodes = fespace.nodeCoords() + + for (cid in 0...mesh.count(3)) { + var vids = cells.rowindices(cid) + for (i in 0...fespace.count()) { + var lambda = nodes.column(i) + var x = point(lambda, vids, verts) + var expected = coarsevalue(oldfield, oldmesh, x) + if (expected==nil) return false + var val = field.evalElement(cid, lambda) + if (abs(val-expected)>1e-10) return false + } + } + + return true +} + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvertex([0,0,-1]) +mb.addvolume([0,1,2,3]) +mb.addvolume([0,1,2,4]) +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var fespace = FiniteElementSpace("CG3", grade=3) +var f = Field(m, fn (x,y,z) exact([x,y,z]), finiteelementspace=fespace) +var oldm = m +var oldf = f +var mr = MeshRefiner([m, f]) +var refmap = mr.refine() + +m = refmap[m] +f = refmap[f] + +print m.count(0)==14 +// expect: true +print m.count(1)==41 +// expect: true +print m.count(2)==44 +// expect: true +print m.count(3)==16 +// expect: true +print f.shape()[0]==1 && f.shape()[1]==2 && f.shape()[2]==1 && f.shape()[3]==0 +// expect: true +print preservesfield(f, oldf, oldm) +// expect: true From b6ef3e44c804c7f82ea1fd6567d13d3ba6a6f4e4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 19 May 2026 15:52:48 +0200 Subject: [PATCH 442/473] Field Projector --- .../smectic/fieldprojector.xmorpho | 70 ++++++++++++++++++ .../smectic/fieldprojectortest.xmorpho | 72 +++++++++++++++++++ .../smectic/smectic_staged_demo.xmorpho | 6 +- 3 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 test/functionals/smectic/fieldprojector.xmorpho create mode 100644 test/functionals/smectic/fieldprojectortest.xmorpho diff --git a/test/functionals/smectic/fieldprojector.xmorpho b/test/functionals/smectic/fieldprojector.xmorpho new file mode 100644 index 000000000..78bdd5bf2 --- /dev/null +++ b/test/functionals/smectic/fieldprojector.xmorpho @@ -0,0 +1,70 @@ + +import optimize4 + +class FieldProjector { + init(Field field, maxIterations=1000) { + self.field = field + if (!field.finiteElementSpace()) Error("FldPrjNoFES","Field must have finite element space").throw() + + self.maxIterations = maxIterations + self.mesh = self.field.mesh() + self.grade = field.finiteElementSpace().grade() + if (self.grade<1 || self.grade>3) Error("FldPrjGrd","Unsupported field grade").throw() + + self.prototype = self.field.prototype() + if (isnil(self.prototype)) self.prototype = 0 + else self.prototype *= 0 + } + + _integralClass() { + var func = ( nil, LineIntegral, AreaIntegral, VolumeIntegral ) + return func[self.grade] + } + + _distanceSquared() { + if (isnumber(self.prototype)) return fn (x, u, v) { return (u-v)^2 } + else if (self.prototype.respondsto("norm")) return fn (x, u, v) { return (u-v).norm()^2 } + + Error("FldPrjFunc","Unsupported field contents").throw() + } + + _sourceNormSquared() { + if (isnumber(self.prototype)) return fn (x, u) { return u^2 } + else if (self.prototype.respondsto("norm")) return fn (x, u) { return u.norm()^2 } + + Error("FldPrjFunc","Unsupported field contents").throw() + } + + _setupProblem(Field target) { + self.problem = OptimizationProblem(self.field.mesh()) + self.problem.addenergy(self._integralClass()(self._distanceSquared(), self.field, target, method={})) + } + + _setTolerances(control, rtol=1e-8, gtol=1e-10) { + var integral = self._integralClass() + + var measure = integral(fn (x) 1, method={}).total(self.mesh) + var usq = integral(self._sourceNormSquared(), self.field, method={}).total(self.mesh) + + var uscale = 1.0 + if (measure>0 && usq>0) uscale = sqrt(usq/measure) + uscale = max(1.0, uscale) + + control.etol = 0.5*measure*(rtol*uscale)^2 + control.gradtol = gtol*uscale + } + + _optimize(Field target) { + var adapt = ProblemAdapter(self.problem, target) + var opt = LBFGSController(adapt, quiet=true) + self._setTolerances(opt) + opt.optimize(self.maxIterations) + } + + project(FiniteElementSpace fe) { + var target = Field(self.mesh, self.prototype, finiteelementspace=fe) + self._setupProblem(target) + self._optimize(target) + return target + } +} diff --git a/test/functionals/smectic/fieldprojectortest.xmorpho b/test/functionals/smectic/fieldprojectortest.xmorpho new file mode 100644 index 000000000..00cd3eb6c --- /dev/null +++ b/test/functionals/smectic/fieldprojectortest.xmorpho @@ -0,0 +1,72 @@ + +import meshtools +import "fieldprojector.xmorpho" + +fn point(lambda, vids, verts) { + var x = lambda[0]*verts.column(vids[0]) + for (j in 1...lambda.count()) x += lambda[j]*verts.column(vids[j]) + return x +} + +fn maxexacterror(field, exact) { + var mesh = field.mesh() + var fespace = field.finiteElementSpace() + var verts = mesh.vertexmatrix() + var conn = mesh.connectivitymatrix(0, fespace.grade()) + var nodes = fespace.nodeCoords() + var err = 0 + + for (id in 0...mesh.count(fespace.grade())) { + var vids = conn.rowindices(id) + for (i in 0...fespace.count()) { + var lambda = nodes.column(i) + var x = point(lambda, vids, verts) + var expected + if (x.count()==1) expected = apply(exact, x[0]) + else if (x.count()==2) expected = apply(exact, x[0], x[1]) + else expected = apply(exact, x[0], x[1], x[2]) + var val = field.evalElement(id, lambda) + + if (isnumber(val)) { + err = max(err, abs(val-expected)) + } else { + err = max(err, (val-expected).norm()) + } + } + } + + return err +} + +var mb = MeshBuilder() +mb.addvertex([0,0]) +mb.addvertex([1,0]) +mb.addvertex([0,1]) +mb.addface([0,1,2]) +var m = mb.build() +m.addgrade(1) + +fn exact(x, y) { + return 1 + 2*x - 3*y +} + +var cg1 = FiniteElementSpace("CG1", grade=2) +var cg3 = FiniteElementSpace("CG3", grade=2) + +var coarse = Field(m, exact, finiteelementspace=cg1) +var lifted = FieldProjector(coarse).project(cg3) +var liftederr = maxexacterror(lifted, exact) + +print lifted.shape()[0]==1 && lifted.shape()[1]==2 && lifted.shape()[2]==1 +// expect: true +print liftederr < 1e-5 +// expect: true + +var rich = Field(m, exact, finiteelementspace=cg3) +var reduced = FieldProjector(rich).project(cg1) +var reducederr = maxexacterror(reduced, exact) + +print reduced.shape()[0]==1 && reduced.shape()[1]==0 && reduced.shape()[2]==0 +// expect: truer +print reducederr < 1e-5 +// expect: true diff --git a/test/functionals/smectic/smectic_staged_demo.xmorpho b/test/functionals/smectic/smectic_staged_demo.xmorpho index 205e1c600..9350a557e 100644 --- a/test/functionals/smectic/smectic_staged_demo.xmorpho +++ b/test/functionals/smectic/smectic_staged_demo.xmorpho @@ -9,6 +9,7 @@ import meshgen import plot import optimize4 +import "fieldprojector.xmorpho" import "qtensortools.xmorpho" // Physical parameters @@ -338,9 +339,8 @@ class Smectic { } _lowerToCG1(u) { - var phi = Field(self.mesh, 0) - for (i in 0...self.mesh.count()) phi[i] = self.rho[0,i] - return phi + var cg1 = FiniteElementSpace("CG1", grade=2) + return FieldProjector(u).project(cg1) } visualizeSmectic() { From 546be398ac28e89f58a78a64992a5236ff72d518 Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Wed, 20 May 2026 08:39:01 +0200 Subject: [PATCH 443/473] Remove bytecodeoptimizer from some tests --- test/block/empty_block_reachability.morpho | 2 +- test/block/empty_block_reachability_include.morpho | 3 +-- test/class/class_constructor_from_global.morpho | 2 +- test/self/polymorphic_self_dispatch.morpho | 2 +- test/super/super_init_with_internal_behavior.morpho | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/block/empty_block_reachability.morpho b/test/block/empty_block_reachability.morpho index 9af4cab80..5e8019172 100644 --- a/test/block/empty_block_reachability.morpho +++ b/test/block/empty_block_reachability.morpho @@ -1,4 +1,4 @@ -import bytecodeoptimizer +// Reachability of empty block var refine_adaptively = false var refine_iters = 1 diff --git a/test/block/empty_block_reachability_include.morpho b/test/block/empty_block_reachability_include.morpho index 3fe2e3929..e7b7281d7 100644 --- a/test/block/empty_block_reachability_include.morpho +++ b/test/block/empty_block_reachability_include.morpho @@ -1,5 +1,4 @@ - -import bytecodeoptimizer +// Reachability of empty block after include import meshtools diff --git a/test/class/class_constructor_from_global.morpho b/test/class/class_constructor_from_global.morpho index 00cfc92dc..d8bd4a624 100644 --- a/test/class/class_constructor_from_global.morpho +++ b/test/class/class_constructor_from_global.morpho @@ -1,4 +1,4 @@ -import bytecodeoptimizer +// Class constructor from a global variable class MiniSphere { init(vertices, indx) { diff --git a/test/self/polymorphic_self_dispatch.morpho b/test/self/polymorphic_self_dispatch.morpho index 3ca9da05e..e95b76239 100644 --- a/test/self/polymorphic_self_dispatch.morpho +++ b/test/self/polymorphic_self_dispatch.morpho @@ -1,4 +1,4 @@ -import bytecodeoptimizer +// Dispatch with multiple resolutions class Base { run() { return self.step() } diff --git a/test/super/super_init_with_internal_behavior.morpho b/test/super/super_init_with_internal_behavior.morpho index 23a15f088..b2ccb14fa 100644 --- a/test/super/super_init_with_internal_behavior.morpho +++ b/test/super/super_init_with_internal_behavior.morpho @@ -1,4 +1,4 @@ -import bytecodeoptimizer +// Complex initializer var errChebyshevOrderInconsistent = Error("ChebyshevOrder", "Orders are inconsistent") From 781049e5bf7d8dbaf0a9258bbb2a2efb52028ba3 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 21 May 2026 09:05:37 +0200 Subject: [PATCH 444/473] CG3 1D hessian --- src/geometry/fespace.c | 12 + .../cg3/cg3_line_in_1d_hess.morpho | 25 ++ test/functionals/smectic/qtensortools.xmorpho | 122 ------ .../smectic/smectic_staged_demo.xmorpho | 356 ------------------ 4 files changed, 37 insertions(+), 478 deletions(-) create mode 100644 test/field/discretizations/cg3/cg3_line_in_1d_hess.morpho delete mode 100644 test/functionals/smectic/qtensortools.xmorpho delete mode 100644 test/functionals/smectic/smectic_staged_demo.xmorpho diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 929595927..1e048e403 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -175,6 +175,17 @@ void cg3_1dgrad(double *lambda, double *grad) { memcpy(grad, g, sizeof(g)); } +void cg3_1dhess(double *lambda, double *hess) { + double x = lambda[1]; + + #define H(node) hess[FESPACE_HESS_INDEX(4, 1, 0, 0, node)] + H(0) = 18 - 27*x; + H(1) = 27*x - 9; + H(2) = -45 + 81*x; + H(3) = 36 - 81*x; + #undef H +} + unsigned int cg3_1dshape[] = { 1, 2 }; double cg3_1dnodes[] = { 0.0, 1.0, 1.0/3.0, 2.0/3.0 }; @@ -198,6 +209,7 @@ fespace cg3_1d = { .nodes = cg3_1dnodes, .ifn = cg3_1dinterpolate, .gfn = cg3_1dgrad, + .hfn = cg3_1dhess, .eldefn = cg3_1ddefn, .lower = NULL }; diff --git a/test/field/discretizations/cg3/cg3_line_in_1d_hess.morpho b/test/field/discretizations/cg3/cg3_line_in_1d_hess.morpho new file mode 100644 index 000000000..ffa79aa57 --- /dev/null +++ b/test/field/discretizations/cg3/cg3_line_in_1d_hess.morpho @@ -0,0 +1,25 @@ +// CG3 FunctionSpace hessian in one dimension + +import meshtools + +var m = LineMesh(fn (u) [u,0,0], 0..1:0.5) + +var fe = FiniteElementSpace("CG3", grade=1) +var f = Field(m, fn (x,y,z) x^3 + 2*x^2 + 3*x + 4, finiteelementspace=fe) + +var out = true + +fn integrand(x, q) { + var h = hess(q) + var ex = Matrix([[6*x[0] + 4, 0, 0], + [0, 0, 0], + [0, 0, 0]]) + if ((h-ex).norm() > 1e-8) out = false + return 0 +} + +print LineIntegral(integrand, f, method={}).total(m) +// expect: 0 + +print out +// expect: true diff --git a/test/functionals/smectic/qtensortools.xmorpho b/test/functionals/smectic/qtensortools.xmorpho deleted file mode 100644 index bb1f4877d..000000000 --- a/test/functionals/smectic/qtensortools.xmorpho +++ /dev/null @@ -1,122 +0,0 @@ -// Tools to work with the Q-tensor in 3D. The Q-tensor is a symmetric traceless 3x3 matrix that describes the local orientational order of liquid crystals. - -import graphics - -// The q tensor [ Qxx Qxy Qxz ] -// [ Qxy Qyy Qyz ] -// [ Qxz Qyz Qzz ] -// is symmetric and traceless. Hence there are 5 independent components: [ Qxx, Qxy, Qxz, Qyy, Qyz ] -// We will represent these as a vector. - -// Reconstruct Q-tensor from the q-vector -fn reconstructQ(qv) { - return Matrix( [ [ qv[0], qv[1], qv[2] ], [ qv[1], qv[3], qv[4] ], [ qv[2], qv[4], -qv[0]-qv[3] ] ]) -} - -// Reconstruct q-vector from Q-tensor -fn reconstructqv(Q) { - return Matrix([ Q[0,0], Q[0,1], Q[0,2], Q[1,1], Q[1,2] ]) -} - -// Function to get the scalar order parameter S from the Q-tensor -fn qtoorder(qv) { - var Q = reconstructQ(qv) - var ev = Q.eigenvalues() - return max(ev) -} - -// Reconstruct director from Q-tensor -fn qtodirector(qv) { - var Q = reconstructQ(qv) - var es = Q.eigensystem() - var order = es[0].order() // Find largest eigenvalue - var n = es[1].column(order[-1]) // Return associated eigenvector - n/=n.norm() - return n -} - -// Construct a Q tensor from S and n -fn constructQ(S, n) { - return S*(n.outer(n) - IdentityMatrix(3)/3) -} - -// Converts a q-vector to a Q-tensor -fn qtensor(q) { - return Matrix([ [q[0], q[1], q[2]], - [q[1], q[3], q[4]], - [q[2], q[4], -q[0]-q[3]] ]) -} - -// Convert our Q vector Field to a Q tensor field -fn qfield(Q) { - var m = Q.mesh() - var qq = Field(m, qtensor(Q[0,0])) - for (id in 0...m.count(0)) qq[0,id] = qtensor(Q[0,id]) - return qq -} - -// Radial initial condition -fn radialQ(x,y,z) { - var S0 = 0.6 - var n = Matrix([x,y,z]) - if (n.norm()>1e-6) n/=n.norm() - - return S0*Matrix([ n[0]^2 - 1/3, - n[0]*n[1], - n[0]*n[2], - n[1]^2 - 1/3, - n[1]*n[2] ]) -} - -// Uniform initial condition -fn uniformQ(x,y,z) { - var S0 = 0.6 - var n = Matrix([1,0,0]) - return S0*Matrix([ n[0]^2 - 1/3, - n[0]*n[1], - n[0]*n[2], - n[1]^2 - 1/3, - n[1]*n[2] ]) -} - - -fn radialQ(x,y) { return radialQ(x,y,0) } - -// Calculates Fields from Q tensor for visualization purposes -fn qvis(Q) { - var m = Q.mesh() - var e0=Field(m), e1=Field(m), e2=Field(m) - var nn=Field(m, Matrix([1,0,0])) - - for (id in 0...m.count(0)) { - var q = qtensor(Q[0,id]) - var es=q.eigensystem() - var order=es[0].order() - e0[0,id]=es[0][order[-1]] - e1[0,id]=es[0][order[-2]] - e2[0,id]=es[0][order[-3]] - nn[0,id]=es[1].column(order[-1]) - } - - return [e0, e1, e2, nn] -} - -fn _promote(x, n) { - var y = Matrix(n) - for (i in 0...x.count()) y[i] = x[i] - return y -} - -// Visualizes a director field as cylinders. -fn visdirector(n, lambda) { - var m = n.mesh() - var g = Graphics() - for (vid in 0...m.count()) { - var nn=n[0,vid] - if (nn.norm()>1e-6) nn/=nn.norm() - var x = m.vertexposition(vid) - if (x.count()0) print "${label}: grade ${g} count = ${n}" - } - } - - reportQTerms(label) { - fn landau(x, q) { - var trQQ = 2*(q.inner(q)+q[0]*q[3]) - var trQQQ = -3*(q[3]*(q[0]^2 - q[1]^2 + q[2]^2) - - 2*q[1]*q[2]*q[4] + - q[0]*(-q[1]^2 + q[3]^2 + q[4]^2)) - - return -(l/2)*trQQ - (l/3)*trQQQ + (l/2)*(trQQ^2) - } - - fn anchoring(x, q) { - var t = tangent() - var wxx = t[0]*t[0]-0.5 - var wxy = t[0]*t[1] - return (q[0]-wxx)^2+(q[1]-wxy)^2 - } - - fn coupling(x, rho, q) { - var h = hess(rho) - var Q = qtensor(q) - var u = (h + qsq*(Q+I3div3)*rho).norm() - return u*u - } - - var bulk = AreaIntegral(landau, self.Q, method={}).total(self.mesh) - var anchor = 0 - var couple = 0 - - if (EA!=0) anchor = EA*LineIntegral(anchoring, self.Q, method={}).total(self.mesh, selection=self.bnd) - if (Bcouple!=0) couple = Bcouple*AreaIntegral(coupling, self.rho, self.Q, method={}).total(self.mesh) - - print "${label}: Q bulk = ${bulk}" - print "${label}: Q anchor = ${anchor}" - print "${label}: Q couple = ${couple}" - print "${label}: Q total = ${bulk + anchor + couple}" - } - - reportRhoTerms(label) { - fn landauSmectic(x, rho) { - return A*rho^2/2 + B*rho^3/3 + C*rho^4/4 - } - - fn coupling(x, rho, q) { - var h = hess(rho) - var Q = qtensor(q) - var u = (h + qsq*(Q+I3div3)*rho).norm() - return u*u - } - - var landau = AreaIntegral(landauSmectic, self.rho, method={}).total(self.mesh) - var couple = 0 - var jump = 0 - - if (Bcouple!=0) couple = Bcouple*AreaIntegral(coupling, self.rho, self.Q, method={}).total(self.mesh) - if (self.rhoJumpPenalty!=0) { - jump = self.rhoJumpPenalty*Jump(fn (x, q) jumpdn(q)^2, self.rho, - method={ "strategy": "quadrature" }).total(self.mesh) - } - - print "${label}: rho landau = ${landau}" - print "${label}: rho couple = ${couple}" - print "${label}: rho jump = ${jump}" - print "${label}: rho total = ${landau + couple + jump}" - } - - initialMesh() { - var dom = fn (x) -(x[0]^2+x[1]^2-1) - var mg = MeshGen(dom, [-1..1:0.2, -1..1:0.2]) - var m = mg.build() - self.mesh = ChangeMeshDimension(m, 3) - } - - initialField() { - self.Q = Field(self.mesh, uniformQ) - - var cg3 = FiniteElementSpace("CG3", grade=2) - // Seed rho with a weak stripe at the preferred wavelength. - self.rho = Field(self.mesh, - fn (x, y, z) 0.3 + 0.05*cos(sqrt(qsq)*x), - finiteelementspace=cg3) - } - - initialSelection() { - self.bnd = Selection(self.mesh, boundary=true) - } - - initialParameters() { - self.rhoJumpPenalty = 0 - } - - jumpPenaltyBase() { - // Use a simple p^2 / h scaling for CG3 as a baseline. - var h = Length().total(self.mesh) / self.mesh.count(0) - return 9 / h - } - - buildQProblem() { - self.problem = OptimizationProblem(self.mesh) - - fn landau(x, q) { - var trQQ = 2*(q.inner(q)+q[0]*q[3]) - var trQQQ = -3*(q[3]*(q[0]^2 - q[1]^2 + q[2]^2) - - 2*q[1]*q[2]*q[4] + - q[0]*(-q[1]^2 + q[3]^2 + q[4]^2)) - - return -(l/2)*trQQ - (l/3)*trQQQ + (l/2)*(trQQ^2) - } - var bulk = AreaIntegral(landau, self.Q, method={}) - self.problem.addenergy(bulk) - - fn anchoring(x, q) { - var t = tangent() - var wxx = t[0]*t[0]-0.5 - var wxy = t[0]*t[1] - return (q[0]-wxx)^2+(q[1]-wxy)^2 - } - var anchor = LineIntegral(anchoring, self.Q, method={}) - if (EA!=0) self.problem.addenergy(anchor, selection=self.bnd, prefactor=EA) - - fn coupling(x, rho, q) { - var h = hess(rho) - var Q = qtensor(q) - var u = (h + qsq*(Q+I3div3)*rho).norm() - return u*u - } - var lcoupling = AreaIntegral(coupling, self.rho, self.Q, method={}) - if (Bcouple!=0) self.problem.addenergy(lcoupling, prefactor=Bcouple) - - return self.problem - } - - buildRhoProblem() { - self.problem = OptimizationProblem(self.mesh) - - fn landauSmectic(x, rho) { - return A*rho^2/2 + B*rho^3/3 + C*rho^4/4 - } - var lsmectic = AreaIntegral(landauSmectic, self.rho, method={}) - self.problem.addenergy(lsmectic) - - fn coupling(x, rho, q) { - var h = hess(rho) - var Q = qtensor(q) - var u = (h + qsq*(Q+I3div3)*rho).norm() - return u*u - } - var lcoupling = AreaIntegral(coupling, self.rho, self.Q, method={}) - if (Bcouple!=0) self.problem.addenergy(lcoupling, prefactor=Bcouple) - - var jump = Jump(fn (x, q) jumpdn(q)^2, self.rho, - method={ "strategy": "quadrature" }) - if (self.rhoJumpPenalty!=0) self.problem.addenergy(jump, prefactor=self.rhoJumpPenalty) - - self.jumpFunctional = jump - return self.problem - } - - buildQAdapter() { - self.adapter = ProblemAdapter(self.problem, self.Q) - return self.adapter - } - - buildRhoAdapter() { - self.adapter = ProblemAdapter(self.problem, self.rho) - return self.adapter - } - - build() { - self.initialMesh() - self.initialField() - self.initialSelection() - self.initialParameters() - self.buildQProblem() - return self.buildQAdapter() - } - - correctMesh() { - for (id in self.bnd.idlistforgrade(0)) { - var x = self.mesh.vertexposition(id) - self.mesh.setvertexposition(id, x/x.norm()) - } - } - - _maxgrade(f) { - var shape = f.shape() - var maxgrade = 0 - for (s, k in shape) if (s>0) maxgrade = k - return maxgrade - } - - correctField() { - self.reportFieldShape("Before correctField(rho)", self.rho) - if (self._maxgrade(self.rho)<1) return - var shape = self.rho.shape() - var nedgedof = shape[1] - if (nedgedof<=0) return - var conn = self.mesh.connectivitymatrix(0, 1) - for (id in 0...self.mesh.count(1)) { - var v = conn.rowindices(id) - var av = (self.rho[0,v[0]] + self.rho[0,v[1]])/2 - for (j in 0...nedgedof) self.rho[1,id,j] = av - } - self.reportFieldShape("After correctField(rho)", self.rho) - } - - refine() { - var srefine - var mr = MeshRefiner([self.mesh, self.Q, self.rho, self.bnd]) - var refmap = mr.refine(selection=srefine) - - self.mesh = refmap[self.mesh] - self.Q = refmap[self.Q] - self.rho = refmap[self.rho] - self.bnd = refmap[self.bnd] - - print "After refmap:" - print "mesh vertices = ${self.mesh.count(0)}" - print "mesh edges = ${self.mesh.count(1)}" - print "mesh areas = ${self.mesh.count(2)}" - self.reportFieldShape("Refined Q", self.Q) - self.reportFieldShape("Refined rho", self.rho) - - self.correctMesh() - if (!(self.rho.shape().count()==3 && self.rho.shape()[0]==1 && self.rho.shape()[1]==2 && self.rho.shape()[2]==1)) { - self.correctField() - } else { - print "Skipping correctField(rho): CG3 prolongation handled by refiner." - } - equiangulate(self.mesh) - print "After equiangulate:" - print "mesh vertices = ${self.mesh.count(0)}" - print "mesh edges = ${self.mesh.count(1)}" - print "mesh areas = ${self.mesh.count(2)}" - self.reportFieldShape("Post-equiangulate Q", self.Q) - self.reportFieldShape("Post-equiangulate rho", self.rho) - } - - solveQ() { - self.rhoJumpPenalty = 0 - self.buildQProblem() - self.reportQTerms("Before solveQ") - var adapt = self.buildQAdapter() - var control = LBFGSController(adapt) - control.optimize(500) - self.reportQTerms("After solveQ") - } - - solveRhoStage(jumpPenalty) { - self.rhoJumpPenalty = jumpPenalty - self.buildRhoProblem() - self.reportRhoTerms("Before solveRho eta=${jumpPenalty}") - var adapt = self.buildRhoAdapter() - var control = LBFGSController(adapt) - control.optimize(200) - self.reportRhoTerms("After solveRho eta=${jumpPenalty}") - - if (jumpPenalty!=0) { - print "rho stage eta=${jumpPenalty}: jump = ${self.jumpFunctional.total(self.mesh)}" - } - } - - solveRhoSchedule() { - var base = self.jumpPenaltyBase() - var multipliers = [1, 3, 10] - for (mu in multipliers) { - self.solveRhoStage(mu*base) - } - } - - solveCycle() { - self.solveQ() - self.solveRhoSchedule() - } - - solveCycles(ncycles) { - for (k in 0...ncycles) { - print "Alternating cycle ${k+1}" - self.solveCycle() - } - } - - solve() { - self.solveCycles(1) - - print "Refining mesh" - self.refine() - - print "Continuing on refined mesh" - self.solveCycles(1) - } - - _estimateLength() { - return Length().total(self.mesh) / self.mesh.count(0) - } - - visualizeNematic() { - var qfields = qvis(self.Q) - var qplot = plotfield(qfields[0], style="interpolate", - scalebar=ScaleBar(posn=[1.2,0,0])) - return visdirector(qfields[3], self._estimateLength()/2) //+ qplot - } - - _lowerToCG1(u) { - var cg1 = FiniteElementSpace("CG1", grade=2) - return FieldProjector(u).project(cg1) - } - - visualizeSmectic() { - return plotfield(self._lowerToCG1(self.rho), style="interpolate", - scalebar=ScaleBar(posn=[1.2,0,0])) - } -} - -var sim = Smectic() -sim.build() -sim.solve() - -Show(sim.visualizeNematic() + sim.visualizeSmectic()) From 4325e9fce2bc3fee882fa8dbd10432c37692b47a Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Thu, 21 May 2026 09:17:59 +0200 Subject: [PATCH 445/473] Update checkout action version from v3 to v4 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c7f6952ea..93854947e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: configure run: | sudo apt update From 282dfa13ff5597966229a4cf01630bf5bf771125 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 21 May 2026 09:32:52 +0200 Subject: [PATCH 446/473] Fix functional references to new linear algebra --- src/geometry/functional.c | 17 ++++++++--------- src/linalg/matrix.h | 1 + 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 92bf78094..37eba509d 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4365,7 +4365,7 @@ int invjacobianhandle; // TL storage handle for inverse Jacobian void _fetchvertices(objectintegralelementref *elref, objectmesh *mesh, int nv, elementid *vid, double **x) { // Fetch reference vertices - for (int j=0; jiref->mref->vert, vid[j], &x[j]); + for (int j=0; jiref->mref->vert, vid[j], &x[j]); } void _edgevectors(grade g, int dim, double **x, double *out) { @@ -4383,8 +4383,8 @@ void integral_evaluatejacobian(vm *v, value *jac, value *invjac) { int dim = elref->mesh->dim; // Dimension of the mesh // Allocate matrices - objectmatrix *J=object_newmatrix(dim, dim, true); - objectmatrix *Jinv=object_newmatrix(dim, dim, true); + objectmatrix *J=matrix_new(dim, dim, true); + objectmatrix *Jinv=matrix_new(dim, dim, true); if (J) vm_settlvar(v, jacobianhandle, MORPHO_OBJECT(J)); if (Jinv) vm_settlvar(v, invjacobianhandle, MORPHO_OBJECT(Jinv)); @@ -4402,22 +4402,21 @@ void integral_evaluatejacobian(vm *v, value *jac, value *invjac) { if (mref) _fetchvertices(elref, mref, nv, elref->vid, x); // Construct matrix of edge vectors for target and reference elements - double starget[dim*dim], sref[dim*dim], sinv[dim*dim]; + double starget[dim*dim], sinv[dim*dim]; objectmatrix St = MORPHO_STATICMATRIX(starget, dim, dim), - Sr = MORPHO_STATICMATRIX(sref, dim, dim), Sinv = MORPHO_STATICMATRIX(sinv, dim, dim); _edgevectors(g, dim, X, starget); if (mref) { - _edgevectors(g, dim, x, sref); - matrix_inverse(&Sr, &Sinv); + _edgevectors(g, dim, x, sinv); + matrix_inverse(&Sinv); } else { matrix_identity(&Sinv); // If no reference, the reference is the unit triangle } matrix_mul(&St, &Sinv, J); // J = S . s^-1 - - matrix_inverse(J, Jinv); // Compute J^-1 + matrix_copy(J, Jinv); + matrix_inverse(Jinv); // Compute J^-1 if (jac) *jac = MORPHO_OBJECT(J); if (invjac) *invjac = MORPHO_OBJECT(Jinv); diff --git a/src/linalg/matrix.h b/src/linalg/matrix.h index a34e90b9d..072a4a247 100644 --- a/src/linalg/matrix.h +++ b/src/linalg/matrix.h @@ -293,6 +293,7 @@ linalgError_t matrix_setelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx linalgError_t matrix_getelement(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double *value); linalgError_t matrix_getelementptr(objectmatrix *matrix, MatrixIdx_t row, MatrixIdx_t col, double **value); linalgError_t matrix_getcolumnptr(objectmatrix *matrix, MatrixIdx_t col, double **value); +linalgError_t matrix_getcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b); linalgError_t matrix_setcolumn(objectmatrix *a, MatrixIdx_t col, objectmatrix *b); linalgError_t matrix_setcolumnptr(objectmatrix *a, MatrixIdx_t col, double *b); linalgError_t matrix_addtocolumnptr(objectmatrix *a, MatrixIdx_t col, double alpha, double *b); From bf8833a0227c8ed49050acb67650cdfd48472771 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 21 May 2026 09:41:41 +0200 Subject: [PATCH 447/473] Fix string checks --- src/builtin/builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 7e6337135..4db12ffe9 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -287,7 +287,7 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built new->flags=flags; new->name=object_stringfromcstring(name, strlen(name)); - if (!new->name) goto morpho_addfunction_cleanup; + if (!MORPHO_ISSTRING(new->name)) goto morpho_addfunction_cleanup; // Parse function signature if provided if (signature) builtin_addparsesignature(signature, &new->sig); @@ -367,7 +367,7 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * newmethod->function=desc[i].function; newmethod->klass=new; newmethod->name=object_stringfromcstring(desc[i].name, strlen(desc[i].name)); - if (!newmethod->name) { success=false; break; } + if (!MORPHO_ISSTRING(newmethod->name)) { success=false; break; } newmethod->flags=desc[i].flags; if (desc[i].signature) builtin_addparsesignature(desc[i].signature, &newmethod->sig); From a8d04b06ec7fb36f37b6ce057f734af2c6e4e37c Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 21 May 2026 18:25:20 +0200 Subject: [PATCH 448/473] Fix integration with new linear algebra library --- src/geometry/fespace.c | 8 ++++---- src/geometry/field.c | 2 +- src/geometry/functional.c | 20 +++++++++++--------- src/geometry/mesh.c | 9 ++++----- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/geometry/fespace.c b/src/geometry/fespace.c index 1e048e403..3515bc334 100644 --- a/src/geometry/fespace.c +++ b/src/geometry/fespace.c @@ -1171,7 +1171,7 @@ value FiniteElementSpace_nodecoords(vm *v, int nargs, value *args) { int nrows = disc->grade+1; if (nargs==0) { - objectmatrix *new = object_newmatrix(nrows, disc->nnodes, true); + objectmatrix *new = matrix_new(nrows, disc->nnodes, true); if (!new) return MORPHO_NIL; for (int i=0; innodes; i++) { @@ -1180,7 +1180,7 @@ value FiniteElementSpace_nodecoords(vm *v, int nargs, value *args) { object_free((object *) new); return MORPHO_NIL; } - matrix_setcolumn(new, i, lambda); + matrix_setcolumnptr(new, i, lambda); } out=morpho_wrapandbind(v, (object *) new); @@ -1189,8 +1189,8 @@ value FiniteElementSpace_nodecoords(vm *v, int nargs, value *args) { double lambda[nrows]; if (fespace_getnodecoords(disc, i, lambda)) { - objectmatrix *new = object_newmatrix(nrows, 1, true); - if (new) matrix_setcolumn(new, 0, lambda); + objectmatrix *new = matrix_new(nrows, 1, true); + if (new) matrix_setcolumnptr(new, 0, lambda); out=morpho_wrapandbind(v, (object *) new); } } diff --git a/src/geometry/field.c b/src/geometry/field.c index f99d3ac91..f4a144162 100644 --- a/src/geometry/field.c +++ b/src/geometry/field.c @@ -471,7 +471,7 @@ bool field_evalelement(objectfield *field, elementid el, double *lambda, value * return true; } else if (MORPHO_ISMATRIX(field->prototype)) { objectmatrix *proto = MORPHO_GETMATRIX(field->prototype); - objectmatrix *accum = object_newmatrix(proto->nrows, proto->ncols, true); + objectmatrix *accum = matrix_new(proto->nrows, proto->ncols, true); if (!accum) return false; for (int i=0; innodes; i++) { diff --git a/src/geometry/functional.c b/src/geometry/functional.c index acd96b3ba..8ab477846 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -1630,8 +1630,8 @@ static bool functional_mapjumpnumericalfieldgradient(vm *v, functional_mapinfo * functional_parallelmap(ntask, task); - for (int i=1; idata, &new[i]->data, &new[0]->data); - + for (int i=1; idata, &new[0]->data);; + success=true; *out=MORPHO_OBJECT(new[0]); @@ -4303,8 +4303,10 @@ static objectjumpinterfaceref *jump_getinterfaceref(vm *v) { value iref=MORPHO_NIL; vm_gettlvar(v, jumpinterfacehandle, &iref); if (MORPHO_ISJUMPINTERFACEREF(iref)) return MORPHO_GETJUMPINTERFACEREF(iref); - + return NULL; +} + /* --------- * Elementid * --------- */ @@ -4459,7 +4461,7 @@ bool integral_gradalloc(int dim, value prototype, value *out) { /** Allocate suitable storage for the hessian */ bool integral_hessalloc(int dim, value prototype, value *out) { if (MORPHO_ISNIL(prototype)) { // Scalar - objectmatrix *mhess=object_newmatrix(dim, dim, false); + objectmatrix *mhess=matrix_new(dim, dim, false); if (mhess) *out = MORPHO_OBJECT(mhess); return mhess; } else if (MORPHO_ISMATRIX(prototype)) { @@ -4503,7 +4505,7 @@ bool integral_hesssuminit(int c, value prototype, value dest, value *sum) { if (c>=list_length(lst)) { objectmatrix *prmat = MORPHO_GETMATRIX(prototype); - objectmatrix *new = object_newmatrix(prmat->nrows, prmat->ncols, true); + objectmatrix *new = matrix_new(prmat->nrows, prmat->ncols, true); if (!new) return false; *sum = MORPHO_OBJECT(new); list_append(lst, *sum); @@ -4689,7 +4691,7 @@ bool integral_evaluatehessian(vm *v, value q, value *out) { if (MORPHO_ISFESPACE(fld->fnspc)) { if (!elref->invj) { - elref->invj=object_newmatrix(elref->g, elref->mesh->dim, false); + elref->invj=matrix_new(elref->g, elref->mesh->dim, false); if (elref->invj) { integral_prepareinvjacobian(elref->mesh->dim, elref->g, elref->vertexposn, elref->invj); } else { @@ -5745,7 +5747,7 @@ static bool jump_parentlambda(unsigned int dim, grade g, double **x, double *pos functional_vecsub(dim, posn, x[0], sdata); if (!integral_prepareinvjacobian(dim, g, x, &invj)) return false; - if (matrix_mul(&invj, &s, &l)!=MATRIX_OK) return false; + if (matrix_mul(&invj, &s, &l)!=LINALGERR_OK) return false; lambda[0]=1.0; for (int i=1; ielements[i]=0.0; diff --git a/src/geometry/mesh.c b/src/geometry/mesh.c index 133d4a202..bf2a79073 100644 --- a/src/geometry/mesh.c +++ b/src/geometry/mesh.c @@ -181,7 +181,6 @@ bool mesh_getbarycentriccoordinates(objectmesh *mesh, grade g, elementid id, dou double dx[mesh->dim], edges[g][mesh->dim]; objectmatrix gram = MORPHO_STATICMATRIX(gramdata, g, g); objectmatrix rhs = MORPHO_STATICMATRIX(rhsdata, g, 1); - objectmatrix alpha = MORPHO_STATICMATRIX(alphadata, g, 1); matrix_zero(&gram); matrix_zero(&rhs); @@ -196,12 +195,12 @@ bool mesh_getbarycentriccoordinates(objectmesh *mesh, grade g, elementid id, dou gram.elements[i+j*g]=functional_vecdot(mesh->dim, edges[i], edges[j]); } } - bool success=(matrix_divs(&gram, &rhs, &alpha)==MATRIX_OK); + bool success=(matrix_solvesmall(&gram, &rhs)==LINALGERR_OK); if (success) { double sum=0.0; for (int i=0; i Date: Thu, 21 May 2026 18:43:11 +0200 Subject: [PATCH 449/473] Add missing file --- test/functionals/smectic/qtensortools.xmorpho | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 test/functionals/smectic/qtensortools.xmorpho diff --git a/test/functionals/smectic/qtensortools.xmorpho b/test/functionals/smectic/qtensortools.xmorpho new file mode 100644 index 000000000..bb1f4877d --- /dev/null +++ b/test/functionals/smectic/qtensortools.xmorpho @@ -0,0 +1,122 @@ +// Tools to work with the Q-tensor in 3D. The Q-tensor is a symmetric traceless 3x3 matrix that describes the local orientational order of liquid crystals. + +import graphics + +// The q tensor [ Qxx Qxy Qxz ] +// [ Qxy Qyy Qyz ] +// [ Qxz Qyz Qzz ] +// is symmetric and traceless. Hence there are 5 independent components: [ Qxx, Qxy, Qxz, Qyy, Qyz ] +// We will represent these as a vector. + +// Reconstruct Q-tensor from the q-vector +fn reconstructQ(qv) { + return Matrix( [ [ qv[0], qv[1], qv[2] ], [ qv[1], qv[3], qv[4] ], [ qv[2], qv[4], -qv[0]-qv[3] ] ]) +} + +// Reconstruct q-vector from Q-tensor +fn reconstructqv(Q) { + return Matrix([ Q[0,0], Q[0,1], Q[0,2], Q[1,1], Q[1,2] ]) +} + +// Function to get the scalar order parameter S from the Q-tensor +fn qtoorder(qv) { + var Q = reconstructQ(qv) + var ev = Q.eigenvalues() + return max(ev) +} + +// Reconstruct director from Q-tensor +fn qtodirector(qv) { + var Q = reconstructQ(qv) + var es = Q.eigensystem() + var order = es[0].order() // Find largest eigenvalue + var n = es[1].column(order[-1]) // Return associated eigenvector + n/=n.norm() + return n +} + +// Construct a Q tensor from S and n +fn constructQ(S, n) { + return S*(n.outer(n) - IdentityMatrix(3)/3) +} + +// Converts a q-vector to a Q-tensor +fn qtensor(q) { + return Matrix([ [q[0], q[1], q[2]], + [q[1], q[3], q[4]], + [q[2], q[4], -q[0]-q[3]] ]) +} + +// Convert our Q vector Field to a Q tensor field +fn qfield(Q) { + var m = Q.mesh() + var qq = Field(m, qtensor(Q[0,0])) + for (id in 0...m.count(0)) qq[0,id] = qtensor(Q[0,id]) + return qq +} + +// Radial initial condition +fn radialQ(x,y,z) { + var S0 = 0.6 + var n = Matrix([x,y,z]) + if (n.norm()>1e-6) n/=n.norm() + + return S0*Matrix([ n[0]^2 - 1/3, + n[0]*n[1], + n[0]*n[2], + n[1]^2 - 1/3, + n[1]*n[2] ]) +} + +// Uniform initial condition +fn uniformQ(x,y,z) { + var S0 = 0.6 + var n = Matrix([1,0,0]) + return S0*Matrix([ n[0]^2 - 1/3, + n[0]*n[1], + n[0]*n[2], + n[1]^2 - 1/3, + n[1]*n[2] ]) +} + + +fn radialQ(x,y) { return radialQ(x,y,0) } + +// Calculates Fields from Q tensor for visualization purposes +fn qvis(Q) { + var m = Q.mesh() + var e0=Field(m), e1=Field(m), e2=Field(m) + var nn=Field(m, Matrix([1,0,0])) + + for (id in 0...m.count(0)) { + var q = qtensor(Q[0,id]) + var es=q.eigensystem() + var order=es[0].order() + e0[0,id]=es[0][order[-1]] + e1[0,id]=es[0][order[-2]] + e2[0,id]=es[0][order[-3]] + nn[0,id]=es[1].column(order[-1]) + } + + return [e0, e1, e2, nn] +} + +fn _promote(x, n) { + var y = Matrix(n) + for (i in 0...x.count()) y[i] = x[i] + return y +} + +// Visualizes a director field as cylinders. +fn visdirector(n, lambda) { + var m = n.mesh() + var g = Graphics() + for (vid in 0...m.count()) { + var nn=n[0,vid] + if (nn.norm()>1e-6) nn/=nn.norm() + var x = m.vertexposition(vid) + if (x.count() Date: Thu, 21 May 2026 18:48:18 +0200 Subject: [PATCH 450/473] Fix new linear algebra output for dimensions() now produces a Tuple --- test/field/discretizations/cg3/cg3_nodecoords.morpho | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/field/discretizations/cg3/cg3_nodecoords.morpho b/test/field/discretizations/cg3/cg3_nodecoords.morpho index 5e554211c..7151535f6 100644 --- a/test/field/discretizations/cg3/cg3_nodecoords.morpho +++ b/test/field/discretizations/cg3/cg3_nodecoords.morpho @@ -5,7 +5,7 @@ var l = FiniteElementSpace("CG3", grade=2) var nodes = l.nodeCoords() print nodes.dimensions() -// expect: [ 3, 10 ] +// expect: (3, 10) print (nodes.column(0) - Matrix([1,0,0])).norm() < 1e-12 // expect: true From 07f9c84cea5ae2dfac3794618412377f9a29759d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 22 May 2026 10:01:38 +0200 Subject: [PATCH 451/473] Updates to help --- help/classes.md | 19 ++++++++++++++++ help/errors.md | 20 ++++++++++++++++ help/fespace.md | 54 +++++++++++++++++++++++++++++++++++++++++++ help/field.md | 50 ++++++++++++++++++++++++++++++++++++++++ help/file.md | 25 +++++++++++++++++++- help/index.rst | 1 + help/mesh.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++ help/selection.md | 2 +- help/system.md | 25 ++++++++++++++++++-- 9 files changed, 250 insertions(+), 4 deletions(-) create mode 100644 help/fespace.md diff --git a/help/classes.md b/help/classes.md index 2f1417335..c809ee896 100644 --- a/help/classes.md +++ b/help/classes.md @@ -174,3 +174,22 @@ is equivalent to: The `clss` method is used to get the class to which an object belongs. print a.clss() + +## Superclass +[tagsuperclass]: # (superclass) + +The `superclass` method returns the superclass of an object or class: + + print a.superclass() + +## Serialize +[tagserialize]: # (serialize) + +The `serialize` method is provided as part of the base `Object` interface for objects that support serialization. + +## Linearization +[taglinearization]: # (linearization) + +The `linearization` method returns a list describing the class linearization used for method lookup: + + print a.linearization() diff --git a/help/errors.md b/help/errors.md index 6a17a1277..10caaf91e 100644 --- a/help/errors.md +++ b/help/errors.md @@ -25,6 +25,26 @@ You can also use the `warning` method to alert the user of a potential issue tha myerr.warning() +[showsubtopics]: # (subtopics) + +## Throw +[tagthrow]: # (throw) + +Raises an `Error`, interrupting execution unless it is caught: + + myerr.throw() + +You can optionally supply a custom message: + + myerr.throw("A custom message") + +## Warning +[tagwarning]: # (warning) + +Displays an `Error` as a warning without interrupting execution: + + myerr.warning() + To see the full list of morpho errors, look at the `errorlist` help entry. # Error list diff --git a/help/fespace.md b/help/fespace.md new file mode 100644 index 000000000..010d720a6 --- /dev/null +++ b/help/fespace.md @@ -0,0 +1,54 @@ +[comment]: # (Finite element space help) +[version]: # (0.5) + +# FiniteElementSpace +[tagfiniteelementspace]: # (FiniteElementSpace) +[tagfespace]: # (fespace) + +The `FiniteElementSpace` class describes how a `Field` is discretized on a particular grade of a mesh. + +You will usually obtain a finite element space from an existing field: + + var fs = field.finiteElementSpace() + +[showsubtopics]: # (showsubtopics) + +## Count +[tagcount]: # (count) + +Returns the number of nodes in the finite element space: + + print fs.count() + +## Grade +[taggrade]: # (grade) + +Returns the mesh grade on which the finite element space is defined: + + print fs.grade() + +## Layout +[taglayout]: # (layout) + +Returns a sparse matrix describing how the degrees of freedom of a given field are laid out for this finite element space: + + var layout = fs.layout(field) + print layout + +## NodeElementIndex +[tagnodeelementindex]: # (nodeelementindex) + +Returns a tuple describing where a given node stores its degree of freedom in a field. The tuple has the form `(grade, element id, index)`: + + print fs.nodeElementIndex(0) + +## NodeCoords +[tagnodecoords]: # (nodecoords) + +Returns barycentric coordinates for the nodes of the finite element space. With no argument, this returns a matrix containing the coordinates of every node: + + print fs.nodeCoords() + +With an integer argument, it returns the barycentric coordinates for a single node: + + print fs.nodeCoords(0) diff --git a/help/field.md b/help/field.md index 0e9d4d65c..4ea21c122 100644 --- a/help/field.md +++ b/help/field.md @@ -62,6 +62,56 @@ The `shape` method returns a list indicating the number of items stored on each would indicate one item stored on each vertex and two items stored on each facet. +## FiniteElementSpace +[tagfiniteelementspace]: # (finiteelementspace) + +Returns the `FiniteElementSpace` used to discretize the field: + + var fs = f.finiteElementSpace() + print fs.grade() + +See also `FiniteElementSpace`. + +## Prototype +[tagprototype]: # (prototype) + +Returns the prototype value used by the field: + + print f.prototype() + +## EvalElement +[tagevalelement]: # (evalelement) + +Evaluates a field inside a specific element using barycentric coordinates: + + print f.evalElement(element, [0.2, 0.3, 0.5]) + +You can supply the barycentric coordinates either as a `List` or as a column `Matrix`. + +## ElementDofs +[tagelementdofs]: # (elementdofs) + +Returns a list describing which field entries contribute to a given element. Each entry is a tuple of the form `(grade, element id, index)`: + + print f.elementDofs(element) + +## Linearize +[taglinearize]: # (linearize) + +Returns a matrix containing the data stored by the field: + + var mat = f.linearize() + print mat + +## __linearize +[tag__linearize]: # (__linearize) + +Returns the underlying storage matrix directly. + +This method is intended for low-level use: + + var mat = f.__linearize() + ## Op [tagop]: # (op) diff --git a/help/file.md b/help/file.md index 7e4c538bb..7dac085fe 100644 --- a/help/file.md +++ b/help/file.md @@ -61,6 +61,15 @@ Read in the contents of a file and print each line: Reads a single character from a file; returns the result as a string. +## readall +[tagreadall]: # (readall) + +Reads the remaining contents of a file and returns them as a single string: + + var f = File("input.txt") + print f.readall() + f.close() + ## write [tagwrite]: # (write) @@ -68,7 +77,7 @@ Writes to a file. Write the contents of a list to a file: - var f = File("output.txt", "w") + var f = File("output.txt", "write") for (k, i in list) f.write("${i}: ${k}") f.close() @@ -82,6 +91,20 @@ Closes an open file. Returns true if at the end of the file; false otherwise +## relativepath +[tagrelativepath]: # (relativepath) + +Returns the file path relative to the current working directory: + + print f.relativepath() + +## filename +[tagfilename]: # (filename) + +Returns the filename that was used to open the file: + + print f.filename() + # Folder [tagfolder]: # (Folder) diff --git a/help/index.rst b/help/index.rst index 918fa3849..c1d26a43a 100644 --- a/help/index.rst +++ b/help/index.rst @@ -34,6 +34,7 @@ Morpho :maxdepth: 1 field + fespace functionals mesh selection diff --git a/help/mesh.md b/help/mesh.md index 49a2c7cb0..7514a16ab 100644 --- a/help/mesh.md +++ b/help/mesh.md @@ -25,6 +25,21 @@ Saves a mesh as a .mesh file. m.save("new.mesh") +## Vertexmatrix +[tagvertexmatrix]: # (vertexmatrix) + +Returns the matrix of vertex positions used by the mesh. Each column corresponds to a vertex: + + var verts = m.vertexmatrix() + print verts + +## Setvertexmatrix +[tagsetvertexmatrix]: # (setvertexmatrix) + +Replaces the matrix of vertex positions used by the mesh. The new matrix must have the same dimensions as the existing vertex matrix: + + m.setvertexmatrix(newverts) + ## Vertexposition [tagvertexposition]: # (vertexposition) @@ -39,6 +54,21 @@ Sets the position of a vertex given an id and a position vector: print m.setvertexposition(1, Matrix([0,0,0])) +## Resetconnectivity +[tagresetconnectivity]: # (resetconnectivity) + +Clears any cached connectivity matrices associated with the mesh: + + m.resetconnectivity() + +## Connectivitymatrix +[tagconnectivitymatrix]: # (connectivitymatrix) + +Returns the connectivity matrix that maps elements of one grade to another. For example, to retrieve the vertex-to-edge connectivity: + + var c = m.connectivitymatrix(0, 1) + print c + ## Addgrade [tagaddgrade]: # (addgrade) @@ -46,11 +76,32 @@ Adds a new grade to a mesh. This is commonly used when, for example, a mesh file m.addgrade(1) +You can also provide an explicit sparse connectivity matrix for the new grade: + + m.addgrade(1, connectivity) + +## Removegrade +[tagremovegrade]: # (removegrade) + +Removes a grade and its associated connectivity from a mesh: + + m.removegrade(1) + ## Addsymmetry [tagaddsymmetry]: # (addsymmetry) Adds a symmetry to a mesh. Experimental in version 0.5. +## Barycentric +[tagbarycentric]: # (barycentric) + +Computes barycentric coordinates for a point inside a mesh element. You must supply the grade, the element id and the position matrix: + + var lambda = m.barycentric(2, element, Matrix([x, y, z])) + print lambda + +For a grade `g` element, the returned matrix contains `g+1` barycentric coordinates. + ## Maxgrade [tagmaxgrade]: # (maxgrade) @@ -64,3 +115,10 @@ Returns the highest grade element present: Counts the number of elements. If no argument is provided, returns the number of vertices. Otherwise, returns the number of elements present of a given grade: print m.count(2) // Returns the number of area-like elements. + +## Clone +[tagclone]: # (clone) + +Creates a copy of a mesh: + + var copy = m.clone() diff --git a/help/selection.md b/help/selection.md index 6e76f7835..7b2c3c32c 100644 --- a/help/selection.md +++ b/help/selection.md @@ -64,4 +64,4 @@ Checks if an element id is selected, returning `true` or `false` accordingly. To check if edge number 5 is selected: - var f = s.isselected(1, 5)) + var f = s.isselected(1, 5) diff --git a/help/system.md b/help/system.md index bb9e8ba4b..c7882b788 100644 --- a/help/system.md +++ b/help/system.md @@ -59,9 +59,9 @@ Returns a `List` of arguments passed to the current morpho on the command line. Run a morpho program with arguments: - morpho5 program.morpho hello world + morpho6 program.morpho hello world -Note that, in line with UNIX conventions, command line arguments before the program file name are passed to the `morpho5` runtime; those after are passed to the morpho program via `System.arguments`. +Note that, in line with UNIX conventions, command line arguments before the program file name are passed to the `morpho6` runtime; those after are passed to the morpho program via `System.arguments`. ## Exit [tagexit]: # (exit) @@ -69,3 +69,24 @@ Note that, in line with UNIX conventions, command line arguments before the prog Stop execution of a program: System.exit() + +## Setworkingfolder +[tagsetworkingfolder]: # (setworkingfolder) + +Sets the current working folder used by the runtime: + + System.setworkingfolder("/tmp") + +## Workingfolder +[tagworkingfolder]: # (workingfolder) + +Returns the current working folder: + + print System.workingfolder() + +## Homefolder +[taghomefolder]: # (homefolder) + +Returns the current user's home folder: + + print System.homefolder() From b8b44351b271408b6ba14aebc220101879cba3bf Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 22 May 2026 10:06:55 +0200 Subject: [PATCH 452/473] Add in more missing help. --- help/file.md | 5 +++-- help/functionals.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ help/matrix.md | 35 +++++++++++++++++++++++++++++++++++ help/sparse.md | 23 +++++++++++++++++++++++ 4 files changed, 105 insertions(+), 2 deletions(-) diff --git a/help/file.md b/help/file.md index 7dac085fe..c10f6112b 100644 --- a/help/file.md +++ b/help/file.md @@ -112,11 +112,12 @@ The `Folder` class allows you to work with folders. You can find whether a filep [show]: # (subtopics) -## isfolder +## isFolder [tagisfolder]: # (isfolder) +[tagisFolder]: # (isfolder) Find out whether a path specification refers to a folder: - print Folder.isfolder("path/folder") + print Folder.isFolder("path/folder") ## contents [tagcontents]: # (contents) diff --git a/help/functionals.md b/help/functionals.md index 69565106c..a9045570f 100644 --- a/help/functionals.md +++ b/help/functionals.md @@ -21,6 +21,50 @@ Each of these may be called with a mesh, a field and a selection. [showsubtopics]: # (subtopics) +## Total +[tagtotal]: # (total) + +The `total` method returns the value of a functional: + + print fnl.total(mesh) + +You can also supply optional fields and a selection as appropriate for the functional. + +## Integrand +[tagintegrand]: # (integrand) + +The `integrand` method returns the contribution from each element: + + print fnl.integrand(mesh) + +## IntegrandForElement +[tagintegrandforelement]: # (integrandforelement) + +Some functionals also provide an `integrandForElement` method that evaluates the integrand for a single element: + + print fnl.integrandForElement(mesh, element) + +## Gradient +[taggradient]: # (gradient) + +The `gradient` method returns the derivative of a functional with respect to vertex motion: + + print fnl.gradient(mesh) + +## Fieldgradient +[tagfieldgradient]: # (fieldgradient) + +Functionals that depend on a field may provide a `fieldgradient` method that returns the derivative with respect to field values: + + print fnl.fieldgradient(mesh, field) + +## Hessian +[taghessian]: # (hessian) + +Some functionals provide a `hessian` method: + + print fnl.hessian(mesh) + ## Length [taglength]: # (length) diff --git a/help/matrix.md b/help/matrix.md index 46ef533e0..81e665eb0 100644 --- a/help/matrix.md +++ b/help/matrix.md @@ -74,6 +74,20 @@ Returns the dimensions of a matrix: var A = Matrix([1,2,3]) // Create a column matrix print A.dimensions() // Expect: (3, 1) +## Column +[tagcolumn]: # (column) + +Returns a specified column of a matrix as a column matrix: + + var v = A.column(0) + +## Setcolumn +[tagsetcolumn]: # (setcolumn) + +Replaces a specified column of a matrix: + + A.setcolumn(0, Matrix([1,2,3])) + ## Eigenvalues [tageigenvalues]: # (Eigenvalues) @@ -245,3 +259,24 @@ In addition, `ComplexMatrix` provides methods for accessing and manipulating the `conjugate()` returns the elementwise complex conjugate of the matrix, while `conjTranspose()` returns the conjugate transpose (also called the Hermitian transpose). Mixed arithmetic between `Matrix` and `ComplexMatrix` is supported, with the result promoted to complex where needed. + +## Real +[tagreal]: # (real) + +Returns a `Matrix` containing the real part of a `ComplexMatrix`: + + print c.real() + +## Imag +[tagimag]: # (imag) + +Returns a `Matrix` containing the imaginary part of a `ComplexMatrix`: + + print c.imag() + +## ConjTranspose +[tagconjtranspose]: # (conjtranspose) + +Returns the conjugate transpose of a `ComplexMatrix`: + + print c.conjTranspose() diff --git a/help/sparse.md b/help/sparse.md index b320f81f6..a1fcb316a 100644 --- a/help/sparse.md +++ b/help/sparse.md @@ -25,3 +25,26 @@ Once a sparse matrix is created, you can use all the regular arithmetic operator a+b a*b + +[showsubtopics]: # (showsubtopics) + +## Rowindices +[tagrowindices]: # (rowindices) + +Returns the row indices of the nonzero entries in a specified column: + + print a.rowindices(0) + +## Setrowindices +[tagsetrowindices]: # (setrowindices) + +Replaces the row indices of the nonzero entries in a specified column: + + a.setrowindices(0, [0,2,4]) + +## Colindices +[tagcolindices]: # (colindices) + +Returns the column indices that contain nonzero entries: + + print a.colindices() From beeea92cd8b56e63d7643f7a2ade60a1436f0474 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 22 May 2026 10:12:31 +0200 Subject: [PATCH 453/473] More detailed help. --- help/fespace.md | 6 ++++++ help/field.md | 8 ++++++++ help/functionals.md | 8 ++++++++ help/mesh.md | 4 ++++ help/sparse.md | 10 ++++++++++ 5 files changed, 36 insertions(+) diff --git a/help/fespace.md b/help/fespace.md index 010d720a6..83a2e5a97 100644 --- a/help/fespace.md +++ b/help/fespace.md @@ -35,6 +35,8 @@ Returns a sparse matrix describing how the degrees of freedom of a given field a var layout = fs.layout(field) print layout +This is useful when you need to understand how local node values are mapped into the underlying storage of a `Field`. + ## NodeElementIndex [tagnodeelementindex]: # (nodeelementindex) @@ -42,6 +44,8 @@ Returns a tuple describing where a given node stores its degree of freedom in a print fs.nodeElementIndex(0) +This can be used together with `Field` indexing to locate the value associated with a given node. + ## NodeCoords [tagnodecoords]: # (nodecoords) @@ -52,3 +56,5 @@ Returns barycentric coordinates for the nodes of the finite element space. With With an integer argument, it returns the barycentric coordinates for a single node: print fs.nodeCoords(0) + +For a grade `g` space, each node coordinate is represented by `g+1` barycentric coordinates. diff --git a/help/field.md b/help/field.md index 4ea21c122..9ad6340a2 100644 --- a/help/field.md +++ b/help/field.md @@ -88,6 +88,8 @@ Evaluates a field inside a specific element using barycentric coordinates: You can supply the barycentric coordinates either as a `List` or as a column `Matrix`. +The number of barycentric coordinates should match the number of vertices of the reference element, i.e. `grade+1`. + ## ElementDofs [tagelementdofs]: # (elementdofs) @@ -95,6 +97,12 @@ Returns a list describing which field entries contribute to a given element. Eac print f.elementDofs(element) +A typical return value might look like + + [ (0, 3, 0), (0, 7, 0), (0, 8, 0) ] + +for a linear field on a triangular element. + ## Linearize [taglinearize]: # (linearize) diff --git a/help/functionals.md b/help/functionals.md index a9045570f..d4dedc606 100644 --- a/help/functionals.md +++ b/help/functionals.md @@ -65,6 +65,14 @@ Some functionals provide a `hessian` method: print fnl.hessian(mesh) +For example, a typical workflow for a field-dependent functional is + + var value = fnl.total(mesh) + var gradx = fnl.gradient(mesh) + var gradf = fnl.fieldgradient(mesh, field) + +where `value` is the functional value, `gradx` is the derivative with respect to vertex positions and `gradf` is the derivative with respect to field values. + ## Length [taglength]: # (length) diff --git a/help/mesh.md b/help/mesh.md index 7514a16ab..a8587b15d 100644 --- a/help/mesh.md +++ b/help/mesh.md @@ -69,6 +69,8 @@ Returns the connectivity matrix that maps elements of one grade to another. For var c = m.connectivitymatrix(0, 1) print c +Here `0` refers to vertices and `1` to edges. Similarly, `m.connectivitymatrix(0, 2)` retrieves the vertex-to-facet connectivity. + ## Addgrade [tagaddgrade]: # (addgrade) @@ -102,6 +104,8 @@ Computes barycentric coordinates for a point inside a mesh element. You must sup For a grade `g` element, the returned matrix contains `g+1` barycentric coordinates. +For example, for a triangular facet (`grade 2`), the returned matrix contains three barycentric coordinates whose sum is `1`. + ## Maxgrade [tagmaxgrade]: # (maxgrade) diff --git a/help/sparse.md b/help/sparse.md index a1fcb316a..71acf1f5f 100644 --- a/help/sparse.md +++ b/help/sparse.md @@ -35,6 +35,12 @@ Returns the row indices of the nonzero entries in a specified column: print a.rowindices(0) +For the matrix + + var a = Sparse([[0,0,2], [1,1,-2], [2,0,5]]) + +`a.rowindices(0)` would return `[0,2]`. + ## Setrowindices [tagsetrowindices]: # (setrowindices) @@ -42,9 +48,13 @@ Replaces the row indices of the nonzero entries in a specified column: a.setrowindices(0, [0,2,4]) +This acts on the sparse column representation, so the argument refers to a column index. + ## Colindices [tagcolindices]: # (colindices) Returns the column indices that contain nonzero entries: print a.colindices() + +For the example above, `a.colindices()` would return `[0,1]`. From d9f666c4016ba887a52e57c50d41c9cb3cf1b8bb Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 22 May 2026 10:19:53 +0200 Subject: [PATCH 454/473] More help cleanup --- help/fespace.md | 26 +++++++++++++++++++++++--- help/field.md | 14 ++++++++++++-- help/functionals.md | 11 +++++++++-- help/mesh.md | 13 ++++++++++++- help/sparse.md | 10 ++++++++++ 5 files changed, 66 insertions(+), 8 deletions(-) diff --git a/help/fespace.md b/help/fespace.md index 83a2e5a97..917409f35 100644 --- a/help/fespace.md +++ b/help/fespace.md @@ -7,9 +7,13 @@ The `FiniteElementSpace` class describes how a `Field` is discretized on a particular grade of a mesh. -You will usually obtain a finite element space from an existing field: +You can create a finite element space directly from its label and grade: - var fs = field.finiteElementSpace() + var fs = FiniteElementSpace("CG2", grade=2) + +You can also obtain a finite element space from an existing field: + + var fs = f.finiteElementSpace() [showsubtopics]: # (showsubtopics) @@ -32,11 +36,17 @@ Returns the mesh grade on which the finite element space is defined: Returns a sparse matrix describing how the degrees of freedom of a given field are laid out for this finite element space: - var layout = fs.layout(field) + var layout = fs.layout(f) print layout This is useful when you need to understand how local node values are mapped into the underlying storage of a `Field`. +For example: + + var fs = f.finiteElementSpace() + var layout = fs.layout(f) + print layout + ## NodeElementIndex [tagnodeelementindex]: # (nodeelementindex) @@ -46,6 +56,11 @@ Returns a tuple describing where a given node stores its degree of freedom in a This can be used together with `Field` indexing to locate the value associated with a given node. +For example: + + var loc = fs.nodeElementIndex(0) + print loc + ## NodeCoords [tagnodecoords]: # (nodecoords) @@ -58,3 +73,8 @@ With an integer argument, it returns the barycentric coordinates for a single no print fs.nodeCoords(0) For a grade `g` space, each node coordinate is represented by `g+1` barycentric coordinates. + +For example, to inspect all node coordinates: + + var coords = fs.nodeCoords() + print coords diff --git a/help/field.md b/help/field.md index 9ad6340a2..8d40f6e17 100644 --- a/help/field.md +++ b/help/field.md @@ -84,18 +84,23 @@ Returns the prototype value used by the field: Evaluates a field inside a specific element using barycentric coordinates: - print f.evalElement(element, [0.2, 0.3, 0.5]) + print f.evalElement(el, [0.2, 0.3, 0.5]) You can supply the barycentric coordinates either as a `List` or as a column `Matrix`. The number of barycentric coordinates should match the number of vertices of the reference element, i.e. `grade+1`. +For example: + + var val = f.evalElement(el, [0.2, 0.3, 0.5]) + print val + ## ElementDofs [tagelementdofs]: # (elementdofs) Returns a list describing which field entries contribute to a given element. Each entry is a tuple of the form `(grade, element id, index)`: - print f.elementDofs(element) + print f.elementDofs(el) A typical return value might look like @@ -103,6 +108,11 @@ A typical return value might look like for a linear field on a triangular element. +For example: + + var dofs = f.elementDofs(el) + print dofs + ## Linearize [taglinearize]: # (linearize) diff --git a/help/functionals.md b/help/functionals.md index d4dedc606..0658e2734 100644 --- a/help/functionals.md +++ b/help/functionals.md @@ -56,7 +56,7 @@ The `gradient` method returns the derivative of a functional with respect to ver Functionals that depend on a field may provide a `fieldgradient` method that returns the derivative with respect to field values: - print fnl.fieldgradient(mesh, field) + print fnl.fieldgradient(mesh, f) ## Hessian [taghessian]: # (hessian) @@ -69,10 +69,17 @@ For example, a typical workflow for a field-dependent functional is var value = fnl.total(mesh) var gradx = fnl.gradient(mesh) - var gradf = fnl.fieldgradient(mesh, field) + var gradf = fnl.fieldgradient(mesh, f) where `value` is the functional value, `gradx` is the derivative with respect to vertex positions and `gradf` is the derivative with respect to field values. +For example, for a field-dependent functional: + + var fnl = GradSq(phi) + print fnl.total(mesh) + print fnl.gradient(mesh) + print fnl.fieldgradient(mesh, phi) + ## Length [taglength]: # (length) diff --git a/help/mesh.md b/help/mesh.md index a8587b15d..e4be26bb5 100644 --- a/help/mesh.md +++ b/help/mesh.md @@ -71,6 +71,11 @@ Returns the connectivity matrix that maps elements of one grade to another. For Here `0` refers to vertices and `1` to edges. Similarly, `m.connectivitymatrix(0, 2)` retrieves the vertex-to-facet connectivity. +For example, to inspect the connectivity between vertices and facets: + + var cf = m.connectivitymatrix(0, 2) + print cf + ## Addgrade [tagaddgrade]: # (addgrade) @@ -99,13 +104,19 @@ Adds a symmetry to a mesh. Experimental in version 0.5. Computes barycentric coordinates for a point inside a mesh element. You must supply the grade, the element id and the position matrix: - var lambda = m.barycentric(2, element, Matrix([x, y, z])) + var lambda = m.barycentric(2, el, Matrix([x, y, z])) print lambda For a grade `g` element, the returned matrix contains `g+1` barycentric coordinates. For example, for a triangular facet (`grade 2`), the returned matrix contains three barycentric coordinates whose sum is `1`. +For example: + + var x = Matrix([0.25, 0.25, 0.0]) + var lambda = m.barycentric(2, el, x) + print lambda + ## Maxgrade [tagmaxgrade]: # (maxgrade) diff --git a/help/sparse.md b/help/sparse.md index 71acf1f5f..c0df18762 100644 --- a/help/sparse.md +++ b/help/sparse.md @@ -41,6 +41,11 @@ For the matrix `a.rowindices(0)` would return `[0,2]`. +For example: + + var rows = a.rowindices(0) + print rows + ## Setrowindices [tagsetrowindices]: # (setrowindices) @@ -58,3 +63,8 @@ Returns the column indices that contain nonzero entries: print a.colindices() For the example above, `a.colindices()` would return `[0,1]`. + +For example: + + var cols = a.colindices() + print cols From ea17002a8e47849386bd7ca28befeeb7ca2e233e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 22 May 2026 10:24:57 +0200 Subject: [PATCH 455/473] More detail for help --- help/complex.md | 32 +++++++++++++++++++++++++ help/dictionary.md | 60 ++++++++++++++++++++++++++++++++++++++++------ help/file.md | 7 ++++++ help/json.md | 22 +++++++++++++++++ help/selection.md | 26 ++++++++++++++++++++ help/sparse.md | 7 ++++++ 6 files changed, 147 insertions(+), 7 deletions(-) diff --git a/help/complex.md b/help/complex.md index 2e1208abd..a66b33f47 100644 --- a/help/complex.md +++ b/help/complex.md @@ -34,6 +34,20 @@ Returns the angle `phi` associated with the polar representation of a complex nu print z.angle() +## Real +[tagreal]: # (real) + +Returns the real part of a complex number: + + print z.real() + +## Imag +[tagimag]: # (imag) + +Returns the imaginary part of a complex number: + + print z.imag() + ## Conj [tagconjugate]: # (conjugate) [tagconj]: # (conj) @@ -41,3 +55,21 @@ Returns the angle `phi` associated with the polar representation of a complex nu Returns the complex conjugate of a number: print z.conj() + +## Abs +[tagabs]: # (abs) + +Returns the magnitude of a complex number: + + print z.abs() + +## ComplexMatrix +[tagcomplexmatrix]: # (complexmatrix) + +The `ComplexMatrix` class provides complex-valued matrices. See also `Matrix`. + +Useful methods include: + + print c.real() + print c.imag() + print c.conjTranspose() diff --git a/help/dictionary.md b/help/dictionary.md index 989ffc53b..0b0594de2 100644 --- a/help/dictionary.md +++ b/help/dictionary.md @@ -28,24 +28,70 @@ Loop over keys in a dictionary: for (k in dict) print k -The `keys` method returns a Morpho List of the keys. +[showsubtopics]: # (showsubtopics) + +## Keys +[tagkeys]: # (keys) + +The `keys` method returns a Morpho `List` of the keys. var keys = dict.keys() // will return ["Massachusetts", "New York", "Vermont"] -The `contains` method returns a Bool value for whether the Dictionary -contains a given key. +## Contains +[tagcontains]: # (contains) + +The `contains` method returns a `Bool` value for whether the `Dictionary` contains a given key. print dict.contains("Vermont") // true print dict.contains("New Hampshire") // false -The `remove` method removes a given key from the Dictionary. +## Remove +[tagremove]: # (remove) + +The `remove` method removes a given key from the `Dictionary`. dict.remove("Vermont") print dict // { New York : Albany, Massachusetts : Boston } -The `clear` method removes all the (key, value) pairs fromt the -dictionary, resulting in an empty dictionary. +## Clear +[tagclear]: # (clear) - dict.clear() +The `clear` method removes all the `(key, value)` pairs from the dictionary, resulting in an empty dictionary. + dict.clear() print dict // { } + +## Union +[tagunion]: # (union) + +The `union` method combines two dictionaries. If the same key is present in both, the value from the second dictionary is used: + + var a = { "x" : 1, "y" : 2 } + var b = { "y" : 5, "z" : 3 } + print a.union(b) // { x : 1, y : 5, z : 3 } + +The `+` operator provides the same operation for dictionaries: + + print a+b + +## Intersection +[tagintersection]: # (intersection) + +The `intersection` method returns a dictionary containing only the keys present in both dictionaries: + + var a = { "x" : 1, "y" : 2 } + var b = { "y" : 5, "z" : 3 } + print a.intersection(b) + +## Difference +[tagdifference]: # (difference) + +The `difference` method returns a dictionary containing only the keys present in the first dictionary but not the second: + + var a = { "x" : 1, "y" : 2 } + var b = { "y" : 5 } + print a.difference(b) + +The `-` operator provides the same operation for dictionaries: + + print a-b diff --git a/help/file.md b/help/file.md index c10f6112b..cb649fabd 100644 --- a/help/file.md +++ b/help/file.md @@ -144,3 +144,10 @@ The `create` and `createRecursive` methods allow creation of folders. To create Recursively create a nested set of folders: Folder.createRecursive("foo/foo") + +## createRecursive +[tagcreateRecursive]: # (createrecursive) + +Creates a nested set of folders recursively: + + Folder.createRecursive("foo/foo") diff --git a/help/json.md b/help/json.md index 55befc8a0..a5ff36289 100644 --- a/help/json.md +++ b/help/json.md @@ -20,3 +20,25 @@ To convert basic data types to JSON, use the `JSON.tostring` class method: var b = JSON.tostring([1,2,3]) The exporter supports `nil`, boolean values `true` and `false`, numbers, `String`s as well as `List` and `Dictionary` objects that may contain any of the supported types. + +[showsubtopics]: # (showsubtopics) + +## Parse +[tagparse]: # (parse) + +Parses a JSON string and converts it into the corresponding Morpho value: + + var a = JSON.parse("[1,2,3,4]") + print a + +If the JSON contains arrays or objects, these are converted into Morpho `List` and `Dictionary` values. + +## tostring +[tagtostring]: # (tostring) + +Converts supported Morpho values into a JSON string: + + var s = JSON.tostring([1,2,3]) + print s + +This method supports `nil`, booleans, numbers, `String`, `List` and `Dictionary` values containing supported data. diff --git a/help/selection.md b/help/selection.md index 7b2c3c32c..5b5f760bb 100644 --- a/help/selection.md +++ b/help/selection.md @@ -30,6 +30,32 @@ To add additional grades, use the addgrade method. For example, to add areas: [showsubtopics]: # subtopics +## union +[tagunion]: # (union) +Combines two selections into a new `Selection` containing elements present in either selection: + + var s = s1.union(s2) + +The `+` operator provides the same operation for selections: + + var s = s1+s2 + +## intersection +[tagintersection]: # (intersection) +Returns a new `Selection` containing only elements present in both selections: + + var s = s1.intersection(s2) + +## difference +[tagdifference]: # (difference) +Returns a new `Selection` containing elements present in the first selection but not the second: + + var s = s1.difference(s2) + +The `-` operator provides the same operation for selections: + + var s = s1-s2 + ## addgrade [tagaddgrade]: # (addgrade) Adds elements of the specified grade to a Selection. For example, to add edges to an existing selection, use diff --git a/help/sparse.md b/help/sparse.md index c0df18762..e48abe90b 100644 --- a/help/sparse.md +++ b/help/sparse.md @@ -68,3 +68,10 @@ For example: var cols = a.colindices() print cols + +## Indices +[tagindices]: # (indices) + +Returns the row and column indices used by the sparse matrix representation: + + print a.indices() From db21515d720ccad81717083eaf3473597dce3d4f Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Fri, 22 May 2026 10:36:21 +0200 Subject: [PATCH 456/473] Fix subtopics macro! --- help/controlflow.md | 2 ++ help/dictionary.md | 2 +- help/fespace.md | 2 +- help/file.md | 6 ++---- help/functions.md | 3 +-- help/graphics.md | 2 +- help/json.md | 2 +- help/mesh.md | 2 +- help/meshslice.md | 2 ++ help/sparse.md | 2 +- help/syntax.md | 2 ++ help/variables.md | 2 ++ 12 files changed, 17 insertions(+), 12 deletions(-) diff --git a/help/controlflow.md b/help/controlflow.md index 973a1acb6..06d2b57a2 100644 --- a/help/controlflow.md +++ b/help/controlflow.md @@ -13,6 +13,8 @@ Control flow statements are used to determine whether and how many times a selec * `for` - Repeatedly execute a section of code with a counter * `while` - Repeatedly execute a section of code while a condition is true. +[showsubtopics]: # (subtopics) + ## If [tagif]: # (if) [tagelse]: # (else) diff --git a/help/dictionary.md b/help/dictionary.md index 0b0594de2..f77e008fd 100644 --- a/help/dictionary.md +++ b/help/dictionary.md @@ -28,7 +28,7 @@ Loop over keys in a dictionary: for (k in dict) print k -[showsubtopics]: # (showsubtopics) +[showsubtopics]: # (subtopics) ## Keys [tagkeys]: # (keys) diff --git a/help/fespace.md b/help/fespace.md index 917409f35..bd3a7cd9c 100644 --- a/help/fespace.md +++ b/help/fespace.md @@ -15,7 +15,7 @@ You can also obtain a finite element space from an existing field: var fs = f.finiteElementSpace() -[showsubtopics]: # (showsubtopics) +[showsubtopics]: # (subtopics) ## Count [tagcount]: # (count) diff --git a/help/file.md b/help/file.md index cb649fabd..5a9f54aca 100644 --- a/help/file.md +++ b/help/file.md @@ -29,8 +29,7 @@ After you're done with the file, close it with f.close() -[show]: # (subtopics) - +[showsubtopics]: # (subtopics) ## lines [taglines]: # (lines) @@ -110,8 +109,7 @@ Returns the filename that was used to open the file: The `Folder` class allows you to work with folders. You can find whether a filepath refers to a folder, obtain the contents of that folder and create folders. -[show]: # (subtopics) - +[showsubtopics]: # (subtopics) ## isFolder [tagisfolder]: # (isfolder) [tagisFolder]: # (isfolder) diff --git a/help/functions.md b/help/functions.md index f062b6aea..209ce1d6d 100644 --- a/help/functions.md +++ b/help/functions.md @@ -36,8 +36,7 @@ The correct implementation is then selected at runtime: f("Hello World!") // expect: A string! -[show]: # (subtopics) - +[showsubtopics]: # (subtopics) ## Variadic [tagvariadic]: # (variadic) diff --git a/help/graphics.md b/help/graphics.md index f5627d8e3..3bf983b83 100644 --- a/help/graphics.md +++ b/help/graphics.md @@ -28,7 +28,7 @@ To combine graphics objects, use the add operator: // ... Show(g1+g2) -[show]: # (subtopics) +[showsubtopics]: # (subtopics) ## Show [tagshow]: # (Show) diff --git a/help/json.md b/help/json.md index a5ff36289..9074fc0bd 100644 --- a/help/json.md +++ b/help/json.md @@ -21,7 +21,7 @@ To convert basic data types to JSON, use the `JSON.tostring` class method: The exporter supports `nil`, boolean values `true` and `false`, numbers, `String`s as well as `List` and `Dictionary` objects that may contain any of the supported types. -[showsubtopics]: # (showsubtopics) +[showsubtopics]: # (subtopics) ## Parse [tagparse]: # (parse) diff --git a/help/mesh.md b/help/mesh.md index e4be26bb5..693c2d824 100644 --- a/help/mesh.md +++ b/help/mesh.md @@ -16,7 +16,7 @@ Each type of element is referred to as belonging to a different `grade`. Point-l The `plot` package includes functions to visualize meshes. -[showsubtopics]: # (showsubtopics) +[showsubtopics]: # (subtopics) ## Save [tagsave]: # (Save) diff --git a/help/meshslice.md b/help/meshslice.md index f69814167..6a9befb57 100644 --- a/help/meshslice.md +++ b/help/meshslice.md @@ -27,6 +27,8 @@ The new field returned by `slicefield` lives on the sliced mesh. You can slice a You can perform multiple slices with the same `MeshSlicer` simply by calling `slice` again with a different plane. +[showsubtopics]: # (subtopics) + ## SlcEmpty [tagslcempty]: # (slcempty) diff --git a/help/sparse.md b/help/sparse.md index e48abe90b..87409f8f8 100644 --- a/help/sparse.md +++ b/help/sparse.md @@ -26,7 +26,7 @@ Once a sparse matrix is created, you can use all the regular arithmetic operator a+b a*b -[showsubtopics]: # (showsubtopics) +[showsubtopics]: # (subtopics) ## Rowindices [tagrowindices]: # (rowindices) diff --git a/help/syntax.md b/help/syntax.md index 69a9ed1d7..bf0b3bffc 100644 --- a/help/syntax.md +++ b/help/syntax.md @@ -12,6 +12,8 @@ Morpho programs are stored as plain text with the .morpho file extension. A prog morpho5 program.morpho +[showsubtopics]: # (subtopics) + ## Comments [tagcomment]: # (comment) [tagcomments]: # (comments) diff --git a/help/variables.md b/help/variables.md index ad53df9ec..05159bbe1 100644 --- a/help/variables.md +++ b/help/variables.md @@ -35,6 +35,8 @@ Multiple variables can be defined at once by separating them with commas where each can have its own initializer (or not). +[showsubtopics]: # (subtopics) + ## Indexing [taglb]: # ([) [tagrb]: # (]) From dece26cf390f9c5b02840bcf1897aaa836f04128 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 31 May 2026 09:08:29 +0100 Subject: [PATCH 457/473] Wire in System.help --- help/field.md | 2 +- help/functionals.md | 19 ++++++++++++++ releasenotes/version-0.6.4.md | 47 +++++++++++++++++++++++++++++++++++ src/classes/system.c | 39 ++++++++++++++--------------- 4 files changed, 86 insertions(+), 21 deletions(-) create mode 100644 releasenotes/version-0.6.4.md diff --git a/help/field.md b/help/field.md index 8d40f6e17..a108d6581 100644 --- a/help/field.md +++ b/help/field.md @@ -122,7 +122,7 @@ Returns a matrix containing the data stored by the field: print mat ## __linearize -[tag__linearize]: # (__linearize) +[tagxlinearize]: # (__linearize) Returns the underlying storage matrix directly. diff --git a/help/functionals.md b/help/functionals.md index 0658e2734..389037863 100644 --- a/help/functionals.md +++ b/help/functionals.md @@ -405,3 +405,22 @@ Manually set the coefficients and grade to operate on: lfh.grade = 2, lfh.phi0 = 0.5, lfh.phiref = 0.1 See the `Functionals` entry for general information about functionals. + +## Jump +[tagjump]: # (jump) + +The `Jump` functional computes an interface contribution over interior codimension-1 mesh elements. It evaluates your integrand on interfaces shared by exactly two parent elements and ignores boundary interfaces. + +Initialize a jump functional with an integrand and any fields it depends on: + + var j = Jump(fn (x, phi) jumpdn(phi)^2, phi) + +The integrand receives the interface position `x` followed by the interpolated field values in the order supplied to `Jump`. + +Within a `Jump` integrand, the special function `jumpdn(field)` returns the jump in the normal derivative of a supplied field across the current interface. + +`Jump` also accepts the same optional integration settings as the integral functionals. In particular, the `method` dictionary may specify a `strategy` of `"centroid"` or `"quadrature"`: + + var j = Jump(fn (x, phi) jumpdn(phi)^2, phi, method: {"strategy": "quadrature"}) + +See the `Functionals` entry for general information about functionals. diff --git a/releasenotes/version-0.6.4.md b/releasenotes/version-0.6.4.md new file mode 100644 index 000000000..1aee82032 --- /dev/null +++ b/releasenotes/version-0.6.4.md @@ -0,0 +1,47 @@ +# Release notes for 0.6.4 + +We're pleased to announce Morpho 0.6.4, which contains many significant improvements and is the first release available natively on Windows. + +## New linear algebra implementation + +The linear algebra package in morpho has been rewritten to support complex matrices as well as a more extensible implementation that should support other matrix types in future. These still use the BLAS and LAPACK numerical libraries, but more underlying capability is exposed. Both the `Matrix` and `ComplexMatrix` now support additional matrix decompositions, such as QR decomposition and SVD. The new implementation is highly compatible with existing code; in a few cases alternative error messages are generated and results are returned in Tuples rather than Lists. + +## Additional finite elements + +In addition to the existing CG1 and CG2 implementations, morpho now supports a third order Lagrangian element CG3; this is valuable for problems involving hessians, for example. Support in the codebase for higher order elements has been improved, e.g. `MeshRefiner` is now able to refine a `Field` using these elements correctly. The `FiniteElementSpace` class now exposes additional information about a particular finite element to the user. + +Interior penalty schemes are now available through a `Jump` functional, which integrates over the join between two connected elements. See the `jump` documentation for more details. (This feature is experimental). + +## Additional functionality available within integrand functions + +Functions passed to `LineIntegral`, `AreaIntegral` and `VolumeIntegral` may call some special functions to access additional information: + + * `elementid` returns the id of the current element + * `hessian` returns the local hessian of a field + * `jacobian` returns the jacobian of the map from the reference element to the current element. + * `invjacobian` returns the inverse jacobian. + +## Improved type checking within the compiler + +The morpho compiler now allows variables to be declared with a distinct type, e.g. + + String s = "Hello" + +and enforces these through a combination of static and runtime checks. Assignment of an incorrect type to a typed variable yields a type error. The compiler is able to infer many types automatically across arithmetic operations, function calls etc. A few new classes have been added, e.g. `Callable`, to assist in writing functions using multiple dispatch. + +## Improvements to help system + +The core help system has been moved from the terminal app to the morpho library, facilitating access by other interfaces. An improved markdown parser enables richer help entries. Enhanced search capabilities: the help system now provides a hint if there are multiple matches, and possible matches if there are none (e.g. if the user misspells something). Help text can now be retrieved programmatically using `System.help`. + +## Folder improvements + +New class methods `Folder.create` and `Folder.createRecursive` allow creation of new folders. The class method `Folder.normalizePath` converts a file path with arbitrary folder delimiters to the correct ones for the current platform. + +## Minor fixes + +* Bug in `System.setworkingfolder` fixed. +* Rewritten multiple dispatch implementation fixes edge-cases in method resolution. +* Improved test suite coverage. +* graphics package updated to support Windows fonts. +* Improvements to `Tuple` class to better match `List`'s capabilities. +* Fixed a problem with building morpho on ARM64 linux. \ No newline at end of file diff --git a/src/classes/system.c b/src/classes/system.c index 2efb5ee38..14a9b4cb0 100644 --- a/src/classes/system.c +++ b/src/classes/system.c @@ -134,25 +134,6 @@ value System_setworkingfolder__err(vm *v, int nargs, value *args) { return MORPHO_NIL; } -/** Help query */ -value System_help(vm *v, int nargs, value *args) { - value out = MORPHO_NIL; - - if (nargs==1 && MORPHO_ISSTRING(MORPHO_GETARG(args, 0))) { - char *query = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); - - varray_char result; - varray_charinit(&result); - - morpho_helpastext(query, &result); /* fills result with help text or a "not found" hint */ - out = object_stringfromvarraychar(&result); - if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); - varray_charclear(&result); - } - - return out; -} - /** Get working folder */ value System_workingfolder(vm *v, int nargs, value *args) { value out = MORPHO_NIL; @@ -187,6 +168,23 @@ value System_homefolder(vm *v, int nargs, value *args) { return out; } +/** Help query */ +value System_help__string(vm *v, int nargs, value *args) { + value out = MORPHO_NIL; + + char *query = MORPHO_GETCSTRING(MORPHO_GETARG(args, 0)); + + varray_char result; + varray_charinit(&result); + + morpho_helpastext(query, &result); /* fills result with help text or a "not found" hint */ + out = object_stringfromvarraychar(&result); + if (MORPHO_ISOBJECT(out)) morpho_bindobjects(v, 1, &out); + varray_charclear(&result); + + return out; +} + MORPHO_BEGINCLASS(System) MORPHO_METHOD_SIGNATURE(SYSTEM_PLATFORM_METHOD, "String ()", System_platform, MORPHO_FN_ALLOCATES), MORPHO_METHOD_SIGNATURE(SYSTEM_VERSION_METHOD, "String ()", System_version, MORPHO_FN_ALLOCATES), @@ -201,7 +199,8 @@ MORPHO_METHOD_SIGNATURE(SYSTEM_EXIT_METHOD, "Nil ()", System_exit, MORPHO_FN_IO| MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (String)", System_setworkingfolder, MORPHO_FN_IO|MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(SYSTEM_SETWORKINGFOLDER_METHOD, "Nil (...)", System_setworkingfolder__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(SYSTEM_WORKINGFOLDER_METHOD, "String ()", System_workingfolder, MORPHO_FN_IO|MORPHO_FN_THROWS|MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(SYSTEM_HOMEFOLDER_METHOD, "String ()", System_homefolder, MORPHO_FN_IO|MORPHO_FN_THROWS|MORPHO_FN_ALLOCATES) +MORPHO_METHOD_SIGNATURE(SYSTEM_HOMEFOLDER_METHOD, "String ()", System_homefolder, MORPHO_FN_IO|MORPHO_FN_THROWS|MORPHO_FN_ALLOCATES), +MORPHO_METHOD_SIGNATURE(SYSTEM_HELP_METHOD, "String (String)", System_help__string, MORPHO_FN_IO|MORPHO_FN_THROWS|MORPHO_FN_ALLOCATES) MORPHO_ENDCLASS /* ********************************************************************** From 816d4a6beab4f21c710b5316de6832eb4e9ec139 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 31 May 2026 09:31:04 +0100 Subject: [PATCH 458/473] Fix help system to avoid duplicate topics --- src/classes/list.c | 26 +++++++++++++------------- src/classes/list.h | 1 + src/support/help.c | 6 +++++- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/src/classes/list.c b/src/classes/list.c index 2b39f6c3e..790a2a830 100644 --- a/src/classes/list.c +++ b/src/classes/list.c @@ -99,16 +99,13 @@ bool list_insert(objectlist *list, int indx, int nval, value *vals) { * @param[in] val the entry to remove * @returns true on success */ bool list_remove(objectlist *list, value val) { - /* Find the element */ - for (unsigned int i=0; ival.count; i++) { - if (MORPHO_ISEQUAL(list->val.data[i], val)) { /* Remove it if we're not at the end of the list */ - if (ival.count-1) memmove(list->val.data+i, list->val.data+i+1, sizeof(value)*(list->val.count-i-1)); - list->val.count--; - return true; - } - } + unsigned int i; - return false; + if (!list_find(list, val, &i)) return false; + + if (ival.count-1) memmove(list->val.data+i, list->val.data+i+1, sizeof(value)*(list->val.count-i-1)); + list->val.count--; + return true; } /** Gets an element from a list @@ -217,10 +214,13 @@ void list_reverse(objectlist *list) { } } -/** Tests if a value is a member of a list */ -bool list_ismember(objectlist *list, value v) { +/** Finds a value in a list and optionally returns its index. */ +bool list_find(objectlist *list, value v, unsigned int *indx) { for (unsigned int i=0; ival.count; i++) { - if (MORPHO_ISEQUAL(list->val.data[i], v)) return true; + if (MORPHO_ISEQUAL(list->val.data[i], v)) { + if (indx) *indx=i; + return true; + } } return false; } @@ -701,7 +701,7 @@ value List_reverse(vm *v, int nargs, value *args) { /** Tests if a list has a value as a member */ value List_ismember(vm *v, int nargs, value *args) { objectlist *slf = MORPHO_GETLIST(MORPHO_SELF(args)); - return MORPHO_BOOL(list_ismember(slf, MORPHO_GETARG(args, 0))); + return MORPHO_BOOL(list_find(slf, MORPHO_GETARG(args, 0), NULL)); } value List_ismember__err(vm *v, int nargs, value *args) { diff --git a/src/classes/list.h b/src/classes/list.h index 8fbdc4226..393f25daa 100644 --- a/src/classes/list.h +++ b/src/classes/list.h @@ -76,6 +76,7 @@ value List_getindex(vm *v, int nargs, value *args); bool list_resize(objectlist *list, int size); void list_append(objectlist *list, value v); bool list_remove(objectlist *list, value val); +bool list_find(objectlist *list, value v, unsigned int *indx); unsigned int list_length(objectlist *list); bool list_getelement(objectlist *list, int i, value *out); void list_sortcontents(value *values, size_t count); diff --git a/src/support/help.c b/src/support/help.c index 4f406ca42..3e698a531 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -658,7 +658,11 @@ static value help_nameindex_add(const char *buf, size_t len, int topic_index) { if (!dictionary_insert(&s_names, key, MORPHO_OBJECT(list))) morpho_freeobject(MORPHO_OBJECT(list)); } - } else if (MORPHO_ISLIST(v)) list_append(MORPHO_GETLIST(v), MORPHO_INTEGER(topic_index)); + } else if (MORPHO_ISLIST(v)) { + objectlist *list = MORPHO_GETLIST(v); + value topic = MORPHO_INTEGER(topic_index); + if (!list_find(list, topic, NULL)) list_append(list, topic); + } } return key; } From 0079f61ec649576fb674b2dac114428b6b9130ce Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 31 May 2026 10:33:43 +0100 Subject: [PATCH 459/473] Simplify help implementation --- src/support/help.c | 180 ++++++++++++++++++++++++++++++++------------- src/support/help.h | 2 +- 2 files changed, 130 insertions(+), 52 deletions(-) diff --git a/src/support/help.c b/src/support/help.c index 3e698a531..f205259be 100644 --- a/src/support/help.c +++ b/src/support/help.c @@ -245,6 +245,12 @@ typedef struct { int current_topic_index; // Index of most recently created topic, or -1 } md_parseout; +typedef struct { + char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; + const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; + int nsegs; +} help_queryparts; + /* Forward declarations */ static void md_push_simpleblock(parser *p, md_parseout *out, size_t block_start, md_blocktype type); static void md_push_blank(parser *p, md_parseout *out); @@ -254,6 +260,12 @@ static void md_push_paragraph(parser *p, md_parseout *out, size_t block_start); static void md_push_code(parser *p, md_parseout *out, size_t block_start); static void md_push_list(parser *p, md_parseout *out, size_t block_start); static void md_push_link(parser *p, md_parseout *out, size_t block_start, size_t label_start, size_t label_len, size_t target_start, size_t target_len); +static bool help_istopleveltopic(unsigned int i); +static int help_topicdepth(int idx); +static bool help_nameindex_get(const char *name, value *out); +static int help_parsequery(const char *query, help_queryparts *parts); +static int help_resolvetopic(const help_queryparts *query); +static void help_appendothertopics(const char *name, int preferred, varray_char *result); /** Span from the token we just consumed (p->previous). */ static md_span md_span_previous(parser *p, const char *base) { @@ -607,7 +619,7 @@ void md_file_clear(md_file *f) { * Name index (single dict: name/alias -> index or List of indices) * ------------------------------------------------------- */ -static bool help_name_referenced_by(value name, unsigned int keep_count) { +static bool help_namereferencedby(value name, unsigned int keep_count) { for (unsigned int j = 0; j < keep_count; j++) if (MORPHO_ISSAME(s_topics.data[j].name, name)) return true; return false; @@ -631,10 +643,16 @@ static void help_nameindex_remove(int topic_index, unsigned int keep_count) { if (remove_entry) { if (MORPHO_ISLIST(v)) morpho_freeobject(v); dictionary_remove(&s_names, name); - if (!help_name_referenced_by(name, keep_count)) morpho_freeobject(name); + if (!help_namereferencedby(name, keep_count)) morpho_freeobject(name); } } +static bool help_nameindex_get(const char *name, value *out) { + objectstring key_str = MORPHO_STATICSTRING(name); + value key = MORPHO_OBJECT(&key_str); + return dictionary_get(&s_names, key, out); +} + /** Add topic_index under name (buf, len). Look up with static key; if present use existing key and update value, else allocate and insert. Returns canonical name value. */ static value help_nameindex_add(const char *buf, size_t len, int topic_index) { objectstring key_obj = MORPHO_STATICSTRINGWITHLENGTH(buf, len); @@ -668,7 +686,7 @@ static value help_nameindex_add(const char *buf, size_t len, int topic_index) { } /** Get first topic index from dict value (integer or first element of list). Returns -1 if not found or invalid. */ -static int help_indexvalue_first(value v) { +static int help_firstindex(value v) { if (MORPHO_ISINTEGER(v)) return MORPHO_GETINTEGERVALUE(v); if (MORPHO_ISLIST(v)) { objectlist *list = MORPHO_GETLIST(v); @@ -681,7 +699,7 @@ static int help_indexvalue_first(value v) { } /** Fill indices[] from dict value (integer or list). Returns number of indices written (at most max). */ -static int help_indexvalue_collect(value v, int indices[], int max) { +static int help_collectindices(value v, int indices[], int max) { if (MORPHO_ISINTEGER(v)) { if (max > 0) indices[0] = MORPHO_GETINTEGERVALUE(v); return 1; @@ -701,19 +719,43 @@ static int help_indexvalue_collect(value v, int indices[], int max) { } int help_findtopic(const char *name) { - objectstring key_str = MORPHO_STATICSTRING(name); - value key = MORPHO_OBJECT(&key_str); - value v; - if (!dictionary_get(&s_names, key, &v)) return -1; - return help_indexvalue_first(v); + int cand[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(name, cand, MORPHO_HELP_MAX_MULTIMATCH); + if (n <= 0) return -1; + + int preferred = cand[0]; + int bestdepth = help_topicdepth(preferred); + bool ambiguous = false; + + for (int i = 1; i < n; i++) { + int depth = help_topicdepth(cand[i]); + if (depth < bestdepth) { + bestdepth = depth; + preferred = cand[i]; + ambiguous = false; + } else if (depth == bestdepth) { + ambiguous = true; + } + } + + return ambiguous ? cand[0] : preferred; } int help_findallbyname(const char *name, int indices[], int max) { - objectstring key_str = MORPHO_STATICSTRING(name); - value key = MORPHO_OBJECT(&key_str); value v; - if (!dictionary_get(&s_names, key, &v)) return 0; - return help_indexvalue_collect(v, indices, max); + if (!help_nameindex_get(name, &v)) return 0; + return help_collectindices(v, indices, max); +} + +static int help_topicdepth(int idx) { + int depth = 0; + + while (idx >= 0 && (unsigned int) idx < s_topics.count) { + idx = s_topics.data[idx].parent_topic; + if (idx >= 0) depth++; + } + + return depth; } /** Find child of parent topic with given name. Returns topic index or -1. Uses s_names then filters by parent. */ @@ -868,7 +910,10 @@ static bool help_createalias(const char *base, size_t label_start, size_t label_ * ------------------------------------------------------- */ /** Parse query into lowercased segments in qbuf; segs[] points into qbuf. Returns nsegs (0 if none). */ -static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { +static int help_parsequery(const char *query, help_queryparts *parts) { + char *qbuf = parts->qbuf; + const char **segs = parts->segs; + // Copy query, lowercase, replace '.' and ' ' with nul size_t qlen = 0; while (query[qlen] && qlen < MORPHO_MAX_HELPQUERY_LENGTH - 1) { @@ -886,6 +931,7 @@ static int help_parsequery(const char *query, char *qbuf, const char *segs[]) { segs[nsegs++] = p; while (p < qbuf + qlen && *p != '\0') p++; } + parts->nsegs = nsegs; return nsegs; } @@ -915,7 +961,7 @@ static int help_findparent(int idx) { } /** Write full display path for topic (e.g. "System.clock") into buf. */ -static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { +static void help_displaypath(int idx, char *buf, size_t bufsize) { if (!bufsize) return; if (idx < 0 || (unsigned int) idx >= s_topics.count) { buf[0] = '\0'; @@ -927,9 +973,9 @@ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { buf[0] = '\0'; return; } - int p = (t->level > 1) ? help_findparent(idx) : -1; + int p = t->parent_topic; if (p >= 0) { - help_topic_displaypath(p, buf, bufsize); + help_displaypath(p, buf, bufsize); size_t len = strlen(buf); if (len + 1 < bufsize) snprintf(buf + len, bufsize - len, ".%s", name); } else { @@ -937,6 +983,20 @@ static void help_topic_displaypath(int idx, char *buf, size_t bufsize) { } } +static int help_resolvetopic(const help_queryparts *query) { + if (query->nsegs <= 0) return -1; + + int idx = help_findtopic(query->segs[0]); + if (idx < 0) return -1; + + for (int i = 1; i < query->nsegs; i++) { + idx = help_findchild(idx, query->segs[i]); + if (idx < 0) return -1; + } + + return idx; +} + /* ------------------------------------------------------- * Edit distance and suggestions * ------------------------------------------------------- */ @@ -1183,7 +1243,7 @@ static void help_hintappend_multi(varray_char *result, const char *query, int in int n = snprintf(buf, sizeof(buf), "Topic '%s' had multiple matches: did you mean ", query); // First: "'A'"; middle: ", 'B'"; last: " or 'C'?" for (int i = 0; i < count && n < (int) sizeof(buf) - 4; i++) { - help_topic_displaypath(indices[i], path, sizeof(path)); + help_displaypath(indices[i], path, sizeof(path)); if (i == 0) n += snprintf(buf + n, sizeof(buf) - (size_t) n, "'%s'", path); else if (i == count - 1) n += snprintf(buf + n, sizeof(buf) - (size_t) n, " or '%s'?", path); else n += snprintf(buf + n, sizeof(buf) - (size_t) n, ", '%s'", path); @@ -1191,28 +1251,48 @@ static void help_hintappend_multi(varray_char *result, const char *query, int in if (n > 0 && (size_t) n < sizeof(buf)) varray_charadd(result, buf, n); } +static void help_appendothertopics(const char *name, int preferred, varray_char *result) { + int cand[MORPHO_HELP_MAX_MULTIMATCH]; + int n = help_findallbyname(name, cand, MORPHO_HELP_MAX_MULTIMATCH); + int nothers = 0; + + for (int i = 0; i < n; i++) { + if (cand[i] != preferred) nothers++; + } + if (nothers <= 0) return; + + char path[MORPHO_MAX_HELPQUERY_LENGTH]; + varray_charadd(result, "\n\nOther topics:\n", 16); + for (int i = 0; i < n; i++) { + if (cand[i] == preferred) continue; + help_displaypath(cand[i], path, sizeof(path)); + varray_charadd(result, "- ", 2); + varray_charadd(result, path, strlen(path)); + varray_charwrite(result, '\n'); + } +} + /** Build a hint for a failed query and append to result (caller may clear result first). */ void help_queryhint(const char *query, varray_char *result) { if (!result) return; - char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; - const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; - int nsegs = help_parsequery(query, qbuf, segs); - if (nsegs == 0) { + help_queryparts parsed; + + if (help_parsequery(query, &parsed) == 0) { varray_charadd(result, MORPHO_HELP_NOTFOUND, strlen(MORPHO_HELP_NOTFOUND)); varray_charwrite(result, '\0'); return; } // Single segment: multi-match hint, or "not found" + closest, or NOTFOUND - if (nsegs == 1) { + if (parsed.nsegs == 1) { int multi[MORPHO_HELP_MAX_MULTIMATCH]; - int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); + int n = help_findallbyname(parsed.segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); if (n >= 2) { help_hintappend_multi(result, query, multi, n); varray_charwrite(result, '\0'); return; } if (n == 0) { - help_hintappend(result, query, help_findclosesttopic(segs[0], -1)); + help_hintappend(result, query, help_findclosesttopic(parsed.segs[0], -1)); varray_charwrite(result, '\0'); return; } @@ -1221,20 +1301,20 @@ void help_queryhint(const char *query, varray_char *result) { return; } // Multi-segment: resolve first, then walk subtopics; on first failure suggest path.closest - int idx = help_findtopic(segs[0]); + int idx = help_findtopic(parsed.segs[0]); if (idx < 0) { - help_hintappend(result, query, help_findclosesttopic(segs[0], -1)); + help_hintappend(result, query, help_findclosesttopic(parsed.segs[0], -1)); varray_charwrite(result, '\0'); return; } char path[MORPHO_MAX_HELPQUERY_LENGTH]; - int path_len = snprintf(path, sizeof(path), "%s", segs[0]); + int path_len = snprintf(path, sizeof(path), "%s", parsed.segs[0]); if (path_len < 0 || path_len >= (int) sizeof(path)) path_len = (int) sizeof(path) - 1; - for (int i = 1; i < nsegs; i++) { - int next = help_findchild(idx, segs[i]); + for (int i = 1; i < parsed.nsegs; i++) { + int next = help_findchild(idx, parsed.segs[i]); if (next < 0) { - const char *closest = help_findclosesttopic(segs[i], idx); + const char *closest = help_findclosesttopic(parsed.segs[i], idx); char suggest[MORPHO_MAX_HELPQUERY_LENGTH] = {0}; if (closest) { int needed = path_len + 1 + (int) strlen(closest); @@ -1248,7 +1328,7 @@ void help_queryhint(const char *query, varray_char *result) { idx = next; // Append "." + segs[i] to path for next level if (path_len >= (int) sizeof(path) - 1) continue; // No room - int n = snprintf(path + path_len, (size_t)(sizeof(path) - path_len), ".%s", segs[i]); + int n = snprintf(path + path_len, (size_t)(sizeof(path) - path_len), ".%s", parsed.segs[i]); if (n > 0) path_len += (n < (int) sizeof(path) - path_len) ? n : (int) sizeof(path) - 1 - path_len; } varray_charadd(result, MORPHO_HELP_NOTFOUND, strlen(MORPHO_HELP_NOTFOUND)); @@ -1271,21 +1351,11 @@ static void help_ensureloaded(void) { /** Interface to the morpho help system. Query may be "Topic" or "Topic subtopic" / "Topic.subtopic". */ bool morpho_helpastopic(const char *query, help_topic *out) { help_ensureloaded(); - char qbuf[MORPHO_MAX_HELPQUERY_LENGTH]; - const char *segs[MORPHO_HELP_QUERY_MAXSEGMENTS]; - int nsegs = help_parsequery(query, qbuf, segs); - if (nsegs <= 0) return false; - - int multi[MORPHO_HELP_MAX_MULTIMATCH]; - int n = help_findallbyname(segs[0], multi, MORPHO_HELP_MAX_MULTIMATCH); - if (n == 0) return false; - if (nsegs == 1 && n != 1) return false; /* single segment needs unique match; multiple -> caller shows hint */ - int idx = multi[0]; - - for (int i = 1; i < nsegs; i++) { - idx = help_findchild(idx, segs[i]); - if (idx < 0) return false; - } + help_queryparts parsed; + if (help_parsequery(query, &parsed) <= 0) return false; + + int idx = help_resolvetopic(&parsed); + if (idx < 0) return false; const md_topic *topic = &s_topics.data[idx]; if (topic->file_index < 0 || (unsigned int) topic->file_index >= s_files.count) return false; @@ -1297,7 +1367,15 @@ bool morpho_helpastopic(const char *query, help_topic *out) { bool morpho_helpastext(const char *query, varray_char *result) { help_topic t; - if (morpho_helpastopic(query, &t)) return help_topictotext(&t, result); + if (morpho_helpastopic(query, &t)) { + bool success = help_topictotext(&t, result); + help_queryparts parsed; + + if (success && help_parsequery(query, &parsed) == 1) { + help_appendothertopics(parsed.segs[0], help_findtopic(parsed.segs[0]), result); + } + return success; + } help_queryhint(query, result); return false; } @@ -1310,7 +1388,7 @@ bool morpho_helpasmd(const char *query, varray_char *result) { } /** True if topic at index i is top-level (level 1 or promoted level 2). */ -static bool help_topic_is_toplevel(unsigned int i) { +static bool help_istopleveltopic(unsigned int i) { if (i >= s_topics.count) return false; const md_topic *t = &s_topics.data[i]; bool include = (t->level == 1); @@ -1327,8 +1405,8 @@ void morpho_helptopics(varray_value *out) { for (unsigned int i = 0; i < s_names.capacity; i++) { const dictionaryentry *e = &s_names.contents[i]; if (MORPHO_ISNIL(e->key) || !MORPHO_ISSTRING(e->key)) continue; - int ti = help_indexvalue_first(e->val); - if (ti < 0 || !help_topic_is_toplevel((unsigned int) ti)) continue; + int ti = help_firstindex(e->val); + if (ti < 0 || !help_istopleveltopic((unsigned int) ti)) continue; varray_valuewrite(out, e->key); } } diff --git a/src/support/help.h b/src/support/help.h index 666f853a3..e5781c0ab 100644 --- a/src/support/help.h +++ b/src/support/help.h @@ -93,7 +93,7 @@ void md_block_clear(md_block *b); void md_file_init(md_file *f); void md_file_clear(md_file *f); -/** Find one topic index by name or alias (first match if multiple). Returns -1 if not found. */ +/** Find one topic index by name or alias, preferring the shallowest unique match. Returns -1 if not found. */ int help_findtopic(const char *name); /** Find all topic indices with given name. Fills indices[] up to max, returns count. */ From 5bf4032c2672a3603175cd380ec52dcc5a43305d Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 2 Jun 2026 19:39:45 +0100 Subject: [PATCH 460/473] MeshChecker added --- modules/meshtools.morpho | 169 ++++++++++++++++++++++ test/modules/meshtools/meshchecker.morpho | 38 +++++ 2 files changed, 207 insertions(+) create mode 100644 test/modules/meshtools/meshchecker.morpho diff --git a/modules/meshtools.morpho b/modules/meshtools.morpho index b73264571..26128ee1f 100644 --- a/modules/meshtools.morpho +++ b/modules/meshtools.morpho @@ -8,6 +8,7 @@ import constants import kdtree import delaunay +import functionals // Error messages var _errMshBldDimIncnstnt = Error("MshBldDimIncnstnt", "Vertex dimension inconsistent with mesh dimension.") @@ -340,6 +341,11 @@ fn _cmpel(a,b) { return true } +fn _issubset(a, b) { + for (x in a) if (!b.ismember(x)) return false + return true +} + // Determine if list a is already in a list of lists fn _elinlist(ellist, a) { for (el in ellist) { @@ -1222,3 +1228,166 @@ class MeshPruner is MeshAdaptiveRefiner { return self.adapt(selection=selection) } } + +/* ********************************** + * MeshChecker + * ********************************** */ + + class MeshChecker { + init(mesh, quiet=false) { + self.mesh = mesh + self.sizetol = 1e-4 + self.quiet=quiet + } + + _functionalForGrade(grade) { + if (grade==1) return Length + if (grade==2) return Area + if (grade==3) return Volume + } + + countElements() { + for (grade in 0..self.mesh.maxgrade()) { + print "Grade ${grade}: ${self.mesh.count(grade)} elements" + } + } + + checkElementDim() { + for (grade in 1..self.mesh.maxgrade()) { + var conn = self.mesh.connectivitymatrix(0,grade) + if (!conn) continue + + var nel = conn.dimensions()[1] + for (id in 0...nel) { + if (conn.rowindices(id).count()!=grade+1) { + Error("MshElDim", "Grade ${grade}, element ${id} has ${conn.rowindices(id).count()} vertices").warning() + } + } + } + } + + checkDuplicateVertices() { + if (self.mesh.count()==0) return + var x0 = self.mesh.vertexposition(0) + + var tree = KDTree([x0]) + + for (id in 1...self.mesh.count()) { + var x = self.mesh.vertexposition(id) + var nearest = (tree.nearest(x).location - x).norm() + if (nearest < self.sizetol) { + Error("MshDupVtx", "Duplicate vertex ${id} [${nearest}]").warning() + } + + var node = tree.insert(x) + node.id = id + } + } + + checkDuplicateElements() { + for (grade in 1..self.mesh.maxgrade()) { + var conn = self.mesh.connectivitymatrix(0,grade) + if (!conn) continue + + var dict = {} + var nel = conn.dimensions()[1] + + for (id in 0...nel) { + var ind = conn.rowindices(id) + ind.sort() + var el = apply(Tuple, ind) + + if (dict.contains(el)) { + Error("MshDup","Grade ${grade} id ${id} is a duplicate element of id ${dict[el]}").warning() + } else { + dict[el]=id + } + } + } + } + + checkElementConnectivity() { + for (grade in 2..self.mesh.maxgrade()) { + var conn = self.mesh.connectivitymatrix(0, grade) + if (!conn) continue + + for (subgrade in 1...grade) { + var subconn = self.mesh.connectivitymatrix(0, subgrade) + var relconn = self.mesh.connectivitymatrix(subgrade, grade) + var revconn = self.mesh.connectivitymatrix(grade, subgrade) + if (!subconn || !relconn || !revconn) continue + + var nsub = self.mesh.count(subgrade) + var nel = self.mesh.count(grade) + + for (id in 0...nel) { + var el = conn.rowindices(id) + var actual = relconn.rowindices(id).clone() + actual.sort() + + var expected = [] + for (subid in 0...nsub) { + var subel = subconn.rowindices(subid) + if (_issubset(subel, el)) expected.append(subid) + } + expected.sort() + + if (!_cmpel(actual, expected)) { + Error("MshElCnn", + "Grade ${grade} element ${id} has inconsistent grade ${subgrade} connectivity").warning() + } + } + + for (subid in 0...nsub) { + var actual = revconn.rowindices(subid).clone() + actual.sort() + + var expected = [] + for (id in 0...nel) { + var el = conn.rowindices(id) + var subel = subconn.rowindices(subid) + if (_issubset(subel, el)) expected.append(id) + } + expected.sort() + + if (!_cmpel(actual, expected)) { + Error("MshElCnn", + "Grade ${subgrade} element ${subid} has inconsistent grade ${grade} connectivity").warning() + } + } + } + } + } + + checkElementSize() { + var dict = {} + + for (grade in 1..self.mesh.maxgrade()) { + if (self.mesh.count(grade)==0) continue + + var func = self._functionalForGrade(grade) + if (!func) continue + + var sizes = func().integrand(self.mesh) + var glist = [] + + for (size, id in sizes) { + if (size<=self.sizetol) { + Error("MshZroSz", "Grade ${grade} element ${id} has non-positive size [${size}]").warning() + glist.append(id) + } + } + dict[grade] = glist + } + return dict + } + + check() { + if (!self.quiet) print "Checking mesh..." + self.checkElementDim() + self.checkElementConnectivity() + self.checkElementSize() + self.checkDuplicateVertices() + self.checkDuplicateElements() + } +} diff --git a/test/modules/meshtools/meshchecker.morpho b/test/modules/meshtools/meshchecker.morpho new file mode 100644 index 000000000..86b1a5203 --- /dev/null +++ b/test/modules/meshtools/meshchecker.morpho @@ -0,0 +1,38 @@ +import meshtools + +var mb = MeshBuilder() +mb.addvertex([0,0,0]) +mb.addvertex([1,0,0]) +mb.addvertex([0,1,0]) +mb.addvertex([0,0,1]) +mb.addvolume([0,1,2,3]) + +var m = mb.build() +m.addgrade(1) +m.addgrade(2) +m.addgrade(3) + +var checker = MeshChecker(m, quiet=true) + +checker.countElements() +// expect: Grade 0: 4 elements +// expect: Grade 1: 6 elements +// expect: Grade 2: 4 elements +// expect: Grade 3: 1 elements + +var sizes = checker.checkElementSize() +print sizes[1].count()==0 +// expect: true +print sizes[2].count()==0 +// expect: true +print sizes[3].count()==0 +// expect: true + +checker.checkElementDim() +checker.checkDuplicateVertices() +checker.checkDuplicateElements() +checker.checkElementConnectivity() +checker.check() + +print true +// expect: true From d16311d1b48b98b9ef93003084954a834987614e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 2 Jun 2026 20:21:39 +0100 Subject: [PATCH 461/473] Improved MeshChecker --- modules/meshtools.morpho | 104 +++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 32 deletions(-) diff --git a/modules/meshtools.morpho b/modules/meshtools.morpho index 26128ee1f..8599ee835 100644 --- a/modules/meshtools.morpho +++ b/modules/meshtools.morpho @@ -341,9 +341,48 @@ fn _cmpel(a,b) { return true } -fn _issubset(a, b) { - for (x in a) if (!b.ismember(x)) return false - return true +fn _canonel(el) { + var out = el.clone() + out.sort() + return apply(Tuple, out) +} + +fn _elementsubids(subdict, el, nsubverts) { + var nverts = el.count() + var expected = [] + + var counter[nsubverts], cmax[nsubverts] + for (i in 0...nsubverts) { + counter[i] = i + cmax[i] = nverts-nsubverts+i + } + + while (true) { + var subel = [] + for (i in 0...nsubverts) subel.append(el[counter[i]]) + + var key = _canonel(subel) + if (!subdict.contains(key)) return nil + expected.append(subdict[key]) + + if (counter[0] >= cmax[0]) break + + var k = nsubverts-1 + counter[k] += 1 + while (k>0 && counter[k]>cmax[k]) { + k -= 1 + counter[k] += 1 + } + for (i in k+1...nsubverts) counter[i] = counter[i-1]+1 + } + + return expected +} + +fn _subelementdict(conn, count) { + var out = Dictionary() + for (id in 0...count) out[_canonel(conn.rowindices(id))] = id + return out } // Determine if list a is already in a list of lists @@ -1233,7 +1272,7 @@ class MeshPruner is MeshAdaptiveRefiner { * MeshChecker * ********************************** */ - class MeshChecker { +class MeshChecker { init(mesh, quiet=false) { self.mesh = mesh self.sizetol = 1e-4 @@ -1246,6 +1285,11 @@ class MeshPruner is MeshAdaptiveRefiner { if (grade==3) return Volume } + _connectivitywarning(grade, id, subgrade) { + Error("MshElCnn", + "Grade ${grade} element ${id} has inconsistent grade ${subgrade} connectivity").warning() + } + countElements() { for (grade in 0..self.mesh.maxgrade()) { print "Grade ${grade}: ${self.mesh.count(grade)} elements" @@ -1308,51 +1352,47 @@ class MeshPruner is MeshAdaptiveRefiner { checkElementConnectivity() { for (grade in 2..self.mesh.maxgrade()) { - var conn = self.mesh.connectivitymatrix(0, grade) - if (!conn) continue - for (subgrade in 1...grade) { + var conn = self.mesh.connectivitymatrix(0, grade) var subconn = self.mesh.connectivitymatrix(0, subgrade) var relconn = self.mesh.connectivitymatrix(subgrade, grade) var revconn = self.mesh.connectivitymatrix(grade, subgrade) - if (!subconn || !relconn || !revconn) continue + if (!conn || !subconn || !relconn || !revconn) continue var nsub = self.mesh.count(subgrade) - var nel = self.mesh.count(grade) + var subdict = _subelementdict(subconn, nsub) - for (id in 0...nel) { + for (id in 0...self.mesh.count(grade)) { var el = conn.rowindices(id) + var expected = _elementsubids(subdict, el, subgrade+1) + if (!expected) { + self._connectivitywarning(grade, id, subgrade) + continue + } + var actual = relconn.rowindices(id).clone() actual.sort() - - var expected = [] - for (subid in 0...nsub) { - var subel = subconn.rowindices(subid) - if (_issubset(subel, el)) expected.append(subid) - } expected.sort() if (!_cmpel(actual, expected)) { - Error("MshElCnn", - "Grade ${grade} element ${id} has inconsistent grade ${subgrade} connectivity").warning() + self._connectivitywarning(grade, id, subgrade) + continue } - } - for (subid in 0...nsub) { - var actual = revconn.rowindices(subid).clone() - actual.sort() - - var expected = [] - for (id in 0...nel) { - var el = conn.rowindices(id) - var subel = subconn.rowindices(subid) - if (_issubset(subel, el)) expected.append(id) + for (subid in actual) { + if (!revconn.rowindices(subid).ismember(id)) { + self._connectivitywarning(grade, id, subgrade) + break + } } - expected.sort() + } - if (!_cmpel(actual, expected)) { - Error("MshElCnn", - "Grade ${subgrade} element ${subid} has inconsistent grade ${grade} connectivity").warning() + for (subid in 0...nsub) { + for (id in revconn.rowindices(subid)) { + if (!relconn.rowindices(id).ismember(subid)) { + self._connectivitywarning(subgrade, subid, grade) + break + } } } } From 640cc64c6b98b14c3aa5bd95bfc681cc834fb8c8 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Tue, 2 Jun 2026 21:26:36 +0100 Subject: [PATCH 462/473] Fix version comparison --- src/datastructures/version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datastructures/version.c b/src/datastructures/version.c index 32924c839..ac87977bd 100644 --- a/src/datastructures/version.c +++ b/src/datastructures/version.c @@ -34,7 +34,7 @@ int version_cmp(version *a, version *b) { * @param[in] max - (optional) maximum version number * @returns true if min <= v <= max */ bool version_check(version *v, version *min, version *max) { - int l = (min ? version_cmp(min, v) : 0); + int l = (min ? version_cmp(v, min) : 0); int r = (max ? version_cmp(v, max) : 0); return (l>=0 && r<=0); From e16eb0bf2ccb59d55437e5a5680328de574dfa96 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 11 Jun 2026 21:29:52 -0400 Subject: [PATCH 463/473] Ensure singleton methods with types are correctly wrapped in a metafunction --- src/builtin/builtin.c | 40 ++++++++++++++++--------------- src/classes/metafunction.c | 38 +++++++++++++++++++++++++++++ src/classes/metafunction.h | 1 + src/core/compile.c | 22 +++++++---------- test/string/err_split_args.morpho | 4 ++++ 5 files changed, 72 insertions(+), 33 deletions(-) create mode 100644 test/string/err_split_args.morpho diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 4db12ffe9..2341d2e5d 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -243,28 +243,30 @@ objectclass *builtin_getparentclass(value fn) { * @param[in] dict the dictionary * @param[in] name name of the function to add * @param[in] fn function to add + * @param[in] forcewrap force wrapping the incoming function on first insert * @param[out] out the function added (which may be a metafunction) * @returns true on success */ -bool builtin_addfunctiontodict(dictionary *dict, value name, value fn, value *out) { +bool builtin_addfunctiontodict(dictionary *dict, value name, value fn, bool forcewrap, value *out) { bool success=false; - value entry=fn; // Dictionary entry for this name + value entry=MORPHO_NIL, prev=MORPHO_NIL, incoming=fn; value selector = dictionary_intern(&builtin_symboltable, name); // Use interned name - - if (dictionary_get(dict, selector, &entry)) { // There was an existing function - if (MORPHO_ISBUILTINFUNCTION(entry)) { // It was a builtinfunction, so we need to create a metafunction - if (builtin_getparentclass(fn) != - MORPHO_GETBUILTINFUNCTION(entry)->klass) { // Override superclass methods for now - dictionary_insert(dict, selector, fn); - } else if (metafunction_wrap(name, entry, &entry)) { // Wrap the old definition in a metafunction - - builtin_bindobject(MORPHO_GETOBJECT(entry)); - metafunction_add(MORPHO_GETMETAFUNCTION(entry), fn); // Add the new definition - success=dictionary_insert(dict, selector, entry); - } - } else if (MORPHO_ISMETAFUNCTION(entry)) { // It was already a metafunction so simply add the new function - success=metafunction_add(MORPHO_GETMETAFUNCTION(entry), fn); + objectclass *klass = builtin_getparentclass(fn); + + if (dictionary_get(dict, selector, &prev) && klass != builtin_getparentclass(prev)) { // Override superclass methods for now + entry=fn; + success=dictionary_insert(dict, selector, entry); + } else { + if (MORPHO_ISNIL(prev) && forcewrap) { + if (!metafunction_wrap(name, fn, &incoming)) return false; } - } else success=dictionary_insert(dict, selector, fn); + + success=metafunction_merge(name, prev, incoming, klass, &entry); + if (success && MORPHO_ISMETAFUNCTION(entry)) { + metafunction_setclass(MORPHO_GETMETAFUNCTION(entry), klass); + if (!MORPHO_ISSAME(prev, entry)) builtin_bindobject(MORPHO_GETOBJECT(entry)); + } + if (success) success=dictionary_insert(dict, selector, entry); + } if (success && out) *out = entry; @@ -300,7 +302,7 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built value newfn = MORPHO_OBJECT(new); - if (!builtin_addfunctiontodict(_currentfunctiontable, new->name, newfn, NULL)) { + if (!builtin_addfunctiontodict(_currentfunctiontable, new->name, newfn, signature!=NULL, NULL)) { UNREACHABLE("Redefinition of function in same extension [in builtin.c]"); } @@ -384,7 +386,7 @@ bool morpho_addclass(char *name, builtinclassentry desc[], int nparents, value * builtin_bindobject((object *) newmethod); - builtin_addfunctiontodict(&new->methods, newmethod->name, method, NULL); + builtin_addfunctiontodict(&new->methods, newmethod->name, method, desc[i].signature!=NULL, NULL); } } diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index c98518d11..7f5fa2ba8 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -95,6 +95,44 @@ bool metafunction_wrap(value name, value fn, value *out) { return true; } +/** Merges an incoming callable into an existing entry. + * @param[in] name name of the callable + * @param[in] existing the existing dictionary entry + * @param[in] incoming the callable to merge into the entry + * @param[in] klass owner class; if non-NULL, an existing metafunction must either be unowned or already belong to this class + * @param[out] out the merged entry + * @returns true on success */ +bool metafunction_merge(value name, value existing, value incoming, objectclass *klass, value *out) { + value entry=existing; + + if (MORPHO_ISNIL(entry)) { + *out=incoming; + return true; + } + + if (!MORPHO_ISMETAFUNCTION(entry)) { + if (!metafunction_wrap(name, entry, &entry)) return false; + } + + objectmetafunction *dest = MORPHO_GETMETAFUNCTION(entry); + if (klass) { + if (dest->klass && dest->klass!=klass) return false; + dest->klass=klass; + } + + if (MORPHO_ISMETAFUNCTION(incoming)) { + objectmetafunction *src = MORPHO_GETMETAFUNCTION(incoming); + for (int i=0; ifns.count; i++) { + if (!metafunction_add(dest, src->fns.data[i])) return false; + } + } else { + if (!metafunction_add(dest, incoming)) return false; + } + + *out=entry; + return true; +} + /** Adds a function to a metafunction */ bool metafunction_add(objectmetafunction *f, value fn) { if (f->state==METAFUNCTION_FROZEN) { diff --git a/src/classes/metafunction.h b/src/classes/metafunction.h index 92adf1aec..9e1a7196b 100644 --- a/src/classes/metafunction.h +++ b/src/classes/metafunction.h @@ -71,6 +71,7 @@ objectmetafunction *object_newmetafunction(value name); objectmetafunction *metafunction_clone(objectmetafunction *f); bool metafunction_wrap(value name, value fn, value *out); +bool metafunction_merge(value name, value existing, value incoming, objectclass *klass, value *out); bool metafunction_add(objectmetafunction *f, value fn); void metafunction_setclass(objectmetafunction *f, objectclass *klass); diff --git a/src/core/compile.c b/src/core/compile.c index 7d17a3383..a4fc87a1b 100644 --- a/src/core/compile.c +++ b/src/core/compile.c @@ -1558,20 +1558,14 @@ void compiler_functionreffreeatscope(compiler *c, unsigned int scope) { } void _addmatchingfunctionref(compiler *c, value symbol, value fn, value *out) { - value in = *out; - if (MORPHO_ISNIL(in)) { - // If the function has a signature, will need to wrap in a metafunction - if (MORPHO_ISFUNCTION(fn) && function_hastypedparameters(MORPHO_GETFUNCTION(fn))) { - if (metafunction_wrap(symbol, fn, out)) { - program_bindobject(c->out, MORPHO_GETOBJECT(*out)); - } - } else *out=fn; - } else if (MORPHO_ISFUNCTION(in)) { - if (metafunction_wrap(symbol, in, out)) { metafunction_add(MORPHO_GETMETAFUNCTION(*out), fn); - program_bindobject(c->out, MORPHO_GETOBJECT(*out)); - } - } else if (MORPHO_ISMETAFUNCTION(in)) { - metafunction_add(MORPHO_GETMETAFUNCTION(in), fn); + value prev = *out, incoming = fn; + + if (MORPHO_ISNIL(prev) && MORPHO_ISFUNCTION(fn) && function_hastypedparameters(MORPHO_GETFUNCTION(fn))) { + if (!metafunction_wrap(symbol, fn, &incoming)) return; + } + + if (metafunction_merge(symbol, prev, incoming, NULL, out) && MORPHO_ISMETAFUNCTION(*out) && !MORPHO_ISSAME(prev, *out)) { + program_bindobject(c->out, MORPHO_GETOBJECT(*out)); } } diff --git a/test/string/err_split_args.morpho b/test/string/err_split_args.morpho new file mode 100644 index 000000000..011f0ceb8 --- /dev/null +++ b/test/string/err_split_args.morpho @@ -0,0 +1,4 @@ +// Split requires a separator argument + +print "Hello world".split() +// expect error 'MltplDsptchFld' From 5bc9df836e9cd83548d6bdae60df4748c7e3da28 Mon Sep 17 00:00:00 2001 From: James <101812526+WoodchuckXL@users.noreply.github.com> Date: Wed, 17 Jun 2026 12:36:11 -0400 Subject: [PATCH 464/473] Add substring fn to string class --- src/classes/strng.c | 31 ++++++++++++++++++++++++++++++- src/classes/strng.h | 1 + test/string/substring.morpho | 14 ++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 test/string/substring.morpho diff --git a/src/classes/strng.c b/src/classes/strng.c index 2d1ca6991..a30c3b626 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -176,6 +176,7 @@ int string_countchars(objectstring *s) { /** Get a pointer to the i'th character of a string */ char *string_index(objectstring *s, int i) { + if (i<0) return NULL; int n=0; for (char *c = s->string; *c!='\0'; ) { if (i==n) return (char *) c; @@ -288,6 +289,33 @@ value String_split(vm *v, int nargs, value *args) { return out; } +/** Gets a substring of the string */ +value String_substring(vm *v, int nargs, value *args) { + objectstring *slf = MORPHO_GETSTRING(MORPHO_SELF(args)); + value out=MORPHO_NIL; + int begin=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + int end=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 1)); + + if (end<0 || (begin>=slf->length && begin>0) || end-begin<0) { + out=MORPHO_OBJECT(object_stringwithsize(0)); + } else { + begin=(begin<0) ? 0 : begin; + end=(end>slf->length) ? slf->length : end; + char *cstr = string_index(slf, begin); + + // Get size in bytes of the chars to include + char *cstrend = cstr; + for (int i = 0; i Date: Wed, 17 Jun 2026 14:41:55 -0400 Subject: [PATCH 465/473] Fix string negative indexing --- src/classes/strng.c | 17 ++++++++++++++++- test/string/index_neg.morpho | 5 +++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 test/string/index_neg.morpho diff --git a/src/classes/strng.c b/src/classes/strng.c index 2d1ca6991..70bbaf028 100644 --- a/src/classes/strng.c +++ b/src/classes/strng.c @@ -176,6 +176,7 @@ int string_countchars(objectstring *s) { /** Get a pointer to the i'th character of a string */ char *string_index(objectstring *s, int i) { + if (i<0) return NULL; int n=0; for (char *c = s->string; *c!='\0'; ) { if (i==n) return (char *) c; @@ -219,6 +220,20 @@ value String_clone(vm *v, int nargs, value *args) { return out; } +/** Gets a specified character from a string */ +value String_getindex(vm *v, int nargs, value *args) { + objectstring *slf = MORPHO_GETSTRING(MORPHO_SELF(args)); + value out=MORPHO_NIL; + int n=MORPHO_GETINTEGERVALUE(MORPHO_GETARG(args, 0)); + + char *c = string_index(slf, n); + if (c) { + out=object_stringfromcstring(c, morpho_utf8numberofbytes(c)); + morpho_bindobjects(v, 1, &out); + } else morpho_runtimeerror(v, VM_OUTOFBOUNDS); + return out; +} + /** Enumerate members of a string */ value String_enumerate(vm *v, int nargs, value *args) { objectstring *slf = MORPHO_GETSTRING(MORPHO_SELF(args)); @@ -292,7 +307,7 @@ MORPHO_BEGINCLASS(String) MORPHO_METHOD_SIGNATURE(MORPHO_COUNT_METHOD, "Int ()", String_count, MORPHO_FN_PUREFN), MORPHO_METHOD_SIGNATURE(MORPHO_PRINT_METHOD, "String ()", String_print, MORPHO_FN_IO), MORPHO_METHOD_SIGNATURE(MORPHO_CLONE_METHOD, "String ()", String_clone, MORPHO_FN_PUREFN|MORPHO_FN_ALLOCATES), -MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "(Int)", String_enumerate, MORPHO_FN_THROWS), +MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "String (Int)", String_getindex, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_GETINDEX_METHOD, "Nil (...)", String_enumerate__err, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "(Int)", String_enumerate, MORPHO_FN_THROWS), MORPHO_METHOD_SIGNATURE(MORPHO_ENUMERATE_METHOD, "Nil (...)", String_enumerate__err, MORPHO_FN_THROWS), diff --git a/test/string/index_neg.morpho b/test/string/index_neg.morpho new file mode 100644 index 000000000..c58dee6ee --- /dev/null +++ b/test/string/index_neg.morpho @@ -0,0 +1,5 @@ +var s = "Hello" + +print s[-1] +// expect Error 'IndxBnds' + From 2c5479e7891edc2f9aae1f0daaa4555c9b60d22f Mon Sep 17 00:00:00 2001 From: James <101812526+WoodchuckXL@users.noreply.github.com> Date: Thu, 18 Jun 2026 16:34:11 -0400 Subject: [PATCH 466/473] Forced metafunction resolver to check arity on monoarity functions --- src/classes/metafunction.c | 12 ++++++++++-- test/matrix/identity.morpho | 2 +- test/string/err_split_args2.morpho | 3 +++ test/string/err_split_args3.morpho | 4 ++++ test/string/err_split_args4.morpho | 5 +++++ 5 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 test/string/err_split_args2.morpho create mode 100644 test/string/err_split_args3.morpho create mode 100644 test/string/err_split_args4.morpho diff --git a/src/classes/metafunction.c b/src/classes/metafunction.c index 7f5fa2ba8..310992036 100644 --- a/src/classes/metafunction.c +++ b/src/classes/metafunction.c @@ -1175,6 +1175,14 @@ static bool mfcompiler_emitresolver(mfcompiler *compiler, int nresolutions, mfco exactpath.knownarity = resolutions[0].nparams; exactpath.aritychecked = true; path = &exactpath; + + // Add a sparse to verify that nargs matches the known arity + mfindx deflt; + mfcompiler_emitfail(compiler, &deflt); + mfcompilersparseentry correctarity; + correctarity.value = path->knownarity; + ERR_CHECK_RETURN(mfcompiler_emitresolver(compiler, nresolutions, resolutions, path, &correctarity.target)); + return mfcompiler_emitsparse(compiler, 1, &correctarity, deflt, entry); } /* For exact arity without typed params, emit the lone fixed-arity winner. */ @@ -1298,7 +1306,7 @@ void metafunction_disassemble(objectmetafunction *fn) { static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *args, error *err, value *out) { mfinstruction *instructions = fn->resolver.data; if (!instructions) return metafunction_resolveslow(fn, nargs, args, err, out); - + mfindx pc = fn->entry; int reg = nargs; // Single register initialized with nargs @@ -1307,7 +1315,7 @@ static bool metafunction_runresolver(objectmetafunction *fn, int nargs, value *a case MFOP_SLOW: return metafunction_resolveslow(fn, nargs, args, err, out); case MFOP_RESOLVE: { - pc++; *out=fn->fns.data[instructions[pc]]; + *out=fn->fns.data[instructions[++pc]]; return true; } case MFOP_FAIL: diff --git a/test/matrix/identity.morpho b/test/matrix/identity.morpho index ba47e170c..be369c82f 100644 --- a/test/matrix/identity.morpho +++ b/test/matrix/identity.morpho @@ -12,4 +12,4 @@ print a // expect: [ 0 0 1 ] a = IdentityMatrix() -// expect error 'MtrxIdnttyCns' +// expect error 'MltplDsptchFld' diff --git a/test/string/err_split_args2.morpho b/test/string/err_split_args2.morpho new file mode 100644 index 000000000..443c078de --- /dev/null +++ b/test/string/err_split_args2.morpho @@ -0,0 +1,3 @@ + +print "Hello world".split(2) +// expect error 'MltplDsptchFld' diff --git a/test/string/err_split_args3.morpho b/test/string/err_split_args3.morpho new file mode 100644 index 000000000..8e0cd01f8 --- /dev/null +++ b/test/string/err_split_args3.morpho @@ -0,0 +1,4 @@ +// You can not add extra arguments to a function + +print "Hello world".split(" ", 2) +// expect error 'MltplDsptchFld' diff --git a/test/string/err_split_args4.morpho b/test/string/err_split_args4.morpho new file mode 100644 index 000000000..a20dc5a9c --- /dev/null +++ b/test/string/err_split_args4.morpho @@ -0,0 +1,5 @@ +print "Hello world".split(" ") +// expect: [ Hello, world ] + +print "Hello world".split() +// expect error 'MltplDsptchFld' From 421592bcefef11caad28371130b23d826afcfec4 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Thu, 18 Jun 2026 18:25:35 -0400 Subject: [PATCH 467/473] Generate errors if normal() and tangent() are used on incorrect grades --- src/geometry/functional.c | 12 ++++++++++++ src/geometry/functional.h | 6 ++++++ test/functionals/areaintegral/tangent.morpho | 9 +++++++++ test/functionals/lineintegral/normal.morpho | 12 ++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 test/functionals/areaintegral/tangent.morpho create mode 100644 test/functionals/lineintegral/normal.morpho diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 37fa4283d..7b855a8c8 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -4328,6 +4328,10 @@ int tangenthandle; // TL storage handle for tangent vectors void integral_evaluatetangent(vm *v, value *out) { objectintegralelementref *elref = integral_getelementref(v); if (!elref) { morpho_runtimeerror(v, INTEGRAL_SPCLFN, TANGENT_FUNCTION); return; } + if (elref->g!=1) { + morpho_runtimeerror(v, TNGNT_GRD); + return; + } int dim = elref->mesh->dim; @@ -4366,9 +4370,14 @@ void integral_evaluatenormal(vm *v, value *out) { objectintegralelementref *elref = integral_getelementref(v); if (!elref) { morpho_runtimeerror(v, INTEGRAL_SPCLFN, NORMAL_FUNCTION); return; } + if (elref->g!=2) { + morpho_runtimeerror(v, NRML_GRD); + return; + } int dim = elref->mesh->dim; double s0[dim], s1[dim]; + objectmatrix *mnormal = matrix_new(dim, 1, false); if (!mnormal) { morpho_runtimeerror(v, ERROR_ALLOCATIONFAILED); @@ -6228,6 +6237,9 @@ void functional_initialize(void) { morpho_defineerror(INTEGRAL_HSSEVL, ERROR_HALT, INTEGRAL_HSSEVL_MSG); morpho_defineerror(JUMP_UNIMPL, ERROR_HALT, JUMP_UNIMPL_MSG); + morpho_defineerror(NRML_GRD, ERROR_HALT, NRML_GRD_MSG); + morpho_defineerror(TNGNT_GRD, ERROR_HALT, TNGNT_GRD_MSG); + functional_poolinitialized = false; objectintegralelementreftype=object_addtype(&objectintegralelementrefdefn); diff --git a/src/geometry/functional.h b/src/geometry/functional.h index d199022db..f5dc3b3f5 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -142,6 +142,12 @@ #define VOLUMEINTEGRAL_ARGS "VolIntArgs" #define VOLUMEINTEGRAL_ARGS_MSG "VolumeIntegral requires a callable argument, followed by zero or more Fields." +#define NRML_GRD "NormlGrade" +#define NRML_GRD_MSG "Normal can only be used on elements of grade 2." + +#define TNGNT_GRD "TngntGrade" +#define TNGNT_GRD_MSG "Tangent can only be used on elements of grade 1." + #define VOLUMEENCLOSED_ZERO "VolEnclZero" #define VOLUMEENCLOSED_ZERO_MSG "VolumeEnclosed detected an element of zero size. Check that a mesh point is not coincident with the origin." diff --git a/test/functionals/areaintegral/tangent.morpho b/test/functionals/areaintegral/tangent.morpho new file mode 100644 index 000000000..c30f8c5ab --- /dev/null +++ b/test/functionals/areaintegral/tangent.morpho @@ -0,0 +1,9 @@ +import constants +import meshtools + +var m = AreaMesh(fn (x,y) [x,y,0], 0..1:0.5, 0..1:0.5) + +var f = Field(m, fn (x,y,z) Matrix([0,0,1])) + +print AreaIntegral(fn (x, n) n.inner(tangent())^2 , f).total(m) +// expect error 'TngntGrade' diff --git a/test/functionals/lineintegral/normal.morpho b/test/functionals/lineintegral/normal.morpho new file mode 100644 index 000000000..99c51ff09 --- /dev/null +++ b/test/functionals/lineintegral/normal.morpho @@ -0,0 +1,12 @@ +import constants +import meshtools + +var m = LineMesh(fn (t) [cos(t),sin(t),0], 0..Pi:Pi/10) + +var nn = Field(m, fn (x,y,z) Matrix([1,0,0])) + +// A line integral with a element call +var lc = LineIntegral(fn (x, n) (n.inner(normal()))^2, nn) + +print lc.integrand(m) +// expect error 'NormlGrade' \ No newline at end of file From 196514fc363a966e80ba2e80fd107da342a1a429 Mon Sep 17 00:00:00 2001 From: James <101812526+WoodchuckXL@users.noreply.github.com> Date: Wed, 24 Jun 2026 10:52:31 -0400 Subject: [PATCH 468/473] Make import keyword change working directory during external compilation --- src/classes/file.c | 13 +++++++++++++ src/classes/file.h | 3 ++- src/core/compile.c | 15 +++++++++++++++ test/import/folder.morpho | 5 +++++ test/import/folder/folder.m | 3 +++ test/import/folder/inner_target.m | 3 +++ 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 test/import/folder.morpho create mode 100644 test/import/folder/folder.m create mode 100644 test/import/folder/inner_target.m diff --git a/src/classes/file.c b/src/classes/file.c index 551c5db6c..70bcfd516 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -110,6 +110,19 @@ void file_setworkingdirectory(const char *path) { } } +/** Gets the global current working directory (relative to the filing systems cwd. + * @param[out] path - path to working directory. */ +void file_getworkingdirectory(varray_char *path) +{ + if (workingdir.count>0) { + for (unsigned int i=0; iout->code.count; @@ -4841,6 +4851,11 @@ static codeinfo compiler_import(compiler *c, syntaxtreenode *node, registerindx debugannotation_setmodule(&c->out->annotations, compiler_getmodule(c)); end=c->out->code.count; + + /* Restore old working directory */ + file_setworkingdirectory(wrkdir.data); + varray_charclear(&wrkdir); + varray_charclear(&fpath); compiler_clear(&cc); varray_charclear(&src); diff --git a/test/import/folder.morpho b/test/import/folder.morpho new file mode 100644 index 000000000..8d741849a --- /dev/null +++ b/test/import/folder.morpho @@ -0,0 +1,5 @@ +import "folder/folder.m" +// expect: Folder import + +folderfn("Hello world") +// expect: Hello world diff --git a/test/import/folder/folder.m b/test/import/folder/folder.m new file mode 100644 index 000000000..103eb03f6 --- /dev/null +++ b/test/import/folder/folder.m @@ -0,0 +1,3 @@ +import "inner_target.m" + +print "Folder import" diff --git a/test/import/folder/inner_target.m b/test/import/folder/inner_target.m new file mode 100644 index 000000000..871e2888b --- /dev/null +++ b/test/import/folder/inner_target.m @@ -0,0 +1,3 @@ +fn folderfn(message) { + print message +} \ No newline at end of file From 6da93942a187a7857f75bcc99c7cc5d56bd06a3e Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Sun, 28 Jun 2026 11:15:33 -0400 Subject: [PATCH 469/473] New functional_start entry point used to precompute mesh connectivity --- src/geometry/functional.c | 153 ++++++++++++++++++++++++++++++-------- src/geometry/functional.h | 59 +++++++++++---- 2 files changed, 163 insertions(+), 49 deletions(-) diff --git a/src/geometry/functional.c b/src/geometry/functional.c index 7b855a8c8..3bb202de1 100644 --- a/src/geometry/functional.c +++ b/src/geometry/functional.c @@ -32,6 +32,7 @@ value functional_fieldproperty; typedef struct jumpref_s jumpref; static bool jump_getadjacentparents(jumpref *ref, elementid interfaceid, int *nparents, int **parents); +static bool jump_startfn(vm *v, functional_mapinfo *info); static void jump_orderparents(int *parents, elementid *plusid, elementid *minusid); /* ********************************************************************** @@ -64,6 +65,8 @@ static void functional_clearmapinfo(functional_mapinfo *info) { info->id=0; info->integrand=NULL; info->grad=NULL; + info->fieldgrad=NULL; + info->start=NULL; info->dependencies=NULL; info->cloneref=NULL; info->freeref=NULL; @@ -98,6 +101,11 @@ bool functional_validateargs(vm *v, int nargs, value *args, functional_mapinfo * return false; } +bool functional_startmap(vm *v, functional_mapinfo *info) { + if (!info->start) return true; + return (*info->start) (v, info); +} + /* ********************************************************************** * Common routines @@ -3431,6 +3439,45 @@ typedef struct { grade grade; } fieldref; +static bool functional_preparefespacefield(objectfield *field, grade g) { + if (!field || !MORPHO_ISFESPACE(field->fnspc)) return true; + + fespace *disc = MORPHO_GETFESPACE(field->fnspc)->fespace; + if (ggrade) { + if (!fespace_lower(disc, g, &disc)) return false; + } + + objectsparse *conn = mesh_getconnectivityelement(field->mesh, 0, disc->grade); + if (!conn) conn = mesh_addconnectivityelement(field->mesh, 0, disc->grade); + if (!conn) return false; + + for (grade i=0; i<=disc->grade; i++) { + objectsparse *vmatrix = mesh_addconnectivityelement(field->mesh, i, 0); + if (!vmatrix && i>0 && disc->shape[i]>0) { + if (!mesh_addgrade(field->mesh, i)) return false; + vmatrix = mesh_addconnectivityelement(field->mesh, i, 0); + } + if (!vmatrix && i>0 && disc->shape[i]>0) return false; + } + + return true; +} + +static bool functional_preparefieldlist(value *fields, int nfields, grade g) { + for (int i=0; iref; + return functional_preparefespacefield(ref->field, info->g); +} + /* ---------------------------------------------- * GradSq * ---------------------------------------------- */ @@ -3649,11 +3696,11 @@ value GradSq_init(vm *v, int nargs, value *args) { return MORPHO_NIL; } -FUNCTIONAL_METHOD(GradSq, integrand, (ref.grade), fieldref, gradsq_prepareref, functional_mapintegrand, gradsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(GradSq, integrand, (ref.grade), fieldref, gradsq_prepareref, fieldref_startfn, functional_mapintegrand, gradsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(GradSq, total, (ref.grade), fieldref, gradsq_prepareref, functional_sumintegrand, gradsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(GradSq, total, (ref.grade), fieldref, gradsq_prepareref, fieldref_startfn, functional_sumintegrand, gradsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(GradSq, gradient, (ref.grade), fieldref, gradsq_prepareref, functional_mapnumericalgradient, gradsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_ADD); +FUNCTIONAL_METHOD_START(GradSq, gradient, (ref.grade), fieldref, gradsq_prepareref, fieldref_startfn, functional_mapnumericalgradient, gradsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_ADD); value GradSq_fieldgradient(vm *v, int nargs, value *args) { functional_mapinfo info; @@ -3665,9 +3712,10 @@ value GradSq_fieldgradient(vm *v, int nargs, value *args) { info.g = ref.grade; info.field = ref.field; info.integrand = gradsq_integrand; + info.start = fieldref_startfn; info.cloneref = gradsq_cloneref; info.ref = &ref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); //functional_mapfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, GRADSQ_ARGS); } @@ -3699,6 +3747,12 @@ typedef struct { grade grade; } nematicref; +static bool nematic_startfn(vm *v, functional_mapinfo *info) { + (void) v; + nematicref *ref = (nematicref *) info->ref; + return functional_preparefespacefield(ref->field, info->g); +} + /** Prepares the nematic reference */ bool nematic_prepareref(objectinstance *self, objectmesh *mesh, grade g, objectselection *sel, nematicref *ref) { bool success=false, grdset=false; @@ -3896,11 +3950,11 @@ value Nematic_init(vm *v, int nargs, value *args) { return MORPHO_NIL; } -FUNCTIONAL_METHOD(Nematic, integrand, (ref.grade), nematicref, nematic_prepareref, functional_mapintegrand, nematic_integrand, NULL, NEMATIC_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(Nematic, integrand, (ref.grade), nematicref, nematic_prepareref, nematic_startfn, functional_mapintegrand, nematic_integrand, NULL, NEMATIC_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(Nematic, total, (ref.grade), nematicref, nematic_prepareref, functional_sumintegrand, nematic_integrand, NULL, NEMATIC_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(Nematic, total, (ref.grade), nematicref, nematic_prepareref, nematic_startfn, functional_sumintegrand, nematic_integrand, NULL, NEMATIC_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(Nematic, gradient, (ref.grade), nematicref, nematic_prepareref, functional_mapnumericalgradient, nematic_integrand, NULL, NEMATIC_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(Nematic, gradient, (ref.grade), nematicref, nematic_prepareref, nematic_startfn, functional_mapnumericalgradient, nematic_integrand, NULL, NEMATIC_ARGS, SYMMETRY_NONE); value Nematic_fieldgradient(vm *v, int nargs, value *args) { functional_mapinfo info; @@ -3911,9 +3965,10 @@ value Nematic_fieldgradient(vm *v, int nargs, value *args) { if (nematic_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, MESH_GRADE_AREA, info.sel, &ref)) { info.g=ref.grade; info.integrand=nematic_integrand; + info.start=nematic_startfn; info.ref=&ref; info.cloneref=nematic_cloneref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, GRADSQ_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -3938,6 +3993,17 @@ typedef struct { grade grade; } nematicelectricref; +static bool nematicelectric_startfn(vm *v, functional_mapinfo *info) { + (void) v; + nematicelectricref *ref = (nematicelectricref *) info->ref; + + if (!functional_preparefespacefield(ref->director, info->g)) return false; + if (MORPHO_ISFIELD(ref->field) && + !functional_preparefespacefield(MORPHO_GETFIELD(ref->field), info->g)) return false; + + return true; +} + /** Prepares the nematicelectric reference */ bool nematicelectric_prepareref(objectinstance *self, objectmesh *mesh, grade g, objectselection *sel, nematicelectricref *ref) { bool success=false, grdset=false; @@ -4042,11 +4108,11 @@ value NematicElectric_init(vm *v, int nargs, value *args) { return MORPHO_NIL; } -FUNCTIONAL_METHOD(NematicElectric, integrand, (ref.grade), nematicelectricref, nematicelectric_prepareref, functional_mapintegrand, nematicelectric_integrand, NULL, FUNCTIONAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(NematicElectric, integrand, (ref.grade), nematicelectricref, nematicelectric_prepareref, nematicelectric_startfn, functional_mapintegrand, nematicelectric_integrand, NULL, FUNCTIONAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(NematicElectric, total, (ref.grade), nematicelectricref, nematicelectric_prepareref, functional_sumintegrand, nematicelectric_integrand, NULL, FUNCTIONAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(NematicElectric, total, (ref.grade), nematicelectricref, nematicelectric_prepareref, nematicelectric_startfn, functional_sumintegrand, nematicelectric_integrand, NULL, FUNCTIONAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(NematicElectric, gradient, (ref.grade), nematicelectricref, nematicelectric_prepareref, functional_mapnumericalgradient, nematicelectric_integrand, NULL, FUNCTIONAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(NematicElectric, gradient, (ref.grade), nematicelectricref, nematicelectric_prepareref, nematicelectric_startfn, functional_mapnumericalgradient, nematicelectric_integrand, NULL, FUNCTIONAL_ARGS, SYMMETRY_NONE); value NematicElectric_fieldgradient(vm *v, int nargs, value *args) { functional_mapinfo info; @@ -4057,9 +4123,10 @@ value NematicElectric_fieldgradient(vm *v, int nargs, value *args) { if (nematicelectric_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, MESH_GRADE_AREA, info.sel, &ref)) { info.g=ref.grade; info.integrand=nematicelectric_integrand; + info.start=nematicelectric_startfn; info.cloneref=nematicelectric_cloneref; info.ref=&ref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, GRADSQ_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -4092,11 +4159,11 @@ bool normsq_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int *vid, v return false; } -FUNCTIONAL_METHOD(NormSq, integrand, MESH_GRADE_VERTEX, fieldref, gradsq_prepareref, functional_mapintegrand, normsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(NormSq, integrand, MESH_GRADE_VERTEX, fieldref, gradsq_prepareref, fieldref_startfn, functional_mapintegrand, normsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(NormSq, total, MESH_GRADE_VERTEX, fieldref, gradsq_prepareref, functional_sumintegrand, normsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(NormSq, total, MESH_GRADE_VERTEX, fieldref, gradsq_prepareref, fieldref_startfn, functional_sumintegrand, normsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(NormSq, gradient, MESH_GRADE_VERTEX, fieldref, gradsq_prepareref, functional_mapnumericalgradient, normsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(NormSq, gradient, MESH_GRADE_VERTEX, fieldref, gradsq_prepareref, fieldref_startfn, functional_mapnumericalgradient, normsq_integrand, NULL, GRADSQ_ARGS, SYMMETRY_NONE); value NormSq_fieldgradient(vm *v, int nargs, value *args) { functional_mapinfo info; @@ -4109,8 +4176,9 @@ value NormSq_fieldgradient(vm *v, int nargs, value *args) { info.ref=&ref; info.field=ref.field; info.integrand=normsq_integrand; + info.start=fieldref_startfn; info.cloneref=gradsq_cloneref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, GRADSQ_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -4145,6 +4213,12 @@ typedef struct { bool weightbyref; // Use reference mesh for the element } integralref; +static bool integral_startfn(vm *v, functional_mapinfo *info) { + (void) v; + integralref *ref = (integralref *) info->ref; + return functional_preparefieldlist(ref->fields, ref->nfields, info->g); +} + typedef struct jumpref_s jumpref; typedef enum { @@ -5170,13 +5244,13 @@ bool lineintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * return success; } -FUNCTIONAL_METHOD(LineIntegral, integrand, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapintegrand, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(LineIntegral, integrand, MESH_GRADE_LINE, integralref, integral_prepareref, integral_startfn, functional_mapintegrand, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(LineIntegral, total, MESH_GRADE_LINE, integralref, integral_prepareref, functional_sumintegrand, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(LineIntegral, total, MESH_GRADE_LINE, integralref, integral_prepareref, integral_startfn, functional_sumintegrand, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(LineIntegral, gradient, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapnumericalgradient, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(LineIntegral, gradient, MESH_GRADE_LINE, integralref, integral_prepareref, integral_startfn, functional_mapnumericalgradient, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(LineIntegral, hessian, MESH_GRADE_LINE, integralref, integral_prepareref, functional_mapnumericalhessian, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE) +FUNCTIONAL_METHOD_START(LineIntegral, hessian, MESH_GRADE_LINE, integralref, integral_prepareref, integral_startfn, functional_mapnumericalhessian, lineintegral_integrand, NULL, LINEINTEGRAL_ARGS, SYMMETRY_NONE) /** Initialize a LineIntegral object */ value LineIntegral_init(vm *v, int nargs, value *args) { @@ -5252,10 +5326,11 @@ value LineIntegral_fieldgradient(vm *v, int nargs, value *args) { if (integral_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, MESH_GRADE_LINE, info.sel, &ref)) { info.g=MESH_GRADE_LINE; info.integrand=lineintegral_integrand; + info.start=integral_startfn; info.cloneref=integral_cloneref; info.freeref=integral_freeref; info.ref=&ref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, LINEINTEGRAL_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -5352,11 +5427,11 @@ bool areaintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int * return success; } -FUNCTIONAL_METHOD(AreaIntegral, integrand, MESH_GRADE_AREA, integralref, integral_prepareref, functional_mapintegrand, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(AreaIntegral, integrand, MESH_GRADE_AREA, integralref, integral_prepareref, integral_startfn, functional_mapintegrand, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(AreaIntegral, total, MESH_GRADE_AREA, integralref, integral_prepareref, functional_sumintegrand, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(AreaIntegral, total, MESH_GRADE_AREA, integralref, integral_prepareref, integral_startfn, functional_sumintegrand, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(AreaIntegral, gradient, MESH_GRADE_AREA, integralref, integral_prepareref, functional_mapnumericalgradient, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(AreaIntegral, gradient, MESH_GRADE_AREA, integralref, integral_prepareref, integral_startfn, functional_mapnumericalgradient, areaintegral_integrand, NULL, AREAINTEGRAL_ARGS, SYMMETRY_NONE); /** Field gradients for Area Integrals */ value AreaIntegral_fieldgradient(vm *v, int nargs, value *args) { @@ -5369,10 +5444,11 @@ value AreaIntegral_fieldgradient(vm *v, int nargs, value *args) { if (integral_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, MESH_GRADE_AREA, info.sel, &ref)) { info.g=MESH_GRADE_AREA; info.integrand=areaintegral_integrand; + info.start=integral_startfn; info.cloneref=integral_cloneref; info.freeref=integral_freeref; info.ref=&ref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, AREAINTEGRAL_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -5463,11 +5539,11 @@ bool volumeintegral_integrand(vm *v, objectmesh *mesh, elementid id, int nv, int return success; } -FUNCTIONAL_METHOD(VolumeIntegral, integrand, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_mapintegrand, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(VolumeIntegral, integrand, MESH_GRADE_VOLUME, integralref, integral_prepareref, integral_startfn, functional_mapintegrand, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(VolumeIntegral, total, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_sumintegrand, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(VolumeIntegral, total, MESH_GRADE_VOLUME, integralref, integral_prepareref, integral_startfn, functional_sumintegrand, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); -FUNCTIONAL_METHOD(VolumeIntegral, gradient, MESH_GRADE_VOLUME, integralref, integral_prepareref, functional_mapnumericalgradient, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); +FUNCTIONAL_METHOD_START(VolumeIntegral, gradient, MESH_GRADE_VOLUME, integralref, integral_prepareref, integral_startfn, functional_mapnumericalgradient, volumeintegral_integrand, NULL, VOLUMEINTEGRAL_ARGS, SYMMETRY_NONE); /** Field gradients for Volume Integrals */ value VolumeIntegral_fieldgradient(vm *v, int nargs, value *args) { @@ -5480,10 +5556,11 @@ value VolumeIntegral_fieldgradient(vm *v, int nargs, value *args) { if (integral_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, MESH_GRADE_VOLUME, info.sel, &ref)) { info.g=MESH_GRADE_VOLUME; info.integrand=volumeintegral_integrand; + info.start=integral_startfn; info.cloneref=integral_cloneref; info.freeref=integral_freeref; info.ref=&ref; - functional_mapnumericalfieldgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalfieldgradient(v, &info, &out); } else morpho_runtimeerror(v, VOLUMEINTEGRAL_ARGS); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -5572,6 +5649,12 @@ static bool jump_prepareref(objectinstance *self, objectmesh *mesh, grade g, obj return jump_preparestrategy(ref); } +static bool jump_startfn(vm *v, functional_mapinfo *info) { + (void) v; + jumpref *ref = (jumpref *) info->ref; + return functional_preparefieldlist(ref->integral.fields, ref->integral.nfields, ref->parentgrade); +} + /** Clone a jump reference with a substituted field. */ static void *jump_cloneref(void *ref, objectfield *field, objectfield *sub) { jumpref *nref = (jumpref *) ref; @@ -6028,8 +6111,9 @@ static value Jump_integrand(vm *v, int nargs, value *args) { if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; + info.start=jump_startfn; info.ref=&ref; - functional_mapintegrand(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapintegrand(v, &info, &out); } else morpho_runtimeerror(v, JUMP_UNIMPL); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -6045,8 +6129,9 @@ static value Jump_total(vm *v, int nargs, value *args) { if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; + info.start=jump_startfn; info.ref=&ref; - functional_sumintegrand(v, &info, &out); + if (functional_startmap(v, &info)) functional_sumintegrand(v, &info, &out); } else morpho_runtimeerror(v, JUMP_UNIMPL); } @@ -6062,9 +6147,10 @@ static value Jump_gradient(vm *v, int nargs, value *args) { if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; + info.start=jump_startfn; info.dependencies=jump_dependencies; info.ref=&ref; - functional_mapnumericalgradient(v, &info, &out); + if (functional_startmap(v, &info)) functional_mapnumericalgradient(v, &info, &out); } else morpho_runtimeerror(v, JUMP_UNIMPL); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); @@ -6080,11 +6166,12 @@ static value Jump_fieldgradient(vm *v, int nargs, value *args) { if (jump_prepareref(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, 0, info.sel, &ref)) { info.g=ref.interfacegrade; info.integrand=jump_scan_integrand; + info.start=jump_startfn; info.dependencies=NULL; info.cloneref=jump_cloneref; info.freeref=jump_freeref; info.ref=&ref; - functional_mapjumpnumericalfieldgradient(v, &info, ref.parentvertices, &ref, &out); + if (functional_startmap(v, &info)) functional_mapjumpnumericalfieldgradient(v, &info, ref.parentvertices, &ref, &out); } else morpho_runtimeerror(v, JUMP_UNIMPL); } if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); diff --git a/src/geometry/functional.h b/src/geometry/functional.h index f5dc3b3f5..0a9673d8e 100644 --- a/src/geometry/functional.h +++ b/src/geometry/functional.h @@ -211,6 +211,9 @@ typedef bool (functional_fieldgradient) (vm *v, objectmesh *mesh, elementid id, struct s_functional_mapinfo; // Resolve circular typedef dependency +/** Optional start function called before a functional evaluation begins */ +typedef bool (functional_start) (vm *v, struct s_functional_mapinfo *info); + /** Clone reference function */ typedef void * (functional_cloneref) (void *ref, objectfield *field, objectfield *sub); @@ -229,6 +232,7 @@ typedef struct s_functional_mapinfo { functional_integrand *integrand; // Integrand function functional_gradient *grad; // Gradient functional_fieldgradient *fieldgrad; // Field gradient + functional_start *start; // Optional preflight hook functional_dependencies *dependencies; // Dependencies functional_cloneref *cloneref; // Clone a reference with a given field substituted functional_freeref *freeref; // Free a reference @@ -249,6 +253,7 @@ bool functional_mapgradient(vm *v, functional_mapinfo *info, value *out); bool functional_mapfieldgradient(vm *v, functional_mapinfo *info, value *out); bool functional_mapnumericalgradient(vm *v, functional_mapinfo *info, value *out); bool functional_mapnumericalfieldgradient(vm *v, functional_mapinfo *info, value *out); +bool functional_startmap(vm *v, functional_mapinfo *info); void functional_vecadd(unsigned int n, double *a, double *b, double *out); void functional_vecaddscale(unsigned int n, double *a, double lambda, double *b, double *out); @@ -274,26 +279,32 @@ bool functional_elementgradient(vm *v, objectmesh *mesh, grade g, elementid id, } /** Evaluate an integrand */ -#define FUNCTIONAL_INTEGRAND(name, grade, integrandfn) value name##_integrand(vm *v, int nargs, value *args) { \ +#define FUNCTIONAL_INTEGRAND(name, grade, integrandfn) \ + FUNCTIONAL_INTEGRAND_START(name, grade, NULL, integrandfn) + +#define FUNCTIONAL_INTEGRAND_START(name, grade, startfn, integrandfn) value name##_integrand(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ value out=MORPHO_NIL; \ \ if (functional_validateargs(v, nargs, args, &info)) { \ - info.g = grade; info.integrand = integrandfn; \ - functional_mapintegrand(v, &info, &out); \ + info.g = grade; info.start = startfn; info.integrand = integrandfn; \ + if (functional_startmap(v, &info)) functional_mapintegrand(v, &info, &out); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ return out; \ } /** Evaluate an integrand at an element */ -#define FUNCTIONAL_INTEGRANDFORELEMENT(name, grade, integrandfn) value name##_integrandForElement(vm *v, int nargs, value *args) { \ +#define FUNCTIONAL_INTEGRANDFORELEMENT(name, grade, integrandfn) \ + FUNCTIONAL_INTEGRANDFORELEMENT_START(name, grade, NULL, integrandfn) + +#define FUNCTIONAL_INTEGRANDFORELEMENT_START(name, grade, startfn, integrandfn) value name##_integrandForElement(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ value out=MORPHO_NIL; \ \ if (functional_validateargs(v, nargs, args, &info)) { \ - info.g = grade; info.integrand = integrandfn; \ - functional_mapintegrandforelement(v, &info, &out); \ + info.g = grade; info.start = startfn; info.integrand = integrandfn; \ + if (functional_startmap(v, &info)) functional_mapintegrandforelement(v, &info, &out); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ return out; \ @@ -301,13 +312,16 @@ bool functional_elementgradient(vm *v, objectmesh *mesh, grade g, elementid id, /** Evaluate a gradient */ #define FUNCTIONAL_GRADIENT(name, grade, gradientfn, symbhvr) \ + FUNCTIONAL_GRADIENT_START(name, grade, NULL, gradientfn, symbhvr) + +#define FUNCTIONAL_GRADIENT_START(name, grade, startfn, gradientfn, symbhvr) \ value name##_gradient(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ value out=MORPHO_NIL; \ \ if (functional_validateargs(v, nargs, args, &info)) { \ - info.g = grade; info.grad = gradientfn; info.sym = symbhvr; \ - functional_mapgradient(v, &info, &out); \ + info.g = grade; info.start = startfn; info.grad = gradientfn; info.sym = symbhvr; \ + if (functional_startmap(v, &info)) functional_mapgradient(v, &info, &out); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ \ @@ -316,13 +330,16 @@ value name##_gradient(vm *v, int nargs, value *args) { \ /** Evaluate a gradient */ #define FUNCTIONAL_NUMERICALGRADIENT(name, grade, integrandfn, symbhvr) \ + FUNCTIONAL_NUMERICALGRADIENT_START(name, grade, NULL, integrandfn, symbhvr) + +#define FUNCTIONAL_NUMERICALGRADIENT_START(name, grade, startfn, integrandfn, symbhvr) \ value name##_gradient(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ value out=MORPHO_NIL; \ \ if (functional_validateargs(v, nargs, args, &info)) { \ - info.g = grade; info.integrand = integrandfn; info.sym = symbhvr; \ - functional_mapnumericalgradient(v, &info, &out); \ + info.g = grade; info.start = startfn; info.integrand = integrandfn; info.sym = symbhvr; \ + if (functional_startmap(v, &info)) functional_mapnumericalgradient(v, &info, &out); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ \ @@ -331,13 +348,16 @@ value name##_gradient(vm *v, int nargs, value *args) { \ /** Total an integrand */ #define FUNCTIONAL_TOTAL(name, grade, totalfn) \ + FUNCTIONAL_TOTAL_START(name, grade, NULL, totalfn) + +#define FUNCTIONAL_TOTAL_START(name, grade, startfn, totalfn) \ value name##_total(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ value out=MORPHO_NIL; \ \ if (functional_validateargs(v, nargs, args, &info)) { \ - info.g = grade; info.integrand = totalfn; \ - functional_sumintegrand(v, &info, &out); \ + info.g = grade; info.start = startfn; info.integrand = totalfn; \ + if (functional_startmap(v, &info)) functional_sumintegrand(v, &info, &out); \ } \ \ return out; \ @@ -345,13 +365,16 @@ value name##_total(vm *v, int nargs, value *args) { \ /** Hessian */ #define FUNCTIONAL_HESSIAN(name, grade, totalfn) \ + FUNCTIONAL_HESSIAN_START(name, grade, NULL, totalfn) + +#define FUNCTIONAL_HESSIAN_START(name, grade, startfn, totalfn) \ value name##_hessian(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ value out=MORPHO_NIL; \ \ if (functional_validateargs(v, nargs, args, &info)) { \ - info.g = grade; info.integrand = totalfn; \ - functional_mapnumericalhessian(v, &info, &out); \ + info.g = grade; info.start = startfn; info.integrand = totalfn; \ + if (functional_startmap(v, &info)) functional_mapnumericalhessian(v, &info, &out); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ \ @@ -359,7 +382,10 @@ value name##_hessian(vm *v, int nargs, value *args) { \ } /* Alternative way of defining methods that use a reference */ -#define FUNCTIONAL_METHOD(class, name, grade, reftype, prepare, integrandfn, integrandmapfn, deps, err, symbhvr) value class##_##name(vm *v, int nargs, value *args) { \ +#define FUNCTIONAL_METHOD(class, name, grade, reftype, prepare, integrandfn, integrandmapfn, deps, err, symbhvr) \ + FUNCTIONAL_METHOD_START(class, name, grade, reftype, prepare, NULL, integrandfn, integrandmapfn, deps, err, symbhvr) + +#define FUNCTIONAL_METHOD_START(class, name, grade, reftype, prepare, startfn, integrandfn, integrandmapfn, deps, err, symbhvr) value class##_##name(vm *v, int nargs, value *args) { \ functional_mapinfo info; \ reftype ref; \ value out=MORPHO_NIL; \ @@ -367,11 +393,12 @@ value name##_hessian(vm *v, int nargs, value *args) { \ if (functional_validateargs(v, nargs, args, &info)) { \ if (prepare(MORPHO_GETINSTANCE(MORPHO_SELF(args)), info.mesh, grade, info.sel, &ref)) { \ info.integrand = integrandmapfn; \ + info.start = startfn; \ info.dependencies = deps, \ info.sym = symbhvr; \ info.g = grade; \ info.ref = &ref; \ - if (!integrandfn(v, &info, &out) && !morpho_checkerror(morpho_geterror(v))) morpho_runtimeerror(v, err); \ + if (functional_startmap(v, &info) && !integrandfn(v, &info, &out) && !morpho_checkerror(morpho_geterror(v))) morpho_runtimeerror(v, err); \ } else morpho_runtimeerror(v, err); \ } \ if (!MORPHO_ISNIL(out)) morpho_bindobjects(v, 1, &out); \ From a09a37c15984109831f0d60acaf5c2afa4b1cae0 Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 6 Jul 2026 10:46:02 -0400 Subject: [PATCH 470/473] Ensure metafunctions are frozen after loading an extension --- src/builtin/builtin.c | 19 +++++++++++++------ src/builtin/builtin.h | 1 + src/support/extensions.c | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/builtin/builtin.c b/src/builtin/builtin.c index 2341d2e5d..19e4b0d8b 100644 --- a/src/builtin/builtin.c +++ b/src/builtin/builtin.c @@ -320,6 +320,18 @@ bool morpho_addfunction(char *name, char *signature, builtinfunction func, built return false; } +/** Finalize any open metafunctions from the C objects list */ +bool builtin_finalizemetafunctions(void) { + error err; + error_init(&err); + if (!metafunction_finalizelist(builtin_objects, &err)) { + UNREACHABLE("Unable to finalize builtin metafunctions."); + } + error_clear(&err); + + return true; +} + /* ********************************************************************** * Create and find builtin classes * ********************************************************************** */ @@ -518,12 +530,7 @@ void builtin_initialize(void) { UNREACHABLE("Syntax error in signature."); } - error err; - error_init(&err); - if (!metafunction_finalizelist(builtin_objects, &err)) { - UNREACHABLE("Unable to finalize builtin metafunctions."); - } - error_clear(&err); + builtin_finalizemetafunctions(); morpho_addfinalizefn(builtin_finalize); } diff --git a/src/builtin/builtin.h b/src/builtin/builtin.h index c8b6d7901..ff5f5fc1a 100644 --- a/src/builtin/builtin.h +++ b/src/builtin/builtin.h @@ -148,6 +148,7 @@ value builtin_addfunction(char *name, builtinfunction func, builtinfunctionflags value builtin_findfunction(value name); bool morpho_addfunction(char *name, char *signature, builtinfunction func, builtinfunctionflags flags, value *out); +bool builtin_finalizemetafunctions(void); value builtin_addclass(char *name, builtinclassentry desc[], value superclass); value builtin_findclass(value name); diff --git a/src/support/extensions.c b/src/support/extensions.c index c6e3a4744..97747f1c3 100644 --- a/src/support/extensions.c +++ b/src/support/extensions.c @@ -143,7 +143,9 @@ bool extension_initialize(extension *e) { builtin_setfunctiontable(ofunc); builtin_setclasstable(oclss); - return success; + builtin_finalizemetafunctions(); + + return success; } /** Call the extension's finalizer */ From 2f3db313883740691ed26e78f04e20ee44d087ed Mon Sep 17 00:00:00 2001 From: softmattertheory Date: Mon, 6 Jul 2026 20:58:39 -0400 Subject: [PATCH 471/473] Fix metafunction compilation for extensions --- src/support/extensions.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/support/extensions.c b/src/support/extensions.c index 97747f1c3..15e5b3b8e 100644 --- a/src/support/extensions.c +++ b/src/support/extensions.c @@ -139,12 +139,12 @@ bool extension_initialize(extension *e) { builtin_setclasstable(MORPHO_GETDICTIONARYSTRUCT(e->classtable)); bool success=extension_call(e, MORPHO_GETCSTRING(e->name), MORPHO_EXTENSIONINITIALIZE); + if (success) success=builtin_parsesignatures(); + if (success) success=builtin_finalizemetafunctions(); builtin_setfunctiontable(ofunc); builtin_setclasstable(oclss); - - builtin_finalizemetafunctions(); - + return success; } @@ -168,7 +168,6 @@ bool extension_load(char *name, dictionary **functiontable, dictionary **classta } else if (extension_initwithname(&e, name, MORPHO_GETCSTRING(path)) && extension_dlopen(&e)) { success=extension_initialize(&e); - success &= builtin_parsesignatures(); if (success) varray_extensionwrite(&extensionlist, e); } From c25f96a6c70d9920cd9ed71c474de5415aebcadf Mon Sep 17 00:00:00 2001 From: Tim Atherton <54725421+softmattertheory@users.noreply.github.com> Date: Tue, 7 Jul 2026 10:27:26 -0400 Subject: [PATCH 472/473] Spelling fixes --- src/datastructures/dictionary.c | 2 +- src/datastructures/error.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datastructures/dictionary.c b/src/datastructures/dictionary.c index bd12ee7c6..fcad4328b 100644 --- a/src/datastructures/dictionary.c +++ b/src/datastructures/dictionary.c @@ -160,7 +160,7 @@ void dictionary_init(dictionary *dict) { /** @brief Clears a dictionary structure, freeing attached memory * @param dict the dictionary to clear - * @warning This doens't free keys or values in the dictionary. */ + * @warning This doesn't free keys or values in the dictionary. */ void dictionary_clear(dictionary *dict) { if (dict->contents) MORPHO_FREE(dict->contents); dictionary_init(dict); diff --git a/src/datastructures/error.h b/src/datastructures/error.h index 085fdb862..536f1cab0 100644 --- a/src/datastructures/error.h +++ b/src/datastructures/error.h @@ -162,7 +162,7 @@ void morpho_unreachable(const char *explanation); #define VM_INVALIDARGS_MSG "Expected %u arguments but got %u." #define VM_NOOPTARG "NoOptArg" -#define VM_NOOPTARG_MSG "Function doens't expect optional arguments." +#define VM_NOOPTARG_MSG "Function doesn't expect optional arguments." #define VM_UNKNWNOPTARG "UnkwnOptArg" #define VM_UNKNWNOPTARG_MSG "Unknown optional argument '%s'." From 16467d8a9e43ab0689b84ecc4ff3f7d0cd485ec3 Mon Sep 17 00:00:00 2001 From: James <101812526+WoodchuckXL@users.noreply.github.com> Date: Tue, 7 Jul 2026 16:41:06 -0400 Subject: [PATCH 473/473] Renamed tests and switched to using separator macro --- src/classes/file.c | 4 ++-- test/import/folder.morpho | 5 ----- test/import/folder/folder.m | 3 --- test/import/relative_directory.morpho | 5 +++++ test/import/{folder => relative_directory}/inner_target.m | 0 test/import/relative_directory/target.m | 3 +++ 6 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 test/import/folder.morpho delete mode 100644 test/import/folder/folder.m create mode 100644 test/import/relative_directory.morpho rename test/import/{folder => relative_directory}/inner_target.m (100%) create mode 100644 test/import/relative_directory/target.m diff --git a/src/classes/file.c b/src/classes/file.c index 70bcfd516..0eee02661 100644 --- a/src/classes/file.c +++ b/src/classes/file.c @@ -118,7 +118,7 @@ void file_getworkingdirectory(varray_char *path) for (unsigned int i=0; i