@iyulab/u-doe 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "iyulab"
6
6
  ],
7
7
  "description": "Design of Experiments (DOE) framework: factorial, Plackett-Burman, CCD, Box-Behnken, Taguchi, effects analysis, RSM, and desirability optimization.",
8
- "version": "0.3.0",
8
+ "version": "0.4.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/u_doe.d.ts CHANGED
@@ -152,6 +152,31 @@ export function plackett_burman(k: number): any;
152
152
  */
153
153
  export function signal_to_noise(responses_json: any, goal: string): any;
154
154
 
155
+ /**
156
+ * Generate a Simplex Centroid Design for `q`-component mixture experiments.
157
+ *
158
+ * Produces 2^q − 1 points: the centroid of every non-empty subset of the
159
+ * q components. Example: q=3 → 7 points (3 vertices + 3 edge midpoints +
160
+ * 1 overall centroid), q=4 → 15 points.
161
+ *
162
+ * Returns `{ data: [[f64]], factor_names: [str], run_count: usize, factor_count: usize }`.
163
+ * Factor names are "X1", "X2", ..., "Xq".
164
+ */
165
+ export function simplex_centroid(q: number): any;
166
+
167
+ /**
168
+ * Generate a Simplex Lattice Design {q, m} for mixture experiments.
169
+ *
170
+ * Each of the `q` components takes values in {0, 1/m, 2/m, ..., 1} subject
171
+ * to the constraint that all components sum to 1.0 for every run.
172
+ *
173
+ * Run count: C(q + m − 1, m) (e.g. {3,2} → 6 runs, {3,3} → 10 runs).
174
+ *
175
+ * Returns `{ data: [[f64]], factor_names: [str], run_count: usize, factor_count: usize }`.
176
+ * Factor names are "X1", "X2", ..., "Xq".
177
+ */
178
+ export function simplex_lattice(q: number, m: number): any;
179
+
155
180
  /**
156
181
  * Compute the steepest ascent path from a fitted RSM model.
157
182
  *
package/u_doe.js CHANGED
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./u_doe_bg.js";
5
5
  __wbg_set_wasm(wasm);
6
6
  wasm.__wbindgen_start();
7
7
  export {
8
- box_behnken, ccd, definitive_screening, desirability, doe_anova, estimate_effects, fit_rsm, fractional_factorial, full_factorial, plackett_burman, signal_to_noise, steepest_ascent, taguchi_array, two_level_factorial_power
8
+ box_behnken, ccd, definitive_screening, desirability, doe_anova, estimate_effects, fit_rsm, fractional_factorial, full_factorial, plackett_burman, signal_to_noise, simplex_centroid, simplex_lattice, steepest_ascent, taguchi_array, two_level_factorial_power
9
9
  } from "./u_doe_bg.js";
package/u_doe_bg.js CHANGED
@@ -263,6 +263,48 @@ export function signal_to_noise(responses_json, goal) {
263
263
  return takeFromExternrefTable0(ret[0]);
264
264
  }
265
265
 
266
+ /**
267
+ * Generate a Simplex Centroid Design for `q`-component mixture experiments.
268
+ *
269
+ * Produces 2^q − 1 points: the centroid of every non-empty subset of the
270
+ * q components. Example: q=3 → 7 points (3 vertices + 3 edge midpoints +
271
+ * 1 overall centroid), q=4 → 15 points.
272
+ *
273
+ * Returns `{ data: [[f64]], factor_names: [str], run_count: usize, factor_count: usize }`.
274
+ * Factor names are "X1", "X2", ..., "Xq".
275
+ * @param {number} q
276
+ * @returns {any}
277
+ */
278
+ export function simplex_centroid(q) {
279
+ const ret = wasm.simplex_centroid(q);
280
+ if (ret[2]) {
281
+ throw takeFromExternrefTable0(ret[1]);
282
+ }
283
+ return takeFromExternrefTable0(ret[0]);
284
+ }
285
+
286
+ /**
287
+ * Generate a Simplex Lattice Design {q, m} for mixture experiments.
288
+ *
289
+ * Each of the `q` components takes values in {0, 1/m, 2/m, ..., 1} subject
290
+ * to the constraint that all components sum to 1.0 for every run.
291
+ *
292
+ * Run count: C(q + m − 1, m) (e.g. {3,2} → 6 runs, {3,3} → 10 runs).
293
+ *
294
+ * Returns `{ data: [[f64]], factor_names: [str], run_count: usize, factor_count: usize }`.
295
+ * Factor names are "X1", "X2", ..., "Xq".
296
+ * @param {number} q
297
+ * @param {number} m
298
+ * @returns {any}
299
+ */
300
+ export function simplex_lattice(q, m) {
301
+ const ret = wasm.simplex_lattice(q, m);
302
+ if (ret[2]) {
303
+ throw takeFromExternrefTable0(ret[1]);
304
+ }
305
+ return takeFromExternrefTable0(ret[0]);
306
+ }
307
+
266
308
  /**
267
309
  * Compute the steepest ascent path from a fitted RSM model.
268
310
  *
@@ -336,7 +378,7 @@ export function two_level_factorial_power(k, p, n_replicates, effect_size, sigma
336
378
  const ret = wasm.two_level_factorial_power(k, p, n_replicates, effect_size, sigma, alpha);
337
379
  return ret;
338
380
  }
339
- export function __wbg_Error_83742b46f01ce22d(arg0, arg1) {
381
+ export function __wbg_Error_2e59b1b37a9a34c3(arg0, arg1) {
340
382
  const ret = Error(getStringFromWasm0(arg0, arg1));
341
383
  return ret;
342
384
  }
@@ -347,46 +389,46 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
347
389
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
348
390
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
349
391
  }
350
- export function __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1(arg0) {
392
+ export function __wbg___wbindgen_boolean_get_a86c216575a75c30(arg0) {
351
393
  const v = arg0;
352
394
  const ret = typeof(v) === 'boolean' ? v : undefined;
353
395
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
354
396
  }
355
- export function __wbg___wbindgen_debug_string_5398f5bb970e0daa(arg0, arg1) {
397
+ export function __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57(arg0, arg1) {
356
398
  const ret = debugString(arg1);
357
399
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
358
400
  const len1 = WASM_VECTOR_LEN;
359
401
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
360
402
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
361
403
  }
362
- export function __wbg___wbindgen_in_41dbb8413020e076(arg0, arg1) {
404
+ export function __wbg___wbindgen_in_4bd7a57e54337366(arg0, arg1) {
363
405
  const ret = arg0 in arg1;
364
406
  return ret;
365
407
  }
366
- export function __wbg___wbindgen_is_function_3c846841762788c1(arg0) {
408
+ export function __wbg___wbindgen_is_function_49868bde5eb1e745(arg0) {
367
409
  const ret = typeof(arg0) === 'function';
368
410
  return ret;
369
411
  }
370
- export function __wbg___wbindgen_is_object_781bc9f159099513(arg0) {
412
+ export function __wbg___wbindgen_is_object_40c5a80572e8f9d3(arg0) {
371
413
  const val = arg0;
372
414
  const ret = typeof(val) === 'object' && val !== null;
373
415
  return ret;
374
416
  }
375
- export function __wbg___wbindgen_is_undefined_52709e72fb9f179c(arg0) {
417
+ export function __wbg___wbindgen_is_undefined_c0cca72b82b86f4d(arg0) {
376
418
  const ret = arg0 === undefined;
377
419
  return ret;
378
420
  }
379
- export function __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b(arg0, arg1) {
421
+ export function __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944(arg0, arg1) {
380
422
  const ret = arg0 == arg1;
381
423
  return ret;
382
424
  }
383
- export function __wbg___wbindgen_number_get_34bb9d9dcfa21373(arg0, arg1) {
425
+ export function __wbg___wbindgen_number_get_7579aab02a8a620c(arg0, arg1) {
384
426
  const obj = arg1;
385
427
  const ret = typeof(obj) === 'number' ? obj : undefined;
386
428
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
387
429
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
388
430
  }
389
- export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
431
+ export function __wbg___wbindgen_string_get_914df97fcfa788f2(arg0, arg1) {
390
432
  const obj = arg1;
391
433
  const ret = typeof(obj) === 'string' ? obj : undefined;
392
434
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -394,22 +436,22 @@ export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
394
436
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
395
437
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
396
438
  }
397
- export function __wbg___wbindgen_throw_6ddd609b62940d55(arg0, arg1) {
439
+ export function __wbg___wbindgen_throw_81fc77679af83bc6(arg0, arg1) {
398
440
  throw new Error(getStringFromWasm0(arg0, arg1));
399
441
  }
400
- export function __wbg_call_e133b57c9155d22c() { return handleError(function (arg0, arg1) {
442
+ export function __wbg_call_7f2987183bb62793() { return handleError(function (arg0, arg1) {
401
443
  const ret = arg0.call(arg1);
402
444
  return ret;
403
445
  }, arguments); }
404
- export function __wbg_done_08ce71ee07e3bd17(arg0) {
446
+ export function __wbg_done_547d467e97529006(arg0) {
405
447
  const ret = arg0.done;
406
448
  return ret;
407
449
  }
408
- export function __wbg_get_326e41e095fb2575() { return handleError(function (arg0, arg1) {
450
+ export function __wbg_get_ed0642c4b9d31ddf() { return handleError(function (arg0, arg1) {
409
451
  const ret = Reflect.get(arg0, arg1);
410
452
  return ret;
411
453
  }, arguments); }
412
- export function __wbg_get_unchecked_329cfe50afab7352(arg0, arg1) {
454
+ export function __wbg_get_unchecked_7d7babe32e9e6a54(arg0, arg1) {
413
455
  const ret = arg0[arg1 >>> 0];
414
456
  return ret;
415
457
  }
@@ -417,7 +459,7 @@ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
417
459
  const ret = arg0[arg1];
418
460
  return ret;
419
461
  }
420
- export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
462
+ export function __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a(arg0) {
421
463
  let result;
422
464
  try {
423
465
  result = arg0 instanceof ArrayBuffer;
@@ -427,7 +469,7 @@ export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
427
469
  const ret = result;
428
470
  return ret;
429
471
  }
430
- export function __wbg_instanceof_Uint8Array_740438561a5b956d(arg0) {
472
+ export function __wbg_instanceof_Uint8Array_4b8da683deb25d72(arg0) {
431
473
  let result;
432
474
  try {
433
475
  result = arg0 instanceof Uint8Array;
@@ -437,52 +479,52 @@ export function __wbg_instanceof_Uint8Array_740438561a5b956d(arg0) {
437
479
  const ret = result;
438
480
  return ret;
439
481
  }
440
- export function __wbg_isArray_33b91feb269ff46e(arg0) {
482
+ export function __wbg_isArray_db61795ad004c139(arg0) {
441
483
  const ret = Array.isArray(arg0);
442
484
  return ret;
443
485
  }
444
- export function __wbg_iterator_d8f549ec8fb061b1() {
486
+ export function __wbg_iterator_de403ef31815a3e6() {
445
487
  const ret = Symbol.iterator;
446
488
  return ret;
447
489
  }
448
- export function __wbg_length_b3416cf66a5452c8(arg0) {
490
+ export function __wbg_length_0c32cb8543c8e4c8(arg0) {
449
491
  const ret = arg0.length;
450
492
  return ret;
451
493
  }
452
- export function __wbg_length_ea16607d7b61445b(arg0) {
494
+ export function __wbg_length_6e821edde497a532(arg0) {
453
495
  const ret = arg0.length;
454
496
  return ret;
455
497
  }
456
- export function __wbg_new_5f486cdf45a04d78(arg0) {
498
+ export function __wbg_new_4f9fafbb3909af72() {
499
+ const ret = new Object();
500
+ return ret;
501
+ }
502
+ export function __wbg_new_a560378ea1240b14(arg0) {
457
503
  const ret = new Uint8Array(arg0);
458
504
  return ret;
459
505
  }
460
- export function __wbg_new_a70fbab9066b301f() {
506
+ export function __wbg_new_f3c9df4f38f3f798() {
461
507
  const ret = new Array();
462
508
  return ret;
463
509
  }
464
- export function __wbg_new_ab79df5bd7c26067() {
465
- const ret = new Object();
510
+ export function __wbg_next_01132ed6134b8ef5(arg0) {
511
+ const ret = arg0.next;
466
512
  return ret;
467
513
  }
468
- export function __wbg_next_11b99ee6237339e3() { return handleError(function (arg0) {
514
+ export function __wbg_next_b3713ec761a9dbfd() { return handleError(function (arg0) {
469
515
  const ret = arg0.next();
470
516
  return ret;
471
517
  }, arguments); }
472
- export function __wbg_next_e01a967809d1aa68(arg0) {
473
- const ret = arg0.next;
474
- return ret;
475
- }
476
- export function __wbg_prototypesetcall_d62e5099504357e6(arg0, arg1, arg2) {
518
+ export function __wbg_prototypesetcall_3e05eb9545565046(arg0, arg1, arg2) {
477
519
  Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
478
520
  }
479
- export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
480
- arg0[arg1 >>> 0] = arg2;
481
- }
482
521
  export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
483
522
  arg0[arg1] = arg2;
484
523
  }
485
- export function __wbg_value_21fc78aab0322612(arg0) {
524
+ export function __wbg_set_6c60b2e8ad0e9383(arg0, arg1, arg2) {
525
+ arg0[arg1 >>> 0] = arg2;
526
+ }
527
+ export function __wbg_value_7f6052747ccf940f(arg0) {
486
528
  const ret = arg0.value;
487
529
  return ret;
488
530
  }
package/u_doe_bg.wasm CHANGED
Binary file