[過去ログ]
Rust part24 (1002レス)
Rust part24 http://mevius.5ch.net/test/read.cgi/tech/1716759686/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
343: デフォルトの名無しさん [] 2024/06/24(月) 23:39:26.44 ID:FIb4AZ4T 係数はこっちで求めたでござる https://paiza.io/projects/YvPFB5g4cCOtCXz1wpA86g import sys, os from functools import reduce import sympy as sy def lc(a): x, y = sy.symbols('x y') p = 0 for i, (c, d) in enumerate(a): g = reduce(lambda s, t: (t[0], (s[1][0] * (1 if t[0] == i else (x - t[1][0])), 0)), enumerate(a), (-1, (1, 0))) f = g[1][0] p += d * f / f.subs(x, c) print(p) print(p.expand()) for c, d in a: print(p.subs(x, c), p.subs(x, c) == d) if __name__ == '__main__': lc([(1, 2), (2, 1), (3, 3), (4, 10), (6, 4), (8, 8), (10, 6)]) lc([(2, 1), (1, 2), (3, 3), (10, 4), (4, 6), (8, 8), (6, 10)]) http://mevius.5ch.net/test/read.cgi/tech/1716759686/343
345: デフォルトの名無しさん [sage] 2024/06/25(火) 02:44:46.88 ID:MBITUZQb >>332 Rustを習得する上でC++の知識は不要 Cでの基礎知識(ポインタ、スタック、ヒープ)しか必要としない >>343 ここはRustのスレだ http://mevius.5ch.net/test/read.cgi/tech/1716759686/345
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.042s