【緊急】地球に大変な事態か゛起こりました!【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/vb8kbHbvpPw?si=WuGqWOB6zDb-vHje

カテゴリー: 未分類 | コメントする

【宇宙の絶対法則】なぜ万物は同じルールに従うのか?天才たちが残した「変化を捉える」思考の眼|微分積分の正体 ASTRENCE (アストレンス) 宇宙物理探究ラボ

https://youtu.be/2kAMbIouVjM?si=yMjFpDOTbmFBr40C

カテゴリー: 未分類 | コメントする

【時間は存在しないのかもしれない】バーバーの時間論 COSMIENCE コスミエンス

https://youtu.be/jlGvb6qaT7w?si=ZxcJJFHkGKj-vUgo

カテゴリー: 未分類 | コメントする

千葉・南房総と神奈川・湘南海岸 | チバニアンって何? 堆積岩の地形をバイクで巡って解説します 地理ライダー

https://youtu.be/MXTuEwwTUKM?si=JYYLZOH9CewNqH-l

カテゴリー: 未分類 | コメントする

【衝撃】-270℃の宇宙でボイジャーが半世紀も凍らない理由がヤバすぎた AI 宇宙大好きレキシカちゃん

https://youtu.be/KU7mraaXsYI?si=GUkcF5dz8q8i5-57

カテゴリー: 未分類 | コメントする

【緊急】体の痛みは宇宙からの光のメッセージ!どうか受け取ってください【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/J4ZjrHZF3mU?si=xQzdWzG1bJmMQBrM

カテゴリー: 未分類 | コメントする

【意識は計算できない】ゲーデルが証明し、ペンローズは量子重力に答えを見たのかもしれない COSMIENCE コスミエンス

https://youtu.be/8R1XTqtWl5o?si=W3kL87gNBAWmhSK5

カテゴリー: 未分類 | コメントする

【闇深】STAP細胞事件が起きた本当の理由をご存知ですか?『小保方晴子』【ずんだもん&ゆっくり解説】 ずんだ事件記録

https://youtu.be/I31NHVvvUSQ?si=pv6FWomBkgkqRiIQ

カテゴリー: 未分類 | コメントする

静岡・伊豆半島 | 駿河湾はなぜ深い? バイクで巡る 海底火山2000万年の歴史と地質 地理ライダー

https://youtu.be/r7aNDwyfuW4?si=ZxNN1O3OUEE_NO2y

カテゴリー: 未分類 | コメントする

月刊ムー三上編集長が雑誌に書ききれなかった都市伝説がヤバすぎる。【 都市伝説 2025年7月5日 予言 】 コヤッキースタジオ

https://youtu.be/fm5snCUwl_c?si=kXjjS9Ozpm_Wh40_

カテゴリー: 未分類 | コメントする

【ワームホールは”過去への扉”になる】キップ・ソーンが真剣に計算した??タイムマシンを禁じる物理法則は、まだ見つかっていない COSMIENCE コスミエンス

https://youtu.be/3TUZZjSrYtg?si=7KTsXL-Gan2BzECl

カテゴリー: 未分類 | コメントする

【宇宙の”85%”は見えない】90年探しても捕まらない物質??2025年、それでも「存在する」証拠が積み上がった COSMIENCE コスミエンス

https://youtu.be/Hr019gUsjKA?si=0lLMuefE1K3t9nF3

カテゴリー: 未分類 | コメントする

銀行口座の入出金は全部見られている?こういう口座の動きは税務署に疑われます。 脱・税理士スガワラくん

https://youtu.be/Zp4J14T1o-A?si=hx-BHKb8Dj-cPw_T

カテゴリー: 未分類 | コメントする

【必見】税務署が見ている預金の動きと、社長がやるべき対策はこれです! 社長の右腕チャンネル

https://youtu.be/Tyca1B_2zrI?si=0OBFAuxncjSX7ib6

カテゴリー: 未分類 | コメントする

【緊急】今日があなたの最終夜です?至急、受け取ってください_あなただけに届く魂の解放メッセ-ジ? プレアデス最高評議会

https://youtu.be/XVT5yxpGz9w?si=W7ztkhiS68y9ur8u

カテゴリー: 未分類 | コメントする

【黄金の転換期】あなたに託された魂の使命!宇宙審査の結果がでました【プレアス評議会からのメッセージ】 プレアデス最高評議会

https://youtu.be/Rgvnq23JhYI?si=nqSCjRQvLeHxqcER

カテゴリー: 未分類 | コメントする

【※今すぐ確認して下さい】あなた宛てにプレアデス評議会から特別通達が届いています!【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/_tcyjQfWMFE?si=0NBgRxnoX466gzJq

カテゴリー: 未分類 | コメントする

再帰の基礎:2倍に分岐増殖する様子を再帰モデルで表現する 実行結果とソースコード

実行結果


C++Builder2007ソースコード

//************************
//***** Unit1.h ********
//************************

//—————————————————————————

#ifndef Unit1H
#define Unit1H
//—————————————————————————
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include “Chart.hpp”
#include “TeEngine.hpp”
#include “TeeProcs.hpp”
#include <ExtCtrls.hpp>
#include “Series.hpp”

#include <vector>
//—————————————————————————
const int max_depth = 8; // 最大階層数

class RecursiveWave
{
public:
int current_depth; // クラスメンバーとして
double Value;
RecursiveWave *child1, *child2;
RecursiveWave *z_1, *z_2;
int direction; // +1: 順方向、 -1:逆方向

// RecursiveWaveクラスに追加(public) 逆転版(トップダウン用)
bool isTopDownMode;

RecursiveWave(int n, int dir);
~RecursiveWave();
void LinkParents(RecursiveWave* parent1, RecursiveWave* parent2); // 後からリンク
void SetupParents(RecursiveWave* node, RecursiveWave* p1, RecursiveWave* p2);
void Dump(TMemo *memo);
double GetValue(){ return Value; }
};

std::vector<RecursiveWave*> all_waves1;
std::vector<RecursiveWave*> all_waves2;

//—————————————————————————
class TForm1 : public TForm
{
__published: // IDE-managed Components
TChart *Chart1;
TButton *ButtonExit;
TLineSeries *Series1;
TMemo *Memo1;
TLineSeries *Series2;
TButton *Button1;
TRadioGroup *RadioGroup1;
void __fastcall ButtonExitClick(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);

RecursiveWave *Top;
void ChartSetting();

};
//—————————————————————————
extern PACKAGE TForm1 *Form1;
//—————————————————————————
#endif

 

//************************
//***** Unit1.cpp ******
//************************

//—————————————————————————

#include <vcl.h>
#pragma hdrstop

#include <math.h>
#include “Unit1.h”
//—————————————————————————
#pragma package(smart_init)
#pragma link “Chart”
#pragma link “TeEngine”
#pragma link “TeeProcs”
#pragma link “Series”
#pragma resource “*.dfm”
TForm1 *Form1;
//—————————————————————————
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//—————————————————————————
void __fastcall TForm1::ButtonExitClick(TObject *Sender)
{
Close();
}
//—————————————————————————
// ***** ChartSetting *****
void TForm1::ChartSetting()
{
Chart1->SeriesList->ClearValues();

// 軸タイトルだけ設定(SeriesCountチェックはButton1Click側に移動)
Chart1->LeftAxis->Title->Caption = “Value1”;
Chart1->LeftAxis->Title->Visible = true;
Chart1->RightAxis->Title->Caption = “Value2”;
Chart1->RightAxis->Title->Visible = true;
Chart1->RightAxis->Visible = true;
Chart1->BottomAxis->Title->Caption = “Count”;
Chart1->BottomAxis->Visible = true;

}

// 構築後に親を設定する専用メソッド
void RecursiveWave::LinkParents(RecursiveWave* parent1, RecursiveWave* parent2) {
z_1 = parent1;
z_2 = parent2 ? parent2 : parent1; // z_2がなければz_1で代用

// Valueを親を使って計算
if (z_1) {
Value = z_1->Value * 1.7 – (z_2 ? z_2->Value * 0.97 : 0.0) + 1.0;
} else {
Value = 1.0; // 最上位の初期値
}
}

// 新規ヘルパー関数(トップダウンで親情報を伝播)
void RecursiveWave::SetupParents(RecursiveWave* node, RecursiveWave* p1, RecursiveWave* p2) {
if (!node) return;

node->LinkParents(p1, p2);
//node->LinkParents();

// 子に伝える(z_1 = node自身、z_2 = p1)
SetupParents(node->child1, node, p1); //再帰呼び出し
SetupParents(node->child2, node, p1); //再帰呼び出し
}

// ***** 順方向:逆方向選択版 コンストラクタ *****
RecursiveWave::RecursiveWave(int n, int dir): current_depth(n), Value(0.0), child1(NULL), child2(NULL),
z_1(NULL), z_2(NULL), direction(dir)
{
if (n >= max_depth) return;

if(direction == -1){
//逆方向
// 子を先に作成(再帰)
child1 = new RecursiveWave(n + 1, dir);
child2 = new RecursiveWave(n + 1, -dir);

// all_waves登録
all_waves1.push_back(this);
all_waves2.push_back(this);

}else if(direction == +1){
//順方向
// all_wavesに先に登録
all_waves1.push_back(this);
all_waves2.push_back(this);

// 子を先に作成(再帰)
child1 = new RecursiveWave(n + 1, dir);
child2 = new RecursiveWave(n + 1, -dir);

}

}

//**********************
//デストラクタ
RecursiveWave::~RecursiveWave()
{
if (child1 != NULL) {
delete child1; // 再帰的に子孫をすべて削除
child1 = NULL;
}

if (child2 != NULL) {
delete child1; // 再帰的に子孫をすべて削除
child1 = NULL;
}
// all_wavesから自分を除去(任意)
// (vectorからeraseするのは重いので、クリア時に一括処理する方が良い)
}

void RecursiveWave::Dump(TMemo *memo)
{
if (all_waves1.empty()) return;
memo->Hide();

AnsiString str;
int count = 0;

for (std::vector<RecursiveWave*>::const_iterator it = all_waves1.begin();
it != all_waves1.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
memo->Lines->Add(str.sprintf(“depth= %d, Value= %g”, neigh->current_depth, neigh->Value) );
count++;
}
}

memo->Show();

/*memo->Lines->Add(“==============”);
for(int i=0; i<all_waves->size(); i++){
memo->Lines->Add(str.sprintf(“depth= %d, Value= %g”, i, (*all_waves)[i].Value ) );
}*/

}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
// 既存のオブジェクトをクリア(メモリリーク防止)
for (size_t i = 0; i < all_waves1.size(); i++) {
delete all_waves1[i];
}
all_waves1.clear();
// 既存のオブジェクトをクリア(メモリリーク防止)
for (size_t i = 0; i < all_waves2.size(); i++) {
delete all_waves2[i];
}
all_waves2.clear();

//方向指定、初期化、生成
RecursiveWave *WaveTop;
if(RadioGroup1->ItemIndex == 1){
//順方向
WaveTop = new RecursiveWave(0, +1); // 引数不要!

}else if(RadioGroup1->ItemIndex == 0){
//逆方向
WaveTop = new RecursiveWave(0, -1); // 引数不要!
}

// 再帰的に親リンクを設定(トップダウン)
WaveTop->SetupParents(WaveTop, NULL, NULL); // 新規ヘルパー関数

WaveTop->Dump(Memo1);

ChartSetting();

// Seriesを安全に追加
Chart1->SeriesList->ClearValues(); // 念のため

// Series[0] と Series[1] が確実に存在することを保証
while (Chart1->SeriesCount() < 2) {
TLineSeries* s = new TLineSeries(Chart1);
Chart1->AddSeries(s);
}

int count = 0;
for (std::vector<RecursiveWave*>::const_iterator it = all_waves1.begin();
it != all_waves1.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
Chart1->Series[0]->AddY(neigh->Value, “”, clBlue); // Value(左軸)
//Chart1->Series[0]->AddY(neigh->current_depth, “”, clBlue); // Depth(右軸) ← コメント解除OK
count++;
}
}
count = 0;
for (std::vector<RecursiveWave*>::const_iterator it = all_waves2.begin();
it != all_waves2.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
Chart1->Series[1]->AddY(neigh->Value, “”, clRed); // Value(左軸)
//Chart1->Series[1]->AddY(neigh->current_depth, “”, clRed); // Depth(右軸) ← コメント解除OK
count++;
}
}

// 軸設定を再適用
Chart1->Series[0]->VertAxis = 0; // vaLeft
Chart1->Series[1]->VertAxis = 1; // vaRight

delete WaveTop;
all_waves1.clear();
all_waves2.clear();

}

//—————————————————————————

カテゴリー: 未分類 | コメントする

【※今すぐ確認して下さい】あなた宛てにプレアデス評議会から特別通達が届いています!【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/_tcyjQfWMFE?si=Mq_Zcw_aKWNyJOPD

カテゴリー: 未分類 | コメントする

『なぜ天皇は必然なのか』 三島由紀夫氏

https://x.com/ak0701QMAGA17/status/2078880565563097492?s=20

カテゴリー: 未分類 | コメントする

【シュレディンガーの猫は”実在”した】目に見える物体を、生きながら死なせる実験が成功している COSMIENCE コスミエンス

https://youtu.be/jMbywUIj3Bs?si=b_FYeAsKhFTzoWy6

カテゴリー: 未分類 | コメントする

【宇宙からの大吉報】あなたの苦しみ全て無くなります。【プレアデス評議会】 プレアデス最高評議会

https://youtu.be/W6ENfV87Ppg?si=wEOEk9Ybf0zY_VY6

カテゴリー: 未分類 | コメントする

【※限定配信】この動画を見ている時点で「合格」です。【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/zd1h6pMhJa4?si=G073MjMKx6dIQOcL

カテゴリー: 未分類 | コメントする

【※必ず受信して】宇宙銀行頭取より「あなたの口座には既に無限の資産が眠っている!」【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/MjrZB5q-O7U?si=sIzFN5hLPjN7qucV

カテゴリー: 未分類 | コメントする

再帰の基礎:波を再帰モデルで表現する 逆転版(過去→現在)を追加

実行結果


C++Builder2007ソースコード

//************************
//***** Unit1.h ********
//************************

//—————————————————————————

#ifndef Unit1H
#define Unit1H
//—————————————————————————
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include “Chart.hpp”
#include “TeEngine.hpp”
#include “TeeProcs.hpp”
#include <ExtCtrls.hpp>
#include “Series.hpp”

#include <vector>
//—————————————————————————
const int max_depth = 100; // 最大階層数

class RecursiveWave
{
public:
int current_depth; // クラスメンバーとして
double Value;
RecursiveWave *child;
RecursiveWave *z_1, *z_2;
int direction; // +1: 順方向、 -1:逆方向

// RecursiveWaveクラスに追加(public) 逆転版(トップダウン用)
bool isTopDownMode;

RecursiveWave(int n, int dir);

void LinkParents(RecursiveWave* parent1, RecursiveWave* parent2); // 後からリンク
void Dump(TMemo *memo);
double GetValue(){ return Value; }
};

std::vector<RecursiveWave*> all_waves;

//—————————————————————————
class TForm1 : public TForm
{
__published: // IDE-managed Components
TChart *Chart1;
TButton *ButtonExit;
TLineSeries *Series1;
TMemo *Memo1;
TLineSeries *Series2;
TButton *Button1;
TRadioGroup *RadioGroup1;
void __fastcall ButtonExitClick(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);

RecursiveWave *Top;
void ChartSetting();

};
//—————————————————————————
extern PACKAGE TForm1 *Form1;
//—————————————————————————
#endif

//************************
//***** Unit1.cpp ******
//************************

//—————————————————————————

#include <vcl.h>
#pragma hdrstop

#include <math.h>
#include “Unit1.h”
//—————————————————————————
#pragma package(smart_init)
#pragma link “Chart”
#pragma link “TeEngine”
#pragma link “TeeProcs”
#pragma link “Series”
#pragma resource “*.dfm”
TForm1 *Form1;
//—————————————————————————
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//—————————————————————————
void __fastcall TForm1::ButtonExitClick(TObject *Sender)
{
Close();
}
//—————————————————————————

// ChartSetting
void TForm1::ChartSetting()
{
Chart1->SeriesList->ClearValues();

// 軸タイトルだけ設定(SeriesCountチェックはButton1Click側に移動)
Chart1->LeftAxis->Title->Caption = “Value”;
Chart1->LeftAxis->Title->Visible = true;
Chart1->RightAxis->Title->Caption = “Depth”;
Chart1->RightAxis->Title->Visible = true;
Chart1->RightAxis->Visible = true;
Chart1->BottomAxis->Title->Caption = “Count”;
Chart1->BottomAxis->Visible = true;

}

// ***** 双方向版 *****
RecursiveWave::RecursiveWave(int n, int dir): current_depth(n), Value(0.0), child(NULL),
z_1(NULL), z_2(NULL), direction(dir)
{
if (n >= max_depth) return;

if(direction == -1){
// 子を先に作成(再帰)
child = new RecursiveWave(n + 1, dir);

// all_waves登録
all_waves.push_back(this);

}else if(direction == +1){
// all_wavesに先に登録
all_waves.push_back(this);

// 子を先に作成(再帰)
child = new RecursiveWave(n + 1, dir);

}

}

// 新規ヘルパー関数(トップダウンで親情報を伝播)
void SetupParents(RecursiveWave* node, RecursiveWave* p1, RecursiveWave* p2) {
if (!node) return;

node->LinkParents(p1, p2);

// 子に伝える(z_1 = node自身、z_2 = p1)
SetupParents(node->child, node, p1);
}

// 構築後に親を設定する専用メソッド
void RecursiveWave::LinkParents(RecursiveWave* parent1, RecursiveWave* parent2) {
z_1 = parent1;
z_2 = parent2 ? parent2 : parent1; // z_2がなければz_1で代用

// Valueを親を使って計算
if (z_1) {
Value = z_1->Value * 1.7 – (z_2 ? z_2->Value * 0.97 : 0.0) + 1.0;
} else {
Value = 1.0; // 最上位の初期値
}
}
//**********************

 

void RecursiveWave::Dump(TMemo *memo)
{
if (all_waves.empty()) return;

AnsiString str;
int count = 0;

for (std::vector<RecursiveWave*>::const_iterator it = all_waves.begin();
it != all_waves.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
memo->Lines->Add(str.sprintf(“depth= %d, Value= %g”, neigh->current_depth, neigh->Value) );
count++;
}
}

/*memo->Lines->Add(“==============”);
for(int i=0; i<all_waves->size(); i++){
memo->Lines->Add(str.sprintf(“depth= %d, Value= %g”, i, (*all_waves)[i].Value ) );
}*/

}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
// 既存のオブジェクトをクリア(メモリリーク防止)
for (size_t i = 0; i < all_waves.size(); i++) {
delete all_waves[i];
}
all_waves.clear();

//方向指定、初期化、生成
RecursiveWave *WaveTop;
if(RadioGroup1->ItemIndex == 1){
//順方向
WaveTop = new RecursiveWave(0, +1); // 引数不要!

}else if(RadioGroup1->ItemIndex == 0){
//逆方向
WaveTop = new RecursiveWave(0, -1); // 引数不要!
}

// 再帰的に親リンクを設定(トップダウン)
SetupParents(WaveTop, NULL, NULL); // 新規ヘルパー関数

WaveTop->Dump(Memo1);

ChartSetting();

// Seriesを安全に追加
Chart1->SeriesList->ClearValues(); // 念のため

// Series[0] と Series[1] が確実に存在することを保証
while (Chart1->SeriesCount() < 2) {
TLineSeries* s = new TLineSeries(Chart1);
Chart1->AddSeries(s);
}

int count = 0;
for (std::vector<RecursiveWave*>::const_iterator it = all_waves.begin();
it != all_waves.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
Chart1->Series[0]->AddY(neigh->Value, “”, clBlue); // Value(左軸)
Chart1->Series[1]->AddY(neigh->current_depth, “”, clRed); // Depth(右軸) ← コメント解除OK
count++;
}
}

// 軸設定を再適用
Chart1->Series[0]->VertAxis = 0; // vaLeft
Chart1->Series[1]->VertAxis = 1; // vaRight

}

//—————————————————————————

カテゴリー: 未分類 | コメントする

再帰の基礎:波を再帰モデルで表現する 実行結果とソースコード

実行結果

Memo1
depth= 99, Value= 4.1556
depth= 98, Value= 3.88514
depth= 97, Value= 3.55581
depth= 96, Value= 3.25747
depth= 95, Value= 3.0741
depth= 94, Value= 3.06032
depth= 93, Value= 3.2252
depth= 92, Value= 3.52836
depth= 91, Value= 3.88971
depth= 90, Value= 4.21046
depth= 89, Value= 4.40008
depth= 88, Value= 4.40172
depth= 87, Value= 4.20912
depth= 86, Value= 3.86988
depth= 85, Value= 3.47389
depth= 84, Value= 3.12963
depth= 83, Value= 2.93451
depth= 82, Value= 2.94746
depth= 81, Value= 3.17132
depth= 80, Value= 3.55028
depth= 79, Value= 3.98368
depth= 78, Value= 4.35254
depth= 77, Value= 4.55221
depth= 76, Value= 4.52188
depth= 75, Value= 4.26286
depth= 74, Value= 3.84019
depth= 73, Value= 3.36646
depth= 72, Value= 2.97195
depth= 71, Value= 2.76892
depth= 70, Value= 2.81981
depth= 69, Value= 3.1183
depth= 68, Value= 3.58898
depth= 67, Value= 4.10614
depth= 66, Value= 4.52728
depth= 65, Value= 4.7322
depth= 64, Value= 4.65718
depth= 63, Value= 4.31443
depth= 62, Value= 3.79109
depth= 61, Value= 3.22724
depth= 60, Value= 2.77857
depth= 59, Value= 2.57354
depth= 58, Value= 2.67675
depth= 57, Value= 3.069
depth= 56, Value= 3.65006
depth= 55, Value= 4.26401
depth= 54, Value= 4.741
depth= 53, Value= 4.944
depth= 52, Value= 4.80805
depth= 51, Value= 4.36049
depth= 50, Value= 3.71628
depth= 49, Value= 3.04864
depth= 48, Value= 2.54269
depth= 47, Value= 2.34426
depth= 46, Value= 2.5181
depth= 45, Value= 3.02732
depth= 44, Value= 3.74057
depth= 43, Value= 4.46561
depth= 42, Value= 5.001
depth= 41, Value= 5.19185
depth= 40, Value= 4.97437
depth= 39, Value= 4.39648
depth= 38, Value= 3.60787
depth= 37, Value= 2.82156
depth= 36, Value= 2.25647
depth= 35, Value= 2.07674
depth= 34, Value= 2.34432
depth= 33, Value= 2.99856
depth= 32, Value= 3.86931
depth= 31, Value= 4.7209
depth= 30, Value= 5.31568
depth= 29, Value= 5.48017
depth= 28, Value= 5.15526
depth= 27, Value= 4.41627
depth= 26, Value= 3.45607
depth= 25, Value= 2.53511
depth= 24, Value= 1.91094
depth= 23, Value= 1.76649
depth= 22, Value= 2.15679
depth= 21, Value= 2.98975
depth= 20, Value= 4.0472
depth= 19, Value= 5.04174
depth= 18, Value= 5.6946
depth= 17, Value= 5.81348
depth= 16, Value= 5.34879
depth= 15, Value= 4.41181
depth= 14, Value= 3.24875
depth= 13, Value= 2.17635
depth= 12, Value= 1.49593
depth= 11, Value= 1.409
depth= 10, Value= 1.95811
depth= 9, Value= 3.0101
depth= 8, Value= 4.28768
depth= 7, Value= 5.44222
depth= 6, Value= 6.14856
depth= 5, Value= 6.19621
depth= 4, Value= 5.55155
depth= 3, Value= 4.3726
depth= 2, Value= 2.971
depth= 1, Value= 1.73
depth= 0, Value= 1


C++Builder2007ソースコード

//************************
//***** Unit1.h ********
//************************

//—————————————————————————

#ifndef Unit1H
#define Unit1H
//—————————————————————————
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include “Chart.hpp”
#include “TeEngine.hpp”
#include “TeeProcs.hpp”
#include <ExtCtrls.hpp>
#include “Series.hpp”

#include <vector>
//—————————————————————————
const int max_depth = 100; // 最大階層数

class RecursiveWave
{
public:
int current_depth; // クラスメンバーとして
double Value;
RecursiveWave *child;
RecursiveWave *z_1, *z_2;

RecursiveWave(int n);

void LinkParents(RecursiveWave* parent1, RecursiveWave* parent2); // 後からリンク
void Dump(TMemo *memo);
double GetValue(){ return Value; }
};

std::vector<RecursiveWave*> all_waves;

//—————————————————————————
class TForm1 : public TForm
{
__published: // IDE-managed Components
TChart *Chart1;
TButton *ButtonExit;
TLineSeries *Series1;
TMemo *Memo1;
TLineSeries *Series2;
TButton *Button1;
void __fastcall ButtonExitClick(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);

RecursiveWave *Top;
void ChartSetting();

};
//—————————————————————————
extern PACKAGE TForm1 *Form1;
//—————————————————————————
#endif

 

//************************
//***** Unit1.cpp ******
//************************

//—————————————————————————

#include <vcl.h>
#pragma hdrstop

#include <math.h>
#include “Unit1.h”
//—————————————————————————
#pragma package(smart_init)
#pragma link “Chart”
#pragma link “TeEngine”
#pragma link “TeeProcs”
#pragma link “Series”
#pragma resource “*.dfm”
TForm1 *Form1;
//—————————————————————————
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//—————————————————————————
void __fastcall TForm1::ButtonExitClick(TObject *Sender)
{
Close();
}
//—————————————————————————

// ChartSetting
void TForm1::ChartSetting()
{
Chart1->SeriesList->ClearValues();

// 軸タイトルだけ設定(SeriesCountチェックはButton1Click側に移動)
Chart1->LeftAxis->Title->Caption = “Value”;
Chart1->LeftAxis->Title->Visible = true;
Chart1->RightAxis->Title->Caption = “Depth”;
Chart1->RightAxis->Title->Visible = true;
Chart1->RightAxis->Visible = true;
Chart1->BottomAxis->Title->Caption = “Count”;
Chart1->BottomAxis->Visible = true;

}

RecursiveWave::RecursiveWave(int n): current_depth(n), Value(0.0), child(NULL),
z_1(NULL), z_2(NULL)
{
if (n >= max_depth) return;

// 子を先に作成(再帰)
child = new RecursiveWave(n + 1);

// all_waves登録
all_waves.push_back(this);

}

// 構築後に親を設定する専用メソッド
void RecursiveWave::LinkParents(RecursiveWave* parent1, RecursiveWave* parent2) {
z_1 = parent1;
z_2 = parent2 ? parent2 : parent1; // z_2がなければz_1で代用

// Valueを親を使って計算
if (z_1) {
Value = z_1->Value * 1.7 – (z_2 ? z_2->Value * 0.97 : 0.0) + 1.0;
} else {
Value = 1.0; // 最上位の初期値
}
}

void RecursiveWave::Dump(TMemo *memo)
{
if (all_waves.empty()) return;

AnsiString str;
int count = 0;

for (std::vector<RecursiveWave*>::const_iterator it = all_waves.begin();
it != all_waves.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
memo->Lines->Add(str.sprintf(“depth= %d, Value= %g”, neigh->current_depth, neigh->Value) );
count++;
}
}

/*memo->Lines->Add(“==============”);
for(int i=0; i<all_waves->size(); i++){
memo->Lines->Add(str.sprintf(“depth= %d, Value= %g”, i, (*all_waves)[i].Value ) );
}*/

}

// 新規ヘルパー関数(トップダウンで親情報を伝播)
void SetupParents(RecursiveWave* node, RecursiveWave* p1, RecursiveWave* p2) {
if (!node) return;

node->LinkParents(p1, p2);

// 子に伝える(z_1 = node自身、z_2 = p1)
SetupParents(node->child, node, p1);
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
// 既存のオブジェクトをクリア(メモリリーク防止)
for (size_t i = 0; i < all_waves.size(); i++) {
delete all_waves[i];
}
all_waves.clear();

// 正しい初期化
RecursiveWave *WaveTop = new RecursiveWave(0); // 引数不要!

// 再帰的に親リンクを設定(トップダウン)
SetupParents(WaveTop, NULL, NULL); // 新規ヘルパー関数

WaveTop->Dump(Memo1);

ChartSetting();

// Seriesを安全に追加
Chart1->SeriesList->ClearValues(); // 念のため

// Series[0] と Series[1] が確実に存在することを保証
while (Chart1->SeriesCount() < 2) {
TLineSeries* s = new TLineSeries(Chart1);
Chart1->AddSeries(s);
}

int count = 0;
for (std::vector<RecursiveWave*>::const_iterator it = all_waves.begin();
it != all_waves.end(); ++it) {
RecursiveWave* neigh = *it;
if (neigh) {
Chart1->Series[0]->AddY(neigh->Value, “”, clBlue); // Value(左軸)
Chart1->Series[1]->AddY(neigh->current_depth, “”, clRed); // Depth(右軸) ← コメント解除OK
count++;
}
}

// 軸設定を再適用
Chart1->Series[0]->VertAxis = 0; // vaLeft
Chart1->Series[1]->VertAxis = 1; // vaRight

}
//—————————————————————————

カテゴリー: 未分類 | コメントする

日本人の秘密知りたくないですか?月刊ムー三上編集長が語る誰も知らない日本人のルーツ【 都市伝説 月刊ムー 編集長 コラボ 秦氏 日本史 日ユ同祖論 】 コヤッキースタジオ /一石英一郎著「日本人の遺伝子」、日本人とユダヤ人の遺伝子は同じである。 DNA

https://youtu.be/dbPW2uhDZfk?si=xkXw7xveRFfT16dr

 

一石英一郎著「日本人の遺伝子」、日本人とユダヤ人の遺伝子は同じである

カテゴリー: 未分類 | コメントする

親からもらったお金が贈与にならない?税務署の誘導尋問を回避する方法について解説します。 脱・税理士スガワラくん

https://youtu.be/T_7I9GUzjIE?si=Z9p11AAH8r2lzRJF

カテゴリー: 未分類 | コメントする

イスラエル大学の名誉教授が明かす〝日本=ユダヤ〟の決定的証拠が衝撃すぎる。聖書から完全に抹消された「第二のエルサレム」の真相を語っていただきました! TOLAND VLOG

https://youtu.be/p6dgjdmU-A0?si=sKXV9Hqhkx4kXELJ

カテゴリー: 未分類 | コメントする

実家を相続したらすぐ売るな! たった○ヶ月の差で相続税が数千万変わる制度を暴露します。 脱・税理士スガワラくん

https://youtu.be/b2FdWgzHZU0?si=FY3jdYyE2jmoBQmd

カテゴリー: 未分類 | コメントする

【※応答必須】あなたの合格に宇宙最大の祝福を送ります!【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/p5ZGyaiEknI?si=E9GQCxhfxanQiyPF

カテゴリー: 未分類 | コメントする

【感動する話】「中卒ですが…」現れたのはIQ200の天才少女。廃業寸前の診療所で雇うと、1ヶ月後に奇跡が起きることに…【泣ける話いい話朗読】 感動ぴよこ

https://youtu.be/cSrhtgc2rS8?si=gyPqTFSTRY8HeyHN

カテゴリー: 未分類 | コメントする

【日本一上陸困難】最強の秘境「青ヶ島」に行ってみた! くまみトラベル

https://youtu.be/7XdPpcJiGDs?si=evo2yJ4z7T1JyqR8

カテゴリー: 未分類 | コメントする

製薬会社の闇暴露しテレビ出禁/高齢者交通事故の原因は薬/精神科医 和田秀樹 街録ch?あなたの人生、教えて下さい?

https://youtu.be/ND7bLFD-b98?si=zfWxbobqFpziQqr6

カテゴリー: 未分類 | コメントする

愛知の中央構造線 | 日本列島1億年前の古傷をバイクで辿る 豊橋?新城 地理ライダー

https://youtu.be/qy3E_jTQl1U?si=ZyK9mfOmzAT0pf7r

カテゴリー: 未分類 | コメントする

やらない理由がどこにもない!690万円の節税と500万円の運用益がダブルで手に入る最高の方法を暴露します! 脱・税理士スガワラくん

https://youtu.be/haNVbH72eQM?si=-HEcrRGv-dbK8fg2

カテゴリー: 未分類 | コメントする

【あなたのスマホが変わります】知らなきゃ危ない新機能”RCS”の正体とは!?料金・詐欺被害を防ぐ方法を徹底解説 ミキのスマホ保健室

https://youtu.be/1o0DajshKyM?si=0AZdsnfs_2eM0dFu

カテゴリー: 未分類 | コメントする

【知らないと損】充電と個人情報を”同時に”奪う設定はコレ…切れば2倍長持ち+監視も全て止まります。 スマホ博士

https://youtu.be/vtWjy8iNEqk?si=Nmb0fsKpdGf5hQDU

カテゴリー: 未分類 | コメントする

元自衛隊幹部が語る「内閣情報調査室」の真実|リアルVIVANTの世界 警察官辞めたch

https://youtu.be/oqoY6WI4JvU?si=rWREcgxiCwXUPDUU

カテゴリー: 未分類 | コメントする

【※緊急速報※】須田慎一郎から大切な話があるので拡散していただけると幸いです 須田慎一郎のただいま取材中!

https://youtu.be/QrcIn6K5G0o?si=Vm26C-WBzhDoEivY

カテゴリー: 未分類 | コメントする

【時事ネタ】グローバリストのプランC〜アルメニアはキエフと同じ道を歩むのか⁈〜6/10水曜版‼️ ニキータ伝〜ロシアの手ほどき

https://youtu.be/qoYw3VVmUI0?si=Ie-ieHRBJ6g93nxr

カテゴリー: 未分類 | コメントする

【※朗報】この変化を逃さないでください!【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/CJW8M91bG7s?si=cFiPWvg2R8SKWsnW

カテゴリー: 未分類 | コメントする

【※本日中】地球の鼓動が“7 83Hz”から変わる時。2万6000年に一度の「生物学的リセット」と、日本人に眠る覚醒コード【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/8FDIB5mLWrw?si=p8lA7bmX_kJdLLaD

カテゴリー: 未分類 | コメントする

Z変換

うさぎでもわかる信号処理 第01羽 z変換のいろは
https://www.momoyama-usagi.com/entry/math-seigyo01#gsc.tab=0

カテゴリー: 未分類 | コメントする

【ビッグバンの直後にあってはならない】あなたが夜空に見る”最古の光”は、成熟しすぎた銀河だった??理論の100倍明るい謎 COSMIENCE コスミエンス

https://youtu.be/_c4n5N9tsuw?si=O5gJwG2JVCjzDbms

カテゴリー: 未分類 | コメントする

【※直接送信】選ばれた魂のみ再生可能。あなたが「人並み外れた高波動」である決定的な証拠と、プレアデスが明かす2026年への全貌【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/LXovd–qRmQ?si=TfCJmjHg_P0niTM5

カテゴリー: 未分類 | コメントする

【※神回】この動画を最後まで見れる確率は0 01%!【プレアデスからのメッセージ】 プレアデス最高評議会

https://youtu.be/dF9J4hFw5qE?si=Lrslg1xhggJU7RRQ

カテゴリー: 未分類 | コメントする

定年でも仕事辞められない…無職でも支払わないといけない住民税と社会保険の仕組みについて解説します。 脱・税理士スガワラくん

https://youtu.be/bb-WW7JhCRo?si=oEO1e1QTSSYmNnLi

カテゴリー: 未分類 | コメントする

65歳以降に働いてもメリットなし?社会保険と年金の損得について徹底解説します。 脱・税理士スガワラくん

https://youtu.be/b9IT0q2DePc?si=YuNoBaDAeSx48t4E

カテゴリー: 未分類 | コメントする

65歳からでは遅い!?実は早く貰わないと損してしまう年金の受け取り方について解説します。 脱・税理士スガワラくん

https://youtu.be/J6i7L0QSRSQ?si=AskD2Ll1tUUcNrWh

カテゴリー: 未分類 | コメントする