Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-qtype_stack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-qtype_stack
Commits
fc57ba67
Commit
fc57ba67
authored
1 year ago
by
smmercuri
Browse files
Options
Downloads
Patches
Plain Diff
Update names of set functions and add more for completeness
parent
8ed43a4a
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
stack/maxima/contrib/matchlib.mac
+26
-9
26 additions, 9 deletions
stack/maxima/contrib/matchlib.mac
with
26 additions
and
9 deletions
stack/maxima/contrib/matchlib.mac
+
26
−
9
View file @
fc57ba67
...
@@ -121,23 +121,40 @@ match_transpose(ans) := block(
...
@@ -121,23 +121,40 @@ match_transpose(ans) := block(
/*
/*
* Use this on both the model answer and the student input
* Use this on both the model answer and the student input
* when you do not care about the order within a column.
* when you do not care about the order within a column.
* Combine with `match_transpose` if you do not care about the order
* within a row.
*
*
* It will turn `[[a, b], [c, d]]` into `[{a, b}, {c, d}]`.
* It will turn `[[a, b], [c, d]
, [e, f]
]` into `[{a, b}, {c, d}
, {e, f}
]`.
*/
*/
match_column_set
ify
(ans) := block(
match_column_set(ans) := block(
return(map(lambda([col], apply(set, col)), ans))
return(map(lambda([col], apply(set, col)), ans))
);
);
/*
* Use this on both the model answer and the student input
* when you do not care about the order within a row.
*
* It will turn `[[a, b], [c, d], [e, f]]` into `[{a, c, e}, {b, d, f}]`.
*/
match_row_set(ans) := block(
return(match_column_set(match_transpose(ans)))
);
/*
/*
* Use this on both the model answer and the student input
* Use this on both the model answer and the student input
* when you do not care about the order between columns.
* when you do not care about the order between columns.
* Combine with `match_transpose` if you do not care about
* the order between rows.
*
*
* It will turn `[[a, b], [c, d]]` into `{[a, b], [c, d]}`.
* It will turn `[[a, b], [c, d]
, [e, f]
]` into `{[a, b], [c, d]
, [e, f]
}`.
*/
*/
match_set
ify
(ans) := block(
match_set
_column
(ans) := block(
return(apply(set, ans))
return(apply(set, ans))
);
);
/*
* Use this on both the model answer and the student input
* when you do not care about the order between rows.
*
* It will turn `[[a, b], [c, d], [e, f]]` into `{[a, c, e], [b, d, f]}`.
*/
match_set_row(ans) := block(
return(match_set_column(match_transpose(ans)))
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment