Exemple #1
0
Created on Wed Oct 14 13:27:40 2015

@author: Admin
"""

# -*- coding: utf-8 -*-
from Generic import Newton
from Problem import Problem
from scipy import *
def f(x):
    return sum([(i) ** 2 for i in x])
    

x = matrix([11221.,11221.]).transpose()
p=Problem(f)
new = Newton(p)
res = new.nextH(p,x)
print(res)
#print((x))
#print(p.grad(x))

class Newton():
    def __init__(self,problem,a=None):
        self.problem = problem
        self.a = a
       
    def solve(self,x,tolerance):
        re = []
        for i in range(50):
            
            re.append(x)