摘要:
#include "stdafx.h"#include "stdlib.h"#include "stdio.h"#include #include #define MaxSize 1000using namespace std;typedef struct node{ int num; node * lchild; node * rchild;};struct chain{ node * Node; chain * next;}*head;typedef struct Stack{ int data[MaxSize]; int top 阅读全文
摘要:
进退法例子,遇到具体问题还得修改,以后最速下降梯度法的梯度方向是变化的,这是其中一个要考虑的改变。进退法具体算法:实现代码:#include "StdAfx.h"#include #include #include #define N 2using namespace std;float testFunction(float z[N]){ float f; f = z[0] * z[0] + z[1] * z[1] - 8 * z[0] - 12 * z[1] + 52; //函数 return(f);}void main(){ float x[N],s[N],f[N].. 阅读全文