www.fatihkabakci.com

Personal Website and Computer Science TUR EN

MATRIS DE OKLIT,HILBERT ve MUTLAK NORM

Last update: 2/16/2012 2:04:00 AM

Yazan ve Cevaplayan:Fatih KABAKCI

Bu soru Chip Online sayfasında 24.03.2011 tarihinde yasenur adlı kullanıcı tarafından sorulmuştur.

Gelen Soru:Bir matrisin max mutlak norm, hilbert normu ve euclidiean normunu veren programları yazabilir misiniz? yardımlarınız için teşekkürler.
1.=max |aij| mutlak norm
2.= xi burada xi, B=AA^T matrisinin en büyük öz değeridir. hilbert normu
3.=[ijE ai,j'2]'1/2 =[i=1E xii]'1/2 euclidiean normu (E toplam sembolü)

Verilen Cevap:

Matrix normları ile ilgili bir cok yaklasım mumkundur.Yukarıda verdiginiz ilgili formullere gore beklenen C++ programı asagıdaki gibi olabilir.
#include <iostream>
#include <cmath>

using namespace std;

const int SIZE=2;

double mutlakNorm(double matrix[][SIZE])
{
     double max=matrix[0][0];
     int i,j;
     for(i=0;i<SIZE;i++)
     for(j=0;j<SIZE;j++)
     if(max < matrix[i][j])
     max=matrix[i][j];
     return max;
     }

double hilbertNorm(double matrix[][SIZE])
{

double resultMatrix[SIZE][SIZE]={0,0};
int i,j,k;

for(i=0;i<SIZE;i++)
for(j=0;j<SIZE;j++)
for(k=0;k<2;k++)
resultMatrix[i][j]+=matrix[i][k]*matrix[k][j];

for(int i=0;i<SIZE;i++)
for(int j=0;j<SIZE;j++)
matrix[i][j]=resultMatrix[j][i];

double b=matrix[0][0]+matrix[1][1]; // warning:! only for two-two matrix
double c=matrix[0][0]*matrix[1][1]-matrix[1][0]*matrix[0][1];
double delta=pow(b,2)-4*1*c;
double root1=(-b+sqrt(delta))/2;
double root2=(-b-sqrt(delta))/2;
if(root1 > root2)
return root1;
return root2;
}          

double euclidNorm(double matrix[][SIZE])
{
       double total=0.0;
       int i,j;
       for(i=0;i<SIZE;i++)
       for(j=0;j<SIZE;j++)
       total+=pow(matrix[i][j],2);
       return sqrt(total);
       }
Program formule endeksli ve basit bir mantıga yonelik yazmıs oldugum icin acıklama ihtiyacı hissetmiyorum.

Başarılar
There has been no comment yet

Name:


Question/Comment
   Please verify the image




The Topics in Computer Science

Search this site for





 

Software & Algorithms

icon

In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning.

Programming Languages

icon

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. It can be used to create programs to control the behavior of a machine. Java,C, C++,C#

Database

icon

A database is an organized collection of data. The data are typically organized to model aspects of reality in a way that supports processes requiring information.

Hardware

icon

Computer hardware is the collection of physical elements that constitutes a computer system. Computer hardware refers to the physical parts or components of a computer such as the monitor, memory, cpu.

Web Technologies

icon

Web development is a broad term for the work involved in developing a web site for the Internet or an intranet. Html,Css,JavaScript,ASP.Net,PHP are one of the most popular technologies. J2EE,Servlet, JSP,JSF, ASP

Mobile Technologies

icon

Mobile application development is the process by which application software is developed for low-power handheld devices, such as personal digital assistants, enterprise digital assistants or mobile phones. J2ME

Network

icon

A computer network or data network is a telecommunications network that allows computers to exchange data. In computer networks, networked computing devices pass data to each other along data connections.

Operating Systems

icon

An operating system is software that manages computer hardware and software resources and provides common services for computer programs. The OS is an essential component of the system software in a computer system. Linux,Windows

Computer Science

icon

Computer science is the scientific and practical approach to computation and its applications.A computer scientist specializes in the theory of computation and the design of computational systems.