00001
00025 #include <stdlib.h>
00026 #include <stdio.h>
00027 #include <errno.h>
00028 #include <math.h>
00029
00030 #include "powerflow.h"
00031 #include "node.h"
00032 #include "link.h"
00033
00034 extern "C" {
00035 #include "output.h"
00036 }
00037
00038 void print_matrix(complex mat[3][3])
00039 {
00040 for (int i = 0; i < 3; i++) {
00041 gl_testmsg(" %10.6f%+0.6f%c %10.6f%+0.6f%c %10.6f%+0.6f%c",
00042 mat[i][0].Re(), mat[i][0].Im(), mat[i][0].Notation(),
00043 mat[i][1].Re(), mat[i][1].Im(), mat[i][1].Notation(),
00044 mat[i][2].Re(), mat[i][2].Im(), mat[i][2].Notation());
00045 }
00046 gl_testmsg("\n");
00047 }
00048
00049 EXPORT int kmldump(int (*stream)(const char*,...), OBJECT *obj)
00050 {
00051 if (obj==NULL)
00052 {
00053 node::kmlinit(stream);
00054 link_object::kmlinit(stream);
00055 return 0;
00056 }
00057 else if (gl_object_isa(obj,"node"))
00058 return OBJECTDATA(obj,node)->kmldump(stream);
00059 else if (gl_object_isa(obj,"link"))
00060 return OBJECTDATA(obj,link_object)->kmldump(stream);
00061 else
00062
00063 return 0;
00064 }
00065