Skip to content

Commit

Permalink
Tutorial: Readme with step-by-step instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rfabbri committed Jul 8, 2024
1 parent 93976df commit 3133b96
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 10 deletions.
72 changes: 63 additions & 9 deletions tutorial/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,73 @@
# CVPR 204 fast Homotopy Continuation tutorial

A new polynomial systems can be solved in a number of ways within our framework,
ranging from an initial Macaulay prototype, to a more advanced Macaulay
prototype to a fast C++ version. From the initial prototype to the final C++
code, there are a number of intermediate steps to follow.

## Running the example Macaulay2 template

The example is called linecircle and computes the intersection of a line and a
circle.

# Developer Internal Notes
The equations are stored in: `equations-linecircle.m2`

## Starting files
The tutorial started from Chicago trifocal problem code
### Solve the start solutions

mostly
In a terminal, type:
```bash
m2
```

Completely integrated
minus/m2/chicago/formulation-minors-original-in-minus/t
minus/scripts/eval_monodromy_demo.m2
Then

```
load("start-linecircle.m2")
```

This will run monodromy to compute the solutions in your file.
It will write out the following files into the current folder:

- `startSys` : the start solution and corresponding base point (parameters).
This is a text file in Macaulay format. It can be used both for your fast C++ solver,
and for prototyping the fast online solution in the next step.

- `HxHt.cxx`, `HxH.cxx`: C++ evaluators for writing your optimized solver later on


## Solving your own system

Give your new problem a name, say `problem1`


### Type your equations

Copy the template over:

```
cp equations-linecircle.m2 equations-problem1.m2
```

Edit the file typing your variables, parameters and equations, foloowing the
template as an example.


### Compute start stystems

First, copy over the solution template:
```
load("start-linecircle.m2")
```

In a terminal, type:
```bash
m2
```

Then

```
load("start-linecircle.m2")
```

and the code after "end" in (XXX)
/Users/rfabbri/cprg/vxlprg/lemsvpe/minus/M2/chicago/formulation-minors-original-in-minus/chicago.m2

14 changes: 14 additions & 0 deletions tutorial/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Developer Internal Notes

## Starting files
The tutorial started from Chicago trifocal problem code

mostly

Completely integrated
minus/m2/chicago/formulation-minors-original-in-minus/t
minus/scripts/eval_monodromy_demo.m2

and the code after "end" in (XXX)
/Users/rfabbri/cprg/vxlprg/lemsvpe/minus/M2/chicago/formulation-minors-original-in-minus/chicago.m2

2 changes: 1 addition & 1 deletion tutorial/start-linecircle.m2
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ PH = parametricSegmentHomotopy GS

-- HxHt
symbols = flatten entries vars GS
h=cCode(--"HxHt.cxx",
h=cCode("HxHt.cxx",
transpose(PH.GateHomotopy#"Hx"|PH.GateHomotopy#"Ht"),
gateMatrix{symbols|{PH.GateHomotopy#"T"}|flatten entries PH#Parameters})

Expand Down

0 comments on commit 3133b96

Please sign in to comment.