Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
476 commits
Select commit Hold shift + click to select a range
a0e657e
Remove unused errors
softmattertheory Jan 16, 2026
836dc1d
Remove unused errors
softmattertheory Jan 16, 2026
eaffbbe
Remove unused error
softmattertheory Jan 16, 2026
d29e6f9
A whole bunch of useful errors
softmattertheory Jan 16, 2026
8f3e885
Platform independent re-entrant qsort
softmattertheory Jan 16, 2026
34b9650
Tuple sort functions
softmattertheory Jan 16, 2026
df0f322
Remove extraneous spaces
softmattertheory Jan 16, 2026
4d48f7f
Add non-camelcase method name for Matrix.setColumn
softmattertheory Jan 16, 2026
0dac41d
Fix return type check in sparsedok_copymatrixat
softmattertheory Jan 16, 2026
bd94b31
Fix field initialization to match new matrix type
softmattertheory Jan 16, 2026
0e591d1
Fix test for zero in eigenvalue creation
softmattertheory Jan 17, 2026
e2d3668
Add delayed signature parsing
softmattertheory Jan 17, 2026
ace41d7
Correct erroneous error checks
softmattertheory Jan 17, 2026
2386259
Correct error in test suite
softmattertheory Jan 17, 2026
0577692
Correct MORPHO_STATICMATRIX
softmattertheory Jan 17, 2026
38ab79d
Correct field_addpool
softmattertheory Jan 17, 2026
bb4278a
Correct error message
softmattertheory Jan 17, 2026
6916c7d
Add list and tuple to indexing
softmattertheory Jan 17, 2026
e06b4cb
Fix matrix slicing and permit negative indices
softmattertheory Jan 20, 2026
248db48
Fixed slicing test
softmattertheory Jan 20, 2026
e15a127
Check return values of matrix_getcolumnptr
softmattertheory Jan 20, 2026
35f046c
Matrix concatenation
softmattertheory Jan 20, 2026
5f27916
Raise error correctly if MORPHO_INCLUDE_SPARSE is not defined
softmattertheory Jan 20, 2026
1945149
Fix more errors due to incorrect error checks
softmattertheory Jan 20, 2026
dfd4d26
Fix error checks in functional_symmetrysumforces
softmattertheory Jan 20, 2026
b60c811
Fix Identity constructor
softmattertheory Jan 20, 2026
f3a14c9
Fix Identity Matrix constructor error
softmattertheory Jan 20, 2026
52f138b
Correct error checking in matrix_listconstructor to raise error in in…
softmattertheory Jan 20, 2026
54bc65e
Fix error in matrix_sum usage.
softmattertheory Jan 20, 2026
809d05b
Linear Algebra tests integrated
softmattertheory Jan 21, 2026
905f10b
Remove newlinalg folder and contents, completing integration
softmattertheory Jan 21, 2026
956d289
Update LAPACKE path for linux build
softmattertheory Jan 26, 2026
dcfdf7c
Revised boxing scheme
softmattertheory Jan 27, 2026
0255436
Fix issues with QR decomposition
softmattertheory Jan 27, 2026
de6119e
Add CMake option to build with profiler
ivpravdin Feb 4, 2026
a81a5c1
Merge pull request #313 from ivpravdin/dev
softmattertheory Feb 5, 2026
89d9272
Turn profiler on by default
softmattertheory Feb 14, 2026
6e50e68
Fix System.help()
softmattertheory Feb 15, 2026
9970ced
Support italic text
softmattertheory Feb 15, 2026
82fa7ce
Help topic parser
softmattertheory Feb 16, 2026
178a513
Help finding system
softmattertheory Feb 16, 2026
8e5e5f8
Correct topic names
softmattertheory Feb 16, 2026
e448cbf
Hierarchical search
softmattertheory Feb 16, 2026
23705fd
Hint if query didn't match
softmattertheory Feb 16, 2026
43c0b75
Suggestions for errors at any level
softmattertheory Feb 16, 2026
c8bec1e
Hints for more complex queries
softmattertheory Feb 16, 2026
194f708
Improve code legibility
softmattertheory Feb 16, 2026
5d8d838
Fix queries
softmattertheory Feb 16, 2026
fdc06bb
Improve parsing
softmattertheory Feb 16, 2026
668ece6
Help parsing errors
softmattertheory Feb 16, 2026
1522e0f
Fix inline code parsing
softmattertheory Feb 16, 2026
3ea2e14
Correct error reporting
softmattertheory Feb 16, 2026
927dcc1
Allow literals in text
softmattertheory Feb 16, 2026
1b03d19
Correct order for parseblock
softmattertheory Feb 16, 2026
ba45f30
Fix text consumption
softmattertheory Feb 16, 2026
0722676
Correctly handle lists
softmattertheory Feb 16, 2026
594b279
Update matrix.md
softmattertheory Feb 16, 2026
476fa0d
Clean link definition
softmattertheory Feb 16, 2026
4d685c3
Simplify link parsing
softmattertheory Feb 16, 2026
e30325c
Update functionals.md
softmattertheory Feb 16, 2026
cbcdf22
Update syntax.md
softmattertheory Feb 16, 2026
7e99f44
Lazy loading of help
softmattertheory Feb 16, 2026
c9b85a7
Simplify file loading
softmattertheory Feb 16, 2026
20c76b9
Fix literal parsing in header
softmattertheory Feb 16, 2026
378688d
Escaped literals
softmattertheory Feb 16, 2026
bdab3c7
Rearrange file
softmattertheory Feb 16, 2026
59dba15
Improve clarity
softmattertheory Feb 16, 2026
c45a1ba
Thematic breaks
softmattertheory Feb 16, 2026
a0e5851
Report filename on error reporting
softmattertheory Feb 16, 2026
1b30492
Fixes to help system
softmattertheory Feb 17, 2026
cff2a32
Indicate presence of help
softmattertheory Feb 17, 2026
c123d3e
Expose help_queryhint
softmattertheory Feb 17, 2026
135c2ef
Fix help_topictotext to avoid redundant checks
softmattertheory Feb 17, 2026
29f8e0c
Add null terminators
softmattertheory Feb 17, 2026
8266ead
Alias table
softmattertheory Feb 17, 2026
472e7ca
Move aliases into more coherent place
softmattertheory Feb 17, 2026
a18c469
Clean up help.c and reorganize
softmattertheory Feb 17, 2026
1fde68f
Fix aliases
softmattertheory Feb 18, 2026
b1dd194
Simplify help implementation
softmattertheory Feb 18, 2026
0cc849a
Ensure topic names are correctly freed
softmattertheory Feb 18, 2026
f56be92
Build name dictionary incrementally
softmattertheory Feb 18, 2026
02af82e
Fix potential leak
softmattertheory Feb 18, 2026
3af67fc
Simplify help_nameindex_add
softmattertheory Feb 18, 2026
60564d1
morpho_helptopics API function
softmattertheory Feb 18, 2026
7f9bd28
toplevel forces topics into the top level
softmattertheory Feb 18, 2026
5a7f9a8
md_parseurl to extract show->subtopics
softmattertheory Feb 18, 2026
9bcf41d
Case indep edit distance
softmattertheory Feb 18, 2026
603db5a
Disable help
softmattertheory Feb 19, 2026
2f2d188
Restore help
softmattertheory Feb 19, 2026
99b8763
Disable nanboxing
softmattertheory Feb 19, 2026
5820073
Restore MORPHO_NAN_BOXING
softmattertheory Feb 19, 2026
325dd9f
Add GitHub Actions workflow for NoNANBoxing-2
softmattertheory Feb 19, 2026
6b607fa
Add cmake command to build process
softmattertheory Feb 19, 2026
6463802
Replace morpho6 command with Python test script
softmattertheory Feb 19, 2026
291349f
Add 'help' branch to workflow triggers
softmattertheory Feb 19, 2026
2f9d87b
Update help.c
softmattertheory Feb 19, 2026
817c3dd
Disable nanboxing in Morpho CLI build
softmattertheory Feb 19, 2026
61bd2ac
Update build.h
softmattertheory Feb 19, 2026
d225325
Update build.h
softmattertheory Feb 19, 2026
1cab74f
Fix help_findclosesttopic
softmattertheory Feb 24, 2026
5c58178
Correct type
softmattertheory Feb 24, 2026
ca5d35e
Fix help_createalias
softmattertheory Feb 24, 2026
98d4141
Simplify morpho_helptopics
softmattertheory Feb 24, 2026
2980ba1
Simplify implementation
softmattertheory Feb 24, 2026
8a1f021
Merge pull request #314 from Morpho-lang/help
softmattertheory Feb 28, 2026
765bc9e
Fix POSIX header on apple
softmattertheory Feb 28, 2026
b6c3070
Fix complex matrix arithmetic to allow redirection
softmattertheory Mar 15, 2026
8dd2e1d
Cleanup vm.c and gc.c
softmattertheory Mar 23, 2026
36828a4
Recursive binding
softmattertheory Mar 30, 2026
b132348
Ensure metafunctions are compiled before execution
softmattertheory Apr 12, 2026
e84fb9f
Check return codes
softmattertheory Apr 12, 2026
9214df7
Hardening of Complex division
softmattertheory Apr 12, 2026
9fbcb33
Matrix-ComplexMatrix inner products
softmattertheory Apr 15, 2026
d582209
Fix guard MORPHO_INCLUDE_LINALG
softmattertheory Apr 15, 2026
ae1d832
Fix array constructor
softmattertheory Apr 15, 2026
4709c79
Update test
softmattertheory Apr 15, 2026
be5f3a5
Validate dimensions for matrix constructors and fix SVD allocations
softmattertheory Apr 15, 2026
a2b5e1a
Make QR return a full basis
softmattertheory Apr 15, 2026
63f98f4
Use alternative construction of Q
softmattertheory Apr 15, 2026
617afe2
Check for overflow and other minor hardenings
softmattertheory Apr 16, 2026
b965eaf
Single slice operator for vectors
softmattertheory Apr 17, 2026
37109d8
Improvements to Tuple to provide the order method
softmattertheory Apr 17, 2026
2d5efd6
Improvements to Tuple class
softmattertheory Apr 17, 2026
d320552
Improvements to help
softmattertheory Apr 17, 2026
a50a56c
Compile correctly and produce complex eigenvalues
softmattertheory Apr 19, 2026
2f91b7f
Correct length of right eigenvectors in _eigen
softmattertheory Apr 19, 2026
3617f12
Fix test to avoid direct comparison of floats
softmattertheory Apr 19, 2026
7af05cd
Bind eigenvalues
softmattertheory Apr 19, 2026
4bc8374
vm_bindrecursive is now recursive
softmattertheory Apr 20, 2026
c2be968
Merge pull request #315 from Morpho-lang/newlinalgwin
softmattertheory Apr 20, 2026
b720614
New slow source-of-truth resolver
softmattertheory Apr 20, 2026
90b7020
filter by types
softmattertheory Apr 21, 2026
eec8511
Resolve using specificity
softmattertheory Apr 21, 2026
06a1216
New resolver passes test suite
softmattertheory Apr 22, 2026
a5a6f60
Additional multiple dispatch tests
softmattertheory Apr 22, 2026
7e5cf05
Disable old resolver
softmattertheory Apr 22, 2026
d4ef841
Reorganize code
softmattertheory Apr 22, 2026
7a73b85
Minimal fast resolver
softmattertheory Apr 23, 2026
0971973
First stage of compiler, the analyzer
softmattertheory Apr 23, 2026
be3f4f5
Add index back in
softmattertheory Apr 23, 2026
8d855a0
Workable arity compiler
softmattertheory Apr 25, 2026
4c27a76
Simplify and clean arity checking
softmattertheory Apr 25, 2026
85013ff
Simplify arity checking in mf compiler
softmattertheory Apr 25, 2026
7ac7f82
Improve mf compiler error reporting
softmattertheory Apr 25, 2026
ecd1043
getuid instruction, disassembly and emitter
softmattertheory Apr 26, 2026
56599cd
Separate out arity case emission
softmattertheory Apr 26, 2026
3d8faad
Typed dispatch
softmattertheory Apr 27, 2026
6dbeca1
Fix resolvetypecase
softmattertheory Apr 27, 2026
8fe087c
Basic varg support
softmattertheory Apr 27, 2026
3d4823e
Remove old resolver
softmattertheory Apr 27, 2026
62c840f
Improvements to varg support
softmattertheory Apr 27, 2026
cfc45d0
Recursive metafunction compiler
softmattertheory Apr 29, 2026
ae0cc6d
metafunction_reduce
softmattertheory Apr 29, 2026
fd3a1ed
Compiler specialization of metafunctions
softmattertheory Apr 29, 2026
9ad8dc2
Harden signatures
softmattertheory Apr 29, 2026
37e65b1
Harden Complex signatures
softmattertheory Apr 29, 2026
c9e8477
Harden complex numbers through clearer signatures
softmattertheory Apr 29, 2026
9c7e281
Merge pull request #316 from Morpho-lang/jacobian
softmattertheory Apr 29, 2026
d45bec8
Type hardening of builtin
softmattertheory Apr 30, 2026
0ff5ab0
Arctan
softmattertheory Apr 30, 2026
435550c
Metafunctionized apply
softmattertheory May 1, 2026
65e5ea8
Improve clarity of metafunction compiler
softmattertheory May 3, 2026
a26c9b9
Improve constructor metafunction signatures
softmattertheory May 3, 2026
351b972
Tighten JSON methods
softmattertheory May 3, 2026
280f99e
Harden signatures in System
softmattertheory May 3, 2026
9ef92b5
Harden Tuple signatures
softmattertheory May 3, 2026
4c1ee63
Improve List signatures and eliminate checks within method implementa…
softmattertheory May 3, 2026
9d6152f
Harden the String class
softmattertheory May 3, 2026
cab13da
Assign objectmetafunctiontype with core classes.
softmattertheory May 3, 2026
2b33c0a
Simplify String_split
softmattertheory May 3, 2026
b2d8530
Harden Range
softmattertheory May 3, 2026
715ba0a
More hardening of types
softmattertheory May 3, 2026
6cb8a83
Expand List_getindex
softmattertheory May 4, 2026
6cc73b5
Dictionary set operation signatures
softmattertheory May 4, 2026
1b8eb3b
Fix String_enumerate
softmattertheory May 4, 2026
1d749f2
Correct Matrix return type
softmattertheory May 4, 2026
a4e3260
Fix bug in metafunction_add
softmattertheory May 4, 2026
eeb379c
Improve metafunction_reduce
softmattertheory May 4, 2026
e906f09
Fix bug in comparespecificity
softmattertheory May 4, 2026
a8c9c36
Fix type inference in compile.c
softmattertheory May 4, 2026
8007a8d
fix comparespecificity
softmattertheory May 4, 2026
63b521c
Reduce only for exact types
softmattertheory May 4, 2026
0114c52
Additional tests and fix varray
softmattertheory May 6, 2026
87e8a4e
Fix incorrect signatures for some math functions
softmattertheory May 6, 2026
42cd69f
Function annotation cleanup
softmattertheory May 7, 2026
8fec42e
CFunction annotation
softmattertheory May 7, 2026
81e91b1
Fix issue with name ownership
softmattertheory May 12, 2026
6c3dbcf
Add missing selectors
softmattertheory May 13, 2026
68226d9
CG3 on a 1D element
softmattertheory May 15, 2026
4c998bc
Additional test for triangle
softmattertheory May 15, 2026
6670cbe
CG3 on triangles
softmattertheory May 15, 2026
915c3fb
CG3 gradients
softmattertheory May 15, 2026
c827fa7
CG3 in 3D!
softmattertheory May 15, 2026
138ef81
Create cg3_vol_in_3d_stress.morpho
softmattertheory May 15, 2026
0017c72
Hessians for CG2 and CG3
softmattertheory May 15, 2026
47bf6cf
CG3 hessians
softmattertheory May 15, 2026
ede80aa
Raise an error if no hessian is available
softmattertheory May 15, 2026
31ad909
Harden fespace API
softmattertheory May 15, 2026
3a93e4c
CG3 and CG2 hessians in 3D
softmattertheory May 15, 2026
64fea0a
Check lowering machinery
softmattertheory May 15, 2026
c9f9b28
Jump tests
softmattertheory May 16, 2026
618ab1d
Jump interface references.
softmattertheory May 16, 2026
e93a607
Clean up jump_prepareref.
softmattertheory May 16, 2026
3eb5489
jumpsides
softmattertheory May 16, 2026
981180d
Normals etc.
softmattertheory May 16, 2026
272ad91
Centroid jump penalty
softmattertheory May 16, 2026
08834d4
First step towards quadrature
softmattertheory May 16, 2026
57ee435
Tests with centroids and quadrature
softmattertheory May 17, 2026
c7e9d3e
Fix dependencies
softmattertheory May 17, 2026
b0e9bf7
Fieldgradients for jump
softmattertheory May 17, 2026
587394b
Fix multithreaded jump
softmattertheory May 17, 2026
600ca7f
Fix error messages and checks
softmattertheory May 18, 2026
8f77b66
Add ability to access element data from a FiniteElementSpace
softmattertheory May 18, 2026
de22664
Fix finiteElementSpace label; better CG3 refinement
softmattertheory May 18, 2026
35efe02
Fix output
softmattertheory May 18, 2026
1dc954f
grade and count object for the FiniteElementSpace class
softmattertheory May 18, 2026
3415cee
FiniteElementIndex.nodeElementIndex
softmattertheory May 18, 2026
c716e94
Barycentric coordinates helper
softmattertheory May 18, 2026
90d93a6
Field_elementdofs_method
softmattertheory May 18, 2026
cb860f6
Fixed 3D refinement and FE refinement
softmattertheory May 19, 2026
e691889
Cleanup of MeshRefiner
softmattertheory May 19, 2026
d6446f9
Additional cleanup for the MeshRefiner
softmattertheory May 19, 2026
35bbd32
Additional regressions for finite element refinement
softmattertheory May 19, 2026
b6ef3e4
Field Projector
softmattertheory May 19, 2026
546be39
Remove bytecodeoptimizer from some tests
softmattertheory May 20, 2026
781049e
CG3 1D hessian
softmattertheory May 21, 2026
df3d02f
Merge pull request #311 from Morpho-lang/newlinalg
softmattertheory May 21, 2026
4325e9f
Update checkout action version from v3 to v4
softmattertheory May 21, 2026
282dfa1
Fix functional references to new linear algebra
softmattertheory May 21, 2026
67e3ecb
Merge branch 'dev' into newresolver
softmattertheory May 21, 2026
bf8833a
Fix string checks
softmattertheory May 21, 2026
7c89d1d
Merge branch 'dev' into cg3
softmattertheory May 21, 2026
a8d04b0
Fix integration with new linear algebra library
softmattertheory May 21, 2026
93e52df
Merge pull request #317 from Morpho-lang/newresolver
softmattertheory May 21, 2026
aeeb036
Merge branch 'dev' into cg3
softmattertheory May 21, 2026
3964641
Add missing file
softmattertheory May 21, 2026
bedb6dc
Fix new linear algebra output for dimensions()
softmattertheory May 21, 2026
07f9c84
Updates to help
softmattertheory May 22, 2026
b8b4435
Add in more missing help.
softmattertheory May 22, 2026
beeea92
More detailed help.
softmattertheory May 22, 2026
d9f666c
More help cleanup
softmattertheory May 22, 2026
ea17002
More detail for help
softmattertheory May 22, 2026
db21515
Fix subtopics macro!
softmattertheory May 22, 2026
512a143
Merge pull request #318 from Morpho-lang/cg3
softmattertheory May 29, 2026
dece26c
Wire in System.help
softmattertheory May 31, 2026
816d4a6
Fix help system to avoid duplicate topics
softmattertheory May 31, 2026
0079f61
Simplify help implementation
softmattertheory May 31, 2026
5bf4032
MeshChecker added
softmattertheory Jun 2, 2026
d16311d
Improved MeshChecker
softmattertheory Jun 2, 2026
640cc64
Fix version comparison
softmattertheory Jun 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: configure
run: |
sudo apt update
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/nonanboxing2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: NoNANBoxing-2

on:
push:
branches: [ "dev", "help" ]
pull_request:
branches: [ "dev", "help" ]

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
cmake -DMORPHO_DISABLENANBOXING=ON ..
sudo make install
- name: test
run: |
cd test
python3 test.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,5 @@ build-xcode/*
build-win/*
*.valgrind
/.vs
/dist
/vcpkg_installed
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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" ON)

#-------------------------------------------------------------------------------
# Process options
Expand Down Expand Up @@ -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
#-------------------------------------------------------------------------------
Expand All @@ -64,7 +70,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\\"
)
Expand All @@ -85,7 +91,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})
Expand Down
1 change: 0 additions & 1 deletion examples/elementtypes/qtensorCG2.morpho
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
19 changes: 19 additions & 0 deletions help/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
32 changes: 32 additions & 0 deletions help/complex.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,42 @@ 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)

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()
2 changes: 2 additions & 0 deletions help/controlflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
60 changes: 53 additions & 7 deletions help/dictionary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]: # (subtopics)

## 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
Loading
Loading