ffda00b796
stim: convert CurlStimulus to a CurlVectorField and use ModulatedVectorField
...
this opens the door to caching the vector field stuff.
2022-08-18 20:47:36 -07:00
478db86b75
multi-core-inverter: remove the List shenanigans
2022-08-18 20:02:09 -07:00
9461cc7781
stim: introduce a VectorField trait which we'll use to build a more structured approach to Stimulus
2022-08-18 17:08:44 -07:00
cf2d21f975
Stimulus: change at
method to accept feat_size: f32, loc: Index
2022-08-18 16:21:21 -07:00
0fa8cb0d20
cross: DimSlice: add into_inner
method
2022-08-18 16:04:15 -07:00
6750feef8d
stim: remove TimeVarying3
...
`TimeVarying`(1) is enough for what we want.
2022-08-18 15:51:54 -07:00
570f058ee1
rename AbstractStimulus
-> Stimulus
2022-08-18 15:27:18 -07:00
60e44d6d4d
rename Stimulus
-> RegionGated
2022-08-18 15:22:28 -07:00
eb406ea46f
UniformStimulus: use Fields
internally
2022-08-18 15:19:22 -07:00
6e7ae48d86
stim: remove the extra norm
call in CurlStimulus application
...
we call `with_mag` after, making it redundant.
2022-08-18 14:28:33 -07:00
454307325b
stim: add a scale
parameter to AbstractStimulus::eval_into
...
this boosts perf from 571fps -> 620-ish.
2022-08-18 04:33:00 -07:00
e72c0ec11d
cross: DimSlice: add dim/offset accessors
2022-08-18 04:32:43 -07:00
fb9d982545
multi-core-inverter: test an alternate Vec-based stimulus
...
it's about 0.5% slower. not much.
2022-08-18 04:12:57 -07:00
b9581b79b2
sim: add AbstractStimulus::eval_into
for bulk evaluation
2022-08-18 04:11:04 -07:00
07fa4042a3
cross: list: add IntoVec
trait
2022-08-18 04:00:41 -07:00
a3b15bd7e7
cross: DimSlice: add as_ref
, as_mut
methods to re-borrow the data with a different lifetime
...
we can't use the actual AsRef, AsMut trait because we aren't returning a
reference but a new type with an inner reference.
2022-08-18 03:25:52 -07:00
300c11f5ca
stim: use a Visitor instead of a FoldOp for eval
...
boosts perf from 420 -> 530 fps
2022-08-18 02:52:57 -07:00
2a9c065cb0
cross: list: allow visit
to be mutable
2022-08-18 02:45:15 -07:00
f2b23ace17
cross: list: implement a Visit trait.
...
it can't do much yet because the immutable-ness, but i can fix that.
2022-08-18 02:32:52 -07:00
5cc1c310b5
AbstractStimulus: add bulk eval_into
operation.
2022-08-18 01:45:09 -07:00
a0d4a39a66
cross: OffsetDimSlice: implement enumeration
2022-08-17 21:41:26 -07:00
a34363122b
cross: OffsetDimSlice: impl indices()
enumeration
2022-08-17 21:37:40 -07:00
129aaadeac
OffsetDimSlice: impl IntoIter
2022-08-17 21:20:24 -07:00
a247b861e1
cross: hide the iteration features behind a flag
...
they don't compile on spirv due to the inherent use of Options,
but they'll be useful in the CPU-side code.
2022-08-17 21:14:21 -07:00
198cc16f3f
cross: compile tests with the fmt
feature so we can use assert_eq
2022-08-17 21:06:23 -07:00
3ed4cd5059
rename DimensionedSlice -> DimSlice
2022-08-17 20:45:36 -07:00
694906aa32
add OffsetDimensionedSlice, with basic indexing operations
2022-08-17 20:43:38 -07:00
ae5bfcf311
rename dim.rs -> dim_slice.rs
2022-08-17 20:34:47 -07:00
7a1e5815a8
rename Vec3uIter
-> DimIter
2022-08-17 20:32:31 -07:00
b82c127957
add an enumerated
method to DimensionedSlice
2022-08-17 18:12:32 -07:00
2311cf1dd3
cross: DimensionedSlice: add an indices
method
2022-08-17 18:04:21 -07:00
782ac4d2c1
cross: impl IntoIterator for DimensionedSlice
2022-08-17 17:41:39 -07:00
1688707aed
cross: backfill test for DimensionedSlice::IndexMut
2022-08-17 17:31:11 -07:00
92d4f464e1
cross: DimensionedSlice: backfill Index test
2022-08-17 17:28:31 -07:00
ee98e1a060
stim: re-express the AbstractStimulus list op as a fold
...
this gives a big perf boost: 10.5 fps -> 446 fps.
still far lower from the 720 fps we got on an ordinary Vec<Box<dyn
AbstractRegion>>. i think we had achieved 730 using the old
ListVisitor.
it's probably not worth list-ifying the stimuli; at least not at this
level. at the least, we probably want only 5 stimuli: one per core.
if we did that, the stimuli could even have all the same typename,
and be put into a plain old array; no boxing.
2022-08-17 03:28:52 -07:00
ffa13ccd79
app: multi-core-inverter: clean this up by using map/flatten operations
2022-08-17 02:53:14 -07:00
2e667a02dd
cross: list: add some conveniences to query list length and access the first element
2022-08-17 02:45:44 -07:00
107a28e7fd
app: multi_core_inverter: replace these into_list
s with a map operation
2022-08-16 16:53:22 -07:00
7bb3740ce2
app: multi_core_inverter: convert to List primitives
...
goal will be to replace this with enumerate/map/flatten ops
2022-08-16 16:40:39 -07:00
d45b2042e1
cross: list: add more convenient indexing
2022-08-16 16:40:15 -07:00
4b04a48cc4
cross: list: allow enumerating by u32 instead of Tagged
2022-08-16 16:18:09 -07:00
07b5c855e8
cross: list: implement a Flatten
operation
2022-08-16 15:52:09 -07:00
9d4853333d
cross: list: implement an Extend
operation
2022-08-16 15:28:10 -07:00
c353ce411f
cross: list: remove the old (unused) Visitor infrastructure
...
replaced by Fold/Map/etc
2022-08-16 15:07:47 -07:00
4c5c978053
whitespace nits
2022-08-16 01:29:35 -07:00
fad70f45c1
stim: use Map
+ Sum
for evaluating stimuli lists
2022-08-16 01:11:46 -07:00
e2728e0303
stim: impl Add
for Fields
to simplify some of this code
2022-08-16 00:17:23 -07:00
a68b3c7a49
cross: list: backfill more extensive Sum
tests
2022-08-16 00:08:01 -07:00
57b90faa69
cross: list: implement a Sum operation
2022-08-16 00:03:15 -07:00
a8acf6cbb8
cross: list: extend fold
to work by reference.
2022-08-15 23:51:19 -07:00