/usr/share/pyshared/PyTrilinos/EpetraExt.py is in python-pytrilinos 10.4.0.dfsg-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
"""
PyTrilinos.EpetraExt is the python interface to the Trilinos linear
algebra services extension package EpetraExt:
http://trilinos.sandia.gov/packages/epetraext
The purpose of EpetraExt is to provide various extensions to Epetra
that were not considered appropriate for the Epetra package. These
extensions include I/O, matrix-matrix operations and graph coloring.
Currently, only a subset of EpetraExt classes and functions have
python interfaces, including the following user-level classes:
* XMLReader - Read Epetra data from an XML file
* XMLWriter - Write Epetra data as an XML file
* CrsGraph_MapColoring - Compute a graph coloring
* CrsGraph_MapColoringIndex - Compute indexes for a graph coloring
and functions:
* MatrixMarketFileToBlockMap - Read a BlockMap from an MM file
* MatrixMarketFileToBlockMaps - Read BlockMaps from an MM file
* MatrixMarketFileToMap - Read a Map from an MM file
* MatrixMarketFileToMultiVector - Read a MultiVector from an MM file
* MatrixMarketFileToCrsMatrix - Read a CrsMatrix from an MM file
* MatlabFileToCrsMatrix - Read a CrsMatrix from an ML file
* BlockMapToMatrixMarketFile - Write a BlockMap to an MM file
* MultiVectorToMatrixMarketFile - Write a MultiVector to an MM file
* MultiVectorToMatlabFile - Write a MultiVector to an ML file
* RowMatrixToMatrixMarketFile - Write a RowMatrix to an MM file
* RowMatrixToMatlabFile - Write a RowMatrix to an ML file
* Add - Add two CrsMatrix objects
* Multiply - Multiply two CrsMatrix objects
For examples of usage, please consult the following scripts in the
example subdirectory of the PyTrilinos package:
* exEpetraExt_IO_MatrixMarket.py
* exEpetraExt_IO_XML.py
* exEpetraExt_MatrixMatrix.py
"""
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_EpetraExt', [dirname(__file__)])
except ImportError:
import _EpetraExt
return _EpetraExt
if fp is not None:
try:
_mod = imp.load_module('_EpetraExt', fp, pathname, description)
finally:
fp.close()
return _mod
_EpetraExt = swig_import_helper()
del swig_import_helper
else:
import _EpetraExt
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name,None)
if method: return method(self,value)
if (not static):
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self,class_type,name,value):
return _swig_setattr_nondynamic(self,class_type,name,value,0)
def _swig_getattr(self,class_type,name):
if (name == "thisown"): return self.this.own()
method = class_type.__swig_getmethods__.get(name,None)
if method: return method(self)
raise AttributeError(name)
def _swig_repr(self):
try: strthis = "proxy of " + self.this.__repr__()
except: strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object : pass
_newclass = 0
try:
import weakref
weakref_proxy = weakref.proxy
except:
weakref_proxy = lambda x: x
class SwigPyIterator(_object):
"""Proxy of C++ swig::SwigPyIterator class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _EpetraExt.delete_SwigPyIterator
__del__ = lambda self : None;
def value(self):
"""value(self) -> PyObject"""
return _EpetraExt.SwigPyIterator_value(self)
def incr(self, n = 1):
"""
incr(self, size_t n = 1) -> SwigPyIterator
incr(self) -> SwigPyIterator
"""
return _EpetraExt.SwigPyIterator_incr(self, n)
def decr(self, n = 1):
"""
decr(self, size_t n = 1) -> SwigPyIterator
decr(self) -> SwigPyIterator
"""
return _EpetraExt.SwigPyIterator_decr(self, n)
def distance(self, *args):
"""distance(self, SwigPyIterator x) -> ptrdiff_t"""
return _EpetraExt.SwigPyIterator_distance(self, *args)
def equal(self, *args):
"""equal(self, SwigPyIterator x) -> bool"""
return _EpetraExt.SwigPyIterator_equal(self, *args)
def copy(self):
"""copy(self) -> SwigPyIterator"""
return _EpetraExt.SwigPyIterator_copy(self)
def next(self):
"""next(self) -> PyObject"""
return _EpetraExt.SwigPyIterator_next(self)
def __next__(self):
"""__next__(self) -> PyObject"""
return _EpetraExt.SwigPyIterator___next__(self)
def previous(self):
"""previous(self) -> PyObject"""
return _EpetraExt.SwigPyIterator_previous(self)
def advance(self, *args):
"""advance(self, ptrdiff_t n) -> SwigPyIterator"""
return _EpetraExt.SwigPyIterator_advance(self, *args)
def __eq__(self, *args):
"""__eq__(self, SwigPyIterator x) -> bool"""
return _EpetraExt.SwigPyIterator___eq__(self, *args)
def __ne__(self, *args):
"""__ne__(self, SwigPyIterator x) -> bool"""
return _EpetraExt.SwigPyIterator___ne__(self, *args)
def __iadd__(self, *args):
"""__iadd__(self, ptrdiff_t n) -> SwigPyIterator"""
return _EpetraExt.SwigPyIterator___iadd__(self, *args)
def __isub__(self, *args):
"""__isub__(self, ptrdiff_t n) -> SwigPyIterator"""
return _EpetraExt.SwigPyIterator___isub__(self, *args)
def __add__(self, *args):
"""__add__(self, ptrdiff_t n) -> SwigPyIterator"""
return _EpetraExt.SwigPyIterator___add__(self, *args)
def __sub__(self, *args):
"""
__sub__(self, ptrdiff_t n) -> SwigPyIterator
__sub__(self, SwigPyIterator x) -> ptrdiff_t
"""
return _EpetraExt.SwigPyIterator___sub__(self, *args)
def __iter__(self): return self
SwigPyIterator_swigregister = _EpetraExt.SwigPyIterator_swigregister
SwigPyIterator_swigregister(SwigPyIterator)
import Teuchos
import Epetra
def EpetraExt_Version(*args):
"""
EpetraExt_Version() -> string
std::string
EpetraExt::EpetraExt_Version()
"""
return _EpetraExt.EpetraExt_Version(*args)
__version__ = EpetraExt_Version().split()[2]
class XMLReader(_object):
"""
class XMLReader: A class for reading Epetra objects stored in XML
files.
Class EpetraExt::XMLReader allows to read several Trilinos objects
stored in XML files. The XML data format is specified in the
documentation of class EpetraExt::XMLWriter, which also contains a
MATLAB script. A typical usage of this class is reported in file
epetraext/example/inout/XML_IO.cpp.
This class requires Teuchos to be configured with the option --enable-
teuchos-expat.
Reading objects from a file requires the following steps. First, we
define an XMLReader object, Then, we define a set of pointers, Reading
simply goes as follows: In distributed environments,
Epetra_MultiVector, Epetra_CrsGraph and Epetra_CrsMatrix objects have
a linear distribution. Epetra_Map objects can be read only when using
the same number of processors used for writing.
WARNING: All the created objects must be deleted from the user using
delete.
Marzio Sala, D-INFK/ETHZ
C++ includes: EpetraExt_XMLReader.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLReader, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLReader, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, Comm Comm, string FileName) -> XMLReader
EpetraExt::XMLReader::XMLReader(const Epetra_Comm &Comm, const
std::string &FileName)
ctor
"""
this = _EpetraExt.new_XMLReader(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _EpetraExt.delete_XMLReader
__del__ = lambda self : None;
def ReadMap(self, *args):
"""
ReadMap(self, string name) -> Map
Return a Map read from an XML file specified by filename 'name'.
"""
return _EpetraExt.XMLReader_ReadMap(self, *args)
def ReadMultiVector(self, *args):
"""
ReadMultiVector(self, string name) -> Epetra_MultiVector
Return a MultiVector read from an XML file specified by filename
'name'.
"""
return _EpetraExt.XMLReader_ReadMultiVector(self, *args)
def ReadCrsGraph(self, *args):
"""
ReadCrsGraph(self, string name) -> CrsGraph
Return a CrsGraph read from an XML file specified by filename 'name'.
"""
return _EpetraExt.XMLReader_ReadCrsGraph(self, *args)
def ReadCrsMatrix(self, *args):
"""
ReadCrsMatrix(self, string name) -> CrsMatrix
Return a CrsMatrix read from an XML file specified by filename 'name'.
"""
return _EpetraExt.XMLReader_ReadCrsMatrix(self, *args)
XMLReader_swigregister = _EpetraExt.XMLReader_swigregister
XMLReader_swigregister(XMLReader)
class XMLWriter(_object):
"""
class XMLWriter: A class for writing Trilinos objects to XML files.
Class EpetraExt::XMLWriter writes several Trilinos objects in an XML-
compatible format. The list of supported objects contains: Epetra_Map;
Epetra_MultiVector;
Epetra_CrsGraph;
Epetra_CrsMatrix;
Epetra_RowMatrix;
Teuchos::ParameterList.
All objects can be read and written, with the std::exception of
Epetra_RowMatrix objects, that can only be written to files.
An example of usage is reported in file
epetraext/example/inout/XML_IO.cpp.
Writing objects goes as follows. Let Map, Matrix, LHS and RHS an
Epetra_Map, Epetra_CrsMatrix, and two Epetra_MultiVector's,
respectively. First, we define an XMLWriter object and we open the
file using MyProblem label: Writing objects simply goes as A
Teuchos::ParameterList (List), a std::string, and a
std::vector<std::string> can be written as Finally, we close the file
Note that only processor 0 writes the Teuchos::ParameterList,
std::string, and std::vector<std::string>.
The written file is as follows:
This class requires Teuchos to be configured with the option --enable-
teuchos-expat.
Marzio Sala, D-INFK/ETHZ
C++ includes: EpetraExt_XMLWriter.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLWriter, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLWriter, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(self, Comm Comm, string FileName) -> XMLWriter
EpetraExt::XMLWriter::XMLWriter(const Epetra_Comm &Comm, const
std::string &FileName)
ctor
"""
this = _EpetraExt.new_XMLWriter(*args)
try: self.this.append(this)
except: self.this = this
__swig_destroy__ = _EpetraExt.delete_XMLWriter
__del__ = lambda self : None;
def Create(self, *args):
"""
Create(self, string Label)
void
EpetraExt::XMLWriter::Create(const std::string &Label)
Creates the file, giving Label to the whole object.
"""
return _EpetraExt.XMLWriter_Create(self, *args)
def Close(self, *args):
"""
Close(self)
void
EpetraExt::XMLWriter::Close()
Closes the file. No Write operations can follow.
"""
return _EpetraExt.XMLWriter_Close(self, *args)
def Write(self, *args):
"""
Write(self, string Label, Map Map)
Write(self, string Label, RowMatrix Matrix)
Write(self, string Label, Epetra_MultiVector MultiVector)
Write(self, string Label, std::vector<(std::string,std::allocator<(std::string)>)> Content)
Write(self, string Label, string Text)
Write(self, string Label, ParameterList List)
void
EpetraExt::XMLWriter::Write(const std::string &Label,
Teuchos::ParameterList &List)
Writes a Teuchos::ParameterList using label Label.
"""
return _EpetraExt.XMLWriter_Write(self, *args)
XMLWriter_swigregister = _EpetraExt.XMLWriter_swigregister
XMLWriter_swigregister(XMLWriter)
class CrsGraph_MapColoring(_object):
"""
Map Coloring of independent columns in a Graph
Generates a Epetra_MapColoring object for which all column indices
form independent sets.
C++ includes: EpetraExt_MapColoring.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CrsGraph_MapColoring, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CrsGraph_MapColoring, name)
__repr__ = _swig_repr
GREEDY = _EpetraExt.CrsGraph_MapColoring_GREEDY
LUBY = _EpetraExt.CrsGraph_MapColoring_LUBY
JONES_PLASSMAN = _EpetraExt.CrsGraph_MapColoring_JONES_PLASSMAN
PSEUDO_PARALLEL = _EpetraExt.CrsGraph_MapColoring_PSEUDO_PARALLEL
__swig_destroy__ = _EpetraExt.delete_CrsGraph_MapColoring
__del__ = lambda self : None;
def __init__(self, *args):
"""
__init__(self, ColoringAlgorithm algo = GREEDY, int reordering = 0,
bool distance1 = False, int verbosity = 0) -> CrsGraph_MapColoring
EpetraExt::CrsGraph_MapColoring::CrsGraph_MapColoring(ColoringAlgorithm
algo=GREEDY, int reordering=0, bool distance1=false, int verbosity=0)
Constructor
"""
this = _EpetraExt.new_CrsGraph_MapColoring(*args)
try: self.this.append(this)
except: self.this = this
def __call__(self, *args):
"""__call__(self, OriginalTypeRef orig) -> NewTypeRef"""
return _EpetraExt.CrsGraph_MapColoring___call__(self, *args)
CrsGraph_MapColoring_swigregister = _EpetraExt.CrsGraph_MapColoring_swigregister
CrsGraph_MapColoring_swigregister(CrsGraph_MapColoring)
class CrsGraph_MapColoringIndex(_object):
"""
Generates a std::vector of Epetra_IntVector's to be used to map
perturbation contributions to a CrsGraph/CrsMatrix from a perturbed
vector.
C++ includes: EpetraExt_MapColoringIndex.h
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CrsGraph_MapColoringIndex, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CrsGraph_MapColoringIndex, name)
__repr__ = _swig_repr
__swig_destroy__ = _EpetraExt.delete_CrsGraph_MapColoringIndex
__del__ = lambda self : None;
def __init__(self, *args):
"""
__init__(self, MapColoring ColorMap) -> CrsGraph_MapColoringIndex
EpetraExt::CrsGraph_MapColoringIndex::CrsGraph_MapColoringIndex(const
Epetra_MapColoring &ColorMap)
Constructor input param ColorMap defines the perturbation coloring
"""
this = _EpetraExt.new_CrsGraph_MapColoringIndex(*args)
try: self.this.append(this)
except: self.this = this
def __call__(self, *args):
"""__call__(self, OriginalTypeRef orig) -> NewTypeRef"""
return _EpetraExt.CrsGraph_MapColoringIndex___call__(self, *args)
CrsGraph_MapColoringIndex_swigregister = _EpetraExt.CrsGraph_MapColoringIndex_swigregister
CrsGraph_MapColoringIndex_swigregister(CrsGraph_MapColoringIndex)
def MatrixMarketFileToMultiVector(*args):
"""
MatrixMarketFileToMultiVector(str filename, Epetra.BlockMap) ->
Epetra.MultiVector
Return a MultiVector read from a matix market file.
int
EpetraExt::MatrixMarketFileToMultiVector(const char *filename, const
Epetra_BlockMap &map, Epetra_MultiVector *&A)
Constructs an Epetra_MultiVector object from a Matrix Market format
file.
This function constructs an Epetra_MultiVector object by reading a
Matrix Market file.
Parameters:
-----------
filename: (In) A filename, including path if desired. The multivector
to be read should be in this file in Matrix Market array format.
map: (In) An Epetra_Map or Epetra_BlockMap object describing the
desired distribution of the multivector.
A: (Out) An Epetra_MultiVector object constructed from file contents.
WARNING: User must delete!!.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.MatrixMarketFileToMultiVector(*args)
def MultiVectorToMatrixMarketFile(*args):
"""
MultiVectorToMatrixMarketFile(char filename, Epetra_MultiVector A, char matrixName = None,
char matrixDescription = None, bool writeHeader = True) -> int
int
EpetraExt::MultiVectorToMatrixMarketFile(const char *filename, const
Epetra_MultiVector &A, const char *matrixName=0, const char
*matrixDescription=0, bool writeHeader=true)
Writes an Epetra_MultiVector object to a Matrix Market format file.
This function takes an Epetra_MultiVector object and writes it to the
specified file. The multivector can be distributed or serial. The user
can provide a strings containing the object name, a description, and
specify that header information should or should not be printed to the
file.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contained any requested header information followed by the matrix
coefficients. The file will contain a row for each entry. All entries
for a column are listed before going to the next column.
A: (In) An Epetra_MultiVector Object containing the user matrix to be
dumped to file.
matrixName: (In) A C-style string pointer to a name that will be
stored in the comment field of the file. This is not a required
argument. Note that it is possible to pass in the method A.Label().
matrixDescription: (In) A C-style string pointer to a matrix
description that will be stored in the comment field of the file.
writeHeader: (In) If true, the header will be written, otherwise only
the matrix entries will be written.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.MultiVectorToMatrixMarketFile(*args)
def MultiVectorToMatlabFile(*args):
"""
MultiVectorToMatlabFile(char filename, Epetra_MultiVector A) -> int
int
EpetraExt::MultiVectorToMatlabFile(const char *filename, const
Epetra_MultiVector &A)
Writes an Epetra_MultiVector object to a file that is compatible with
Matlab.
This function takes any matrix that implements the Epetra_MultiVector
interface and writes it to the specified file. The matrix can be
distributed or serial. This function is a convenience wrapper around
MultiVectorToMatrixMarketFile. The following Matlab commands can be
used to read the resulting file and convert to it to a Matlab sparse
matrix: load filename; For example: load A.dat; The above produces a
dense matrix A with each vector in the multivector as a column in A.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contain a row for each row of the multivector.
A: (In) An Epetra_MultiVector Object containing the user matrix to be
dumped to file.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.MultiVectorToMatlabFile(*args)
def MultiVectorToMatrixMarketHandle(*args):
"""
MultiVectorToMatrixMarketHandle( handle, Epetra_MultiVector A) -> int
int EpetraExt::MultiVectorToMatrixMarketHandle(std::FILE *handle,
const Epetra_MultiVector &A)
Writes an Epetra_MultiVector object that is compatible with Matrix
Market array format to a file handle.
This function takes an Epetra_MultiVector and writes it to the
specified file handle.
Parameters:
-----------
handle: (In) A C-style file handle, already opened. On exit, the file
associated with this handle will have appended to it a row for each
multivector row.
A: (In) An Epetra_MultiVector Object containing the user object to be
dumped to file.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.MultiVectorToMatrixMarketHandle(*args)
def MultiVectorToMatlabHandle(*args):
"""
MultiVectorToMatlabHandle( handle, Epetra_MultiVector A) -> int
int
EpetraExt::MultiVectorToMatlabHandle(std::FILE *handle, const
Epetra_MultiVector &A)
Writes an Epetra_MultiVector object that is compatible with Matlab to
a file handle.
This function takes an Epetra_MultiVector and writes it to the
specified file handle.
Parameters:
-----------
handle: (In) A C-style file handle, already opened. On exit, the file
associated with this handle will have appended to it a row for each
multivector row.
A: (In) An Epetra_MultiVector Object containing the user object to be
dumped to file.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.MultiVectorToMatlabHandle(*args)
def MultiVectorToHandle(*args):
"""
MultiVectorToHandle( handle, Epetra_MultiVector A, bool mmFormat) -> int
int
EpetraExt::MultiVectorToHandle(std::FILE *handle, const
Epetra_MultiVector &A, bool mmFormat)
"""
return _EpetraExt.MultiVectorToHandle(*args)
def writeMultiVector(*args):
"""
writeMultiVector( handle, Epetra_MultiVector A, bool mmFormat) -> int
int
EpetraExt::writeMultiVector(std::FILE *handle, const
Epetra_MultiVector &A, bool mmFormat)
"""
return _EpetraExt.writeMultiVector(*args)
def MatlabFileToCrsMatrix(*args):
"""
MatlabFileToCrsMatrix(str filename, Epetra.Comm) -> Epetra.CrsMatrix
Return a CrsMatrix read from a matlab file.
int
EpetraExt::MatlabFileToCrsMatrix(const char *filename, const
Epetra_Comm &comm, Epetra_CrsMatrix *&A)
Constructs an Epetra_CrsMatrix object from a Matlab format file,
distributes rows evenly across processors.
This function constructs an Epetra_CrsMatrix object by reading a
Matlab (i,j,value) format file.
Parameters:
-----------
filename: (In) A filename, including path if desired. The matrix to
be read should be in this file in Matlab coordinate format.
comm: (In) An Epetra_Comm object. The matrix will have its rows
distributed evenly by row-count across the parallel machine.
A: (Out) An Epetra_CrsMatrix object constructed from file contents.
The input matrix can be any dimension, square or rectangular.
WARNING: User must delete matrix A!!.
Returns 0 if no error, -1 if any problems with file system. Notes:
The file will be read twice: first to get the maximum row and column
dimensions. Next to insert values.
The global row and column dimensions will be determined by the maximum
row and column index, respectively, contained in the file. If some
rows or columns are empty they will still be present in the matrix.
The format expected for the input file is a list of nonzero entries
with one entry per row. Each row will have the row index, column index
and value listed with space in between each item. The number of lines
in the file should be exactly the number of entries of the matrix. For
example, consider the following matrix where only the nonzero values
are stored:
\\[ \\left[\\begin{array}{cccc} 5 & 7 & 0 & 0 \\\\ 3 & 2 & 0
& 1 \\\\ 0 & 0 & 0 & 4 \\\\ \\end{array}\\right]. \\]
A Matlab format file for this matrix would be: 1 1 5.0 1 2 7.0 2 1 3.0
2 2 2.0 2 4 1.0 4 4 4.0
Note that the entries can be listed in any order and that the matrix
does not need to be square. Values in the first and second columns
must be integer values and in those in the third column must be
floating point format.
(See the <a href="http://www.mathworks.com">Matlab</a> home page for
details.)
"""
return _EpetraExt.MatlabFileToCrsMatrix(*args)
def HypreFileToCrsMatrix(*args):
"""
HypreFileToCrsMatrix(char filename, Comm comm) -> int
int
EpetraExt::HypreFileToCrsMatrix(const char *filename, const
Epetra_Comm &comm, Epetra_CrsMatrix *&A)
Constructs an Epetra_CrsMatrix object from a Hypre Matrix Print
command, the row map is specified.
Reads an Epetra_CrsMatrix object from a Hypre Matrix Printout, the
matrix should be square.
Parameters:
-----------
filename: (In) A filename not including the processor id extension,
including path if desired.
comm: (In) An Epetra_Comm object describing the communication among
processors.
A: (Out) An Epetra_CrsMatrix object constructed from file contents.
WARNING: User must delete!!.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.HypreFileToCrsMatrix(*args)
def MatrixMarketFileToCrsMatrixHandle(*args):
"""
MatrixMarketFileToCrsMatrixHandle(char filename, Comm comm, Map rowMap = None, Map colMap = None,
Map rangeMap = None, Map domainMap = None,
bool transpose = 0, bool verbose = 0) -> int
int EpetraExt::MatrixMarketFileToCrsMatrixHandle(const char *filename,
const Epetra_Comm &comm, Epetra_CrsMatrix *&A, const Epetra_Map
*rowMap, const Epetra_Map *colMap, const Epetra_Map *rangeMap, const
Epetra_Map *domainMap, const bool transpose, const bool verbose)
"""
return _EpetraExt.MatrixMarketFileToCrsMatrixHandle(*args)
def RowMatrixToMatrixMarketFile(*args):
"""
RowMatrixToMatrixMarketFile(char filename, RowMatrix A, char matrixName = None,
char matrixDescription = None, bool writeHeader = True) -> int
int
EpetraExt::RowMatrixToMatrixMarketFile(const char *filename, const
Epetra_RowMatrix &A, const char *matrixName=0, const char
*matrixDescription=0, bool writeHeader=true)
Writes an Epetra_RowMatrix object to a Matrix Market format file.
This function takes any matrix that implements the Epetra_RowMatrix
interface and writes it to the specified file. The matrix can be
distributed or serial. The user can provide a strings containing the
matrix name, a matrix description, and specify that header information
should or should not be printed to the file.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contained any requested header information followed by the matrix
coefficients. The file will contain a row for each matrix entry The
first column is the global row index, using base 1, the second column
is the global column index of the entry, the third value is the matrix
value for that entry.
A: (In) An Epetra_RowMatrix Object containing the user matrix to be
dumped to file. Any object that implements the Epetra_RowMatrix
interface can be passed in. In particular, the Epetra_CrsMatrix,
Epetra_VbrMatrix, Epetra_FECrsMatrix, Epetra_FEVbrMatrix and
Epetra_MsrMatrix classes are compatible with this interface.
matrixName: (In) A C-style std::string pointer to a name that will be
stored in the comment field of the file. This is not a required
argument. Note that it is possible to pass in the method A.Label() if
the matrix is one of the four types: Epetra_CrsMatrix,
Epetra_VbrMatrix, Epetra_FECrsMatrix, Epetra_FEVbrMatrix.
matrixDescription: (In) A C-style std::string pointer to a matrix
description that will be stored in the comment field of the file.
writeHeader: (In) If true, the header will be written, otherwise only
the matrix entries will be written.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.RowMatrixToMatrixMarketFile(*args)
def RowMatrixToMatlabFile(*args):
"""
RowMatrixToMatlabFile(char filename, RowMatrix A) -> int
int
EpetraExt::RowMatrixToMatlabFile(const char *filename, const
Epetra_RowMatrix &A)
Writes an Epetra_RowMatrix object to a file that is compatible with
Matlab.
This function takes any matrix that implements the Epetra_RowMatrix
interface and writes it to the specified file. The matrix can be
distributed or serial. This function is a convenience wrapper around
RowMatrixToMatrixMarketFile. The following Matlab commands can be used
to read the resulting file and convert to it to a Matlab sparse
matrix: load filename;
matrix_name = spconvert(filename_root); For example: load A.dat;
A = spconvert(filename_root); The above produces a sparse matrix A.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contain a row for each matrix entry The first column is the global row
index, using base 1, the second column is the global column index of
the entry, the third value is the matrix value for that entry.
A: (In) An Epetra_RowMatrix Object containing the user matrix to be
dumped to file. Any object that implements the Epetra_RowMatrix
interface can be passed in. In particular, the Epetra_CrsMatrix,
Epetra_VbrMatrix, Epetra_FECrsMatrix, Epetra_FEVbrMatrix and
Epetra_MsrMatrix classes are compatible with this interface.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.RowMatrixToMatlabFile(*args)
def RowMatrixToHandle(*args):
"""
RowMatrixToHandle( handle, RowMatrix A) -> int
int
EpetraExt::RowMatrixToHandle(std::FILE *handle, const Epetra_RowMatrix
&A)
Writes an Epetra_RowMatrix object to a format file that is compatible
with Matlab.
This function takes any matrix that implements the Epetra_RowMatrix
interface and writes it to the specified file handle. The matrix can
be distributed or serial. This function is a convenience wrapper
around RowMatrixToMatrixMarketFile.
Parameters:
-----------
handle: (In) A C-style file handle, already opened. On exit, the file
associated with this handle will have appended to it a row for each
matrix entry The first column is the global row index, using base 1,
the second column is the global column index of the entry, the third
value is the matrix value for that entry.
A: (In) An Epetra_RowMatrix Object containing the user matrix to be
dumped to file. Any object that implements the Epetra_RowMatrix
interface can be passed in. In particular, the Epetra_CrsMatrix,
Epetra_VbrMatrix, Epetra_FECrsMatrix, Epetra_FEVbrMatrix and
Epetra_MsrMatrix classes are compatible with this interface.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.RowMatrixToHandle(*args)
def writeRowMatrix(*args):
"""
writeRowMatrix( handle, RowMatrix A) -> int
int
EpetraExt::writeRowMatrix(std::FILE *handle, const Epetra_RowMatrix
&A)
"""
return _EpetraExt.writeRowMatrix(*args)
def MatrixMarketFileToBlockMap(*args):
"""
MatrixMarketFileToBlockMap(str filename, Epetra.Comm) -> Epetra.BlockMap
Return a BlockMap read from a matrix market file.
int
EpetraExt::MatrixMarketFileToBlockMap(const char *filename, const
Epetra_Comm &comm, Epetra_BlockMap *&blockMap)
Constructs an Epetra_BlockMap object from a Matrix Market format file.
This function constructs an Epetra_BlockMap or Epetra_Map object by
reading a Matrix Market file. If the file was created using the
EpetraExt::BlockMapOut functions, special information was encoded in
the comment field of this map that allows for identical reproduction
of the map, including distribution across processors and element size
information. If the same of processors is being used to create the
object as were used to write it, the object will be an exact
reproduction of the original. Otherwise, a uniform distribution of the
GIDs will be created.
The first column of the input file will must be the list of GIDs in
the map. If the block map has non-uniform sizes, a second column must
contain the element sizes.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contained any requested header information followed by the map GIDs. A
second column may be present if the BlockMap has nonuniform sizes.
comm: (In) An Epetra_Comm object describing the parallel machine.
blockMap: (Out) An Epetra_BlockMap object constructed from file
contents.
WARNING: User must delete!!.
Returns 0 if no error, -1 if any problems with file system, returns 1
if number of processors differs from file creator.
"""
return _EpetraExt.MatrixMarketFileToBlockMap(*args)
def MatrixMarketFileToMap(*args):
"""
MatrixMarketFileToMap(str filename, Epetra.Comm) -> Epetra.Map
Return a Map read from a matrix market file.
int
EpetraExt::MatrixMarketFileToMap(const char *filename, const
Epetra_Comm &comm, Epetra_Map *&map)
Constructs an Epetra_BlockMap object from a Matrix Market format file.
This function constructs an Epetra_BlockMap or Epetra_Map object by
reading a Matrix Market file. If the file was created using the
EpetraExt::BlockMapOut functions, special information was encoded in
the comment field of this map that allows for identical reproduction
of the map, including distribution across processors and element size
information. If the same of processors is being used to create the
object as were used to write it, the object will be an exact
reproduction of the original. Otherwise, a uniform distribution of the
GIDs will be created.
The first column of the input file will must be the list of GIDs in
the map. If the block map has non-uniform sizes, a second column must
contain the element sizes.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contained any requested header information followed by the map GIDs. A
second column may be present if the BlockMap has nonuniform sizes.
comm: (In) An Epetra_Comm object describing the parallel machine.
map: (Out) An Epetra_Map object constructed from file contents.
WARNING: User must delete!!.
Returns 0 if no error, -1 if any problems with file system, -2 if file
contained nontrivial Epetra_BlockMap, 1 if number of processors
differs from file creator.
"""
return _EpetraExt.MatrixMarketFileToMap(*args)
def MatrixMarketFileToBlockMaps(*args):
"""
MatrixMarketFileToBlockMaps(str filename, Epetra.Comm) ->
(Epetra.BlockMap rowMap, Epetra.BlockMap colMap, Epetra.BlockMap rangeMap,
Epetra.BlockMap domainMap)
Return a tuple of BlockMaps read from a matrix market file. The
BlockMaps, listed in order, are the row map, the column map, the range
map and the domain map.
int
EpetraExt::MatrixMarketFileToBlockMaps(const char *filename, const
Epetra_Comm &comm, Epetra_BlockMap *&rowmap, Epetra_BlockMap *&colmap,
Epetra_BlockMap *&rangemap, Epetra_BlockMap *&domainmap)
Constructs row,col,range and domain maps from a matrix-market matrix
file.
"""
return _EpetraExt.MatrixMarketFileToBlockMaps(*args)
def BlockMapToMatrixMarketFile(*args):
"""
BlockMapToMatrixMarketFile(char filename, BlockMap blockMap, char mapName = None,
char mapDescription = None, bool writeHeader = True) -> int
int
EpetraExt::BlockMapToMatrixMarketFile(const char *filename, const
Epetra_BlockMap &blockMap, const char *mapName=0, const char
*mapDescription=0, bool writeHeader=true)
Writes an Epetra_BlockMap or Epetra_Map object to a Matrix Market
format file.
This function takes an Epetra_BlockMap or Epetra_Map object and writes
it to the specified file. The map can be distributed or serial. The
user can provide a strings containing the object name, a description,
and specify that header information should or should not be printed to
the file.
Special information is encoded in the comment field of this map that
allows for identical reproduction of the map, including distribution
across processors and element size information.
The first column of the output file will be the list of GIDs in the
map. If the block map has non-uniform sizes, a second column will be
generated containing the element sizes.
Parameters:
-----------
filename: (In) A filename, including path if desired. If a file with
this name already exists, it will be deleted. On exit, this file will
contained any requested header information followed by the map GIDs. A
second column may be present if the BlockMap has nonuniform sizes.
blockMap: (In) An Epetra_BlockMap Object containing the user map to
be dumped to file.
mapName: (In) A C-style string pointer to a name that will be stored
in the comment field of the file. This is not a required argument.
Note that it is possible to pass in the method A.Label().
mapDescription: (In) A C-style string pointer to a map description
that will be stored in the comment field of the file.
writeHeader: (In) If true, the header will be written, otherwise only
the map entries will be written.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.BlockMapToMatrixMarketFile(*args)
def BlockMapToHandle(*args):
"""
BlockMapToHandle( handle, BlockMap blockMap) -> int
int
EpetraExt::BlockMapToHandle(std::FILE *handle, const Epetra_BlockMap
&blockMap)
Writes an Epetra_BlockMap or Epetra_Map object to a file handle.
This function takes an Epetra_BlockMap or Epetra_Map object and writes
it to the specified file handle.
Parameters:
-----------
handle: (In) A C-style file handle, already opened. On exit, the file
associated with this handle will have appended to it a row for each
multivector row.
blockMap: (In) An Epetra_BlockMap object containing the user object
to be dumped to file.
Returns 0 if no error, -1 if any problems with file system.
"""
return _EpetraExt.BlockMapToHandle(*args)
def writeBlockMap(*args):
"""
writeBlockMap( handle, int length, int v1, int v2, bool doSizes) -> int
int
EpetraExt::writeBlockMap(std::FILE *handle, int length, const int *v1,
const int *v2, bool doSizes)
"""
return _EpetraExt.writeBlockMap(*args)
def Add(*args):
"""
Add(Epetra.CrsMatrix A, bool flag, float valA, Epetra.CrsMatrix B,
float valB) -> int
Compute B <- valA * A + valB * B. If flag is True, use the transpose
of A. B must either have the structure of A+B or not yet have
FillComplete() called on it.
"""
return _EpetraExt.Add(*args)
def Multiply(*args):
"""
Multiply(Epetra.CrsMatrix A, bool transposeA, Epetra.CrsMatrix B, bool
transposeB, Epetra.CrsMatrix C) -> int
Compute C <- A * B, where transposeA and transposeB control the
transposition of A and B respectively. C must have the structure of A
* B, or not yet have FillComplete() called on it.
"""
return _EpetraExt.Multiply(*args)
from PyTrilinos import Epetra
from PyTrilinos import PropertyBase
from PyTrilinos import typed_tuple
from PyTrilinos import tuple_of_int
from PyTrilinos import tuple_of_str
tuple_of_Vector = typed_tuple(Epetra.Vector)
class InArgs(PropertyBase):
"""
InArgs proxy class.
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
description - string description of associated ModelEvaluation
x - bool or Epetra.Vector: solution vector support. If True, the
solver should allocate the vector. If False, x is not
supported. If a vector, the solver should use the
user-provided data. (default False)
x_dot - bool or Epetra.Vector: time derivative of solution vector
support. If True, the solver should allocate the vector. If
False, x_dot is not supported. If a vector, the solver
should use the user- provided data. (default False)
p - int or tuple_of_Vector: VARIABLE P support. If an int, the
solver should allocate an array of the given number of
vectors. If 0, p is not supported. If a tuple_of_Vector,
the solver should use the user-provided data. (default 0)
t - float: time (default None)
alpha - float: VARIABLE ALPHA (default None)
beta - float: VARIABLE BETA (default None)
"""
props = {'description' : str,
'x' : (bool, Epetra.Vector),
#'x_poly' : Teuchos.Polynomial,
'x_dot' : (bool, Epetra.Vector),
#'x_dot_poly' : Teuchos.Polynomial,
'p' : (int, tuple_of_Vector),
't' : float,
'alpha' : float,
'beta' : float
}
defaults = {'description' : 'WARNING! THIS INARGS OBJECT IS UNINITALIZED!',
'x' : False,
'x_dot' : False,
'p' : 0
}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
class Evaluation(PropertyBase):
"""
Evaluation< RCP<Epetra_Vector> > proxy class
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
vector - Epetra.Vector: (default None)
type - str: an enumeration limited to 'exact', 'approx_deriv', and
'very_approx_deriv' (default None)
"""
props = {'vector' : Epetra.Vector,
'type' : ('exact', 'approx_deriv', 'very_approx_deriv')
}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
tuple_of_Evaluation = typed_tuple(Evaluation)
class DerivativeSupport(PropertyBase):
"""
DerivativeSupport proxy class
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
linearOp - bool: True indicates that derivative is a linear operator
(default False)
mVByCol - bool: True indicates that derivative is a MultiVector stored
by column (defualt False)
transMVByRow - bool: True indicates that derivative is a transpose
MultiVector stored by row (default False)
"""
props = {'linearOp' : bool,
'mVByCol' : bool,
'transMVByRow' : bool
}
defaults = {'linearOp' : False,
'mVByCol' : False,
'transMVByRow' : False
}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
def none(self):
noTrue = [True] * len(self.props)
return (props.values() == noTrue)
tuple_of_DerivativeSupport = typed_tuple(DerivativeSupport)
class DerivativeProperties(PropertyBase):
"""
DerivativeProperties proxy class
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
linearity - str: an enumeration limited to 'unknown', 'const' and
'nonconst' (default 'unknown')
rank - str: an enumeration limited to 'unknown', 'full' and
'deficient' (default 'unknown')
supportsAdjoint - bool: True indicates that the adjoint is supported
(default False)
"""
props = {'linearity' : ('unknown', 'const', 'nonconst'),
'rank' : ('unknown', 'full', 'deficient'),
'supportsAdjoint' : bool}
defaults = {'linearity' : 'unknown',
'rank' : 'unknown',
'supportsAdjoint' : False}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
tuple_of_DerivativeProperties = typed_tuple(DerivativeProperties)
class DerivativeMultiVector(PropertyBase):
"""
DerivativeMultiVector proxy class
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
multiVector - Epetra.MultiVector: (default None)
orientation - str: an enumeration limited to 'mv_by_col', and
'trans_mv_by_row' (default None)
paramIndexes - tuple_of_int: (default None)
"""
props = {'multiVector' : Epetra.MultiVector,
'orientation' : ('mv_by_col', 'trans_mv_by_row'),
'paramIndexes' : tuple_of_int
}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
class Derivative(PropertyBase):
"""
Derivative proxy class
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
operator - Epetra.Operator (default None)
derivativeMultiVector - DerivativeMultiVector (default None)
Only one or the other of these two attributes should be set, to indicate the
nature of the derivitive evaluation.
"""
props = {'operator' : Epetra.Operator,
'derivativeMultiVector' : DerivativeMultiVector
}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
def isEmpty(self):
return (self.operator is None) and (self.derivativeMultiVector is None)
tuple_of_Derivative = typed_tuple(Derivative)
class OutArgs(PropertyBase):
"""
OutArgs proxy class
This is a 'Property' class restricted to specific attributes that are
type-checked. These properties are:
description - string description of associated ModelEvaluation
g - (int, tuple_of_Evaluation): VARIABLE G support. If
an int, the solver should allocate an array of the
given number of Evaluations. If 0, g is not
supported. If a tuple_of_Evaluation, the solver
should use the user-provided data. (default 0)
f - (bool, Evaluation): VARIABLE F support. If True, the
solver should allocate the Evaluation. If False, f
is not supported. If an Evaluation, the solver
should use the user-supplied data. (default False)
W - (bool, Epetra.Operator): VARIABLE W support. If True, the
solver should allocate the operator. If False, W
is not supported. If an operator, the solver
should use the user-supplied data. (default False)
W_properties - DerivativeProperties: derivative properties for
VARIABLE W. (default None)
DfDp - (int, tuple_of_Derivative): VARIABLE DFDP support. If
an int, the solver should allocate an array of the
given number of Derivatives. If 0, DfDp is not
supported. If a tuple_of_Derivative, the solver
should use the user-provided data. (default 0)
DfDp_properties - tuple_of_DerivativeProperties: derivative properties
for VARIABLE DFDP. (default None)
DgDx - (int, tuple_of_Derivative): VARIABLE DGDX support. If
an int, the solver should allocate an array of the
given number of Derivatives. If 0, DgDx is not
supported. If a tuple_of_Derivative, the solver
should use the user-provided data. (default 0)
DgDx_properties - tuple_of_DerivativeProperties: derivative properties
for VARIABLE DGDX. (default None)
DgDx_dot - (int, tuple_of_Derivative): VARIABLE DGDX_DOT support.
If an int, the solver should allocate an array of the
given number of Derivatives. If 0, DgDx_dot is not
supported. If a tuple_of_Derivative, the solver
should use the user-provided data. (default 0)
DgDx_dot_properties - tuple_of_DerivativeProperties: derivative properties
for VARIABLE DGDX_DOT. (default None)
DgDp - (int, tuple_of_Derivative): VARIABLE DGDP support. If
an int, the solver should allocate an array of the
given number of Derivatives. If 0, DgDp is not
supported. If a tuple_of_Derivative, the solver
should use the user-provided data. (default 0)
DgDp_properties - tuple_of_DerivativeProperties: derivative properties
for VARIABLE DGDP. (default None)
"""
props = {'description' : str,
'g' : (int, tuple_of_Evaluation),
'f' : (bool, Evaluation),
'W' : (bool, Epetra.Operator),
'W_properties' : DerivativeProperties,
#'f_poly' : Teuchos.Polynomial,
'DfDp' : (int, tuple_of_Derivative),
'DfDp_properties' : tuple_of_DerivativeProperties,
'DgDx' : (int, tuple_of_Derivative),
'DgDx_properties' : tuple_of_DerivativeProperties,
'DgDx_dot' : (int, tuple_of_Derivative),
'DgDx_dot_properties' : tuple_of_DerivativeProperties,
'DgDp' : (int, tuple_of_Derivative),
'DgDp_properties' : tuple_of_DerivativeProperties
}
defaults = {'description' : 'WARNING! THIS OUTARGS OBJECT IS UNINITALIZED!',
'g' : 0,
'f' : False,
'W' : False,
'DfDp' : 0,
'DgDx' : 0,
'DgDx_dot' : 0,
'DgDp' : 0
}
def __init__(self, **kwargs):
PropertyBase.__init__(self, **kwargs)
class ModelEvaluator(Teuchos.Describable):
"""Proxy of C++ EpetraExt::ModelEvaluator class"""
__swig_setmethods__ = {}
for _s in [Teuchos.Describable]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ModelEvaluator, name, value)
__swig_getmethods__ = {}
for _s in [Teuchos.Describable]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{}))
__getattr__ = lambda self, name: _swig_getattr(self, ModelEvaluator, name)
__repr__ = _swig_repr
__swig_destroy__ = _EpetraExt.delete_ModelEvaluator
__del__ = lambda self : None;
def get_x_map(self, *args):
"""get_x_map(self) -> Teuchos::RefCountPtr<(q(const).Epetra_Map)>"""
return _EpetraExt.ModelEvaluator_get_x_map(self, *args)
def get_f_map(self, *args):
"""get_f_map(self) -> Teuchos::RefCountPtr<(q(const).Epetra_Map)>"""
return _EpetraExt.ModelEvaluator_get_f_map(self, *args)
def get_p_map(self, *args):
"""get_p_map(self, int l) -> Teuchos::RefCountPtr<(q(const).Epetra_Map)>"""
return _EpetraExt.ModelEvaluator_get_p_map(self, *args)
def get_p_names(self, *args):
"""get_p_names(self, int l) -> Teuchos::RefCountPtr<(q(const).Teuchos::Array<(std::string)>)>"""
return _EpetraExt.ModelEvaluator_get_p_names(self, *args)
def get_g_map(self, *args):
"""get_g_map(self, int j) -> Teuchos::RefCountPtr<(q(const).Epetra_Map)>"""
return _EpetraExt.ModelEvaluator_get_g_map(self, *args)
def get_x_init(self, *args):
"""get_x_init(self) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_x_init(self, *args)
def get_x_dot_init(self, *args):
"""get_x_dot_init(self) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_x_dot_init(self, *args)
def get_p_init(self, *args):
"""get_p_init(self, int l) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_p_init(self, *args)
def get_t_init(self, *args):
"""get_t_init(self) -> double"""
return _EpetraExt.ModelEvaluator_get_t_init(self, *args)
def getInfBound(self, *args):
"""getInfBound(self) -> double"""
return _EpetraExt.ModelEvaluator_getInfBound(self, *args)
def get_x_lower_bounds(self, *args):
"""get_x_lower_bounds(self) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_x_lower_bounds(self, *args)
def get_x_upper_bounds(self, *args):
"""get_x_upper_bounds(self) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_x_upper_bounds(self, *args)
def get_p_lower_bounds(self, *args):
"""get_p_lower_bounds(self, int l) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_p_lower_bounds(self, *args)
def get_p_upper_bounds(self, *args):
"""get_p_upper_bounds(self, int l) -> Teuchos::RefCountPtr<(q(const).Epetra_Vector)>"""
return _EpetraExt.ModelEvaluator_get_p_upper_bounds(self, *args)
def get_t_lower_bound(self, *args):
"""get_t_lower_bound(self) -> double"""
return _EpetraExt.ModelEvaluator_get_t_lower_bound(self, *args)
def get_t_upper_bound(self, *args):
"""get_t_upper_bound(self) -> double"""
return _EpetraExt.ModelEvaluator_get_t_upper_bound(self, *args)
def create_W(self, *args):
"""create_W(self) -> Teuchos::RefCountPtr<(Epetra_Operator)>"""
return _EpetraExt.ModelEvaluator_create_W(self, *args)
def create_DfDp_op(self, *args):
"""create_DfDp_op(self, int l) -> Teuchos::RefCountPtr<(Epetra_Operator)>"""
return _EpetraExt.ModelEvaluator_create_DfDp_op(self, *args)
def create_DgDx_dot_op(self, *args):
"""create_DgDx_dot_op(self, int j) -> Teuchos::RefCountPtr<(Epetra_Operator)>"""
return _EpetraExt.ModelEvaluator_create_DgDx_dot_op(self, *args)
def create_DgDx_op(self, *args):
"""create_DgDx_op(self, int j) -> Teuchos::RefCountPtr<(Epetra_Operator)>"""
return _EpetraExt.ModelEvaluator_create_DgDx_op(self, *args)
def create_DgDp_op(self, *args):
"""create_DgDp_op(self, int j, int l) -> Teuchos::RefCountPtr<(Epetra_Operator)>"""
return _EpetraExt.ModelEvaluator_create_DgDp_op(self, *args)
def createInArgs(self, *args):
"""createInArgs(self) -> InArgs"""
return _EpetraExt.ModelEvaluator_createInArgs(self, *args)
def createOutArgs(self, *args):
"""createOutArgs(self) -> OutArgs"""
return _EpetraExt.ModelEvaluator_createOutArgs(self, *args)
def evalModel(self, *args):
"""evalModel(self, InArgs inArgs, OutArgs outArgs)"""
return _EpetraExt.ModelEvaluator_evalModel(self, *args)
def __init__(self, *args):
"""__init__(self) -> ModelEvaluator"""
if self.__class__ == ModelEvaluator:
_self = None
else:
_self = self
this = _EpetraExt.new_ModelEvaluator(_self, *args)
try: self.this.append(this)
except: self.this = this
def __disown__(self):
self.this.disown()
_EpetraExt.disown_ModelEvaluator(self)
return weakref_proxy(self)
ModelEvaluator_swigregister = _EpetraExt.ModelEvaluator_swigregister
ModelEvaluator_swigregister(ModelEvaluator)
def MatrixMarketFileToCrsMatrix(*args):
"""
MatrixMarketFileToCrsMatrix(str filename, Epetra.Map rowMap, Epetra.Map
colMap=None, Epetra.Map rangeMap=None, Epetra.Map domainMap=None) ->
Epetra.CrsMatrix
Return a CrsMatrix read from a matrix market file.
MatrixMarketFileToCrsMatrix(str filename, Epetra.Map rowMap, Epetra.Map
colMap=None, Epetra.Map rangeMap=None, Epetra.Map domainMap=None) ->
Epetra.CrsMatrix
Return a CrsMatrix read from a matrix market file.
MatrixMarketFileToCrsMatrix(str filename, Epetra.Map rowMap, Epetra.Map
colMap=None, Epetra.Map rangeMap=None, Epetra.Map domainMap=None) ->
Epetra.CrsMatrix
Return a CrsMatrix read from a matrix market file.
MatrixMarketFileToCrsMatrix(str filename, Epetra.Map rowMap, Epetra.Map
colMap=None, Epetra.Map rangeMap=None, Epetra.Map domainMap=None) ->
Epetra.CrsMatrix
Return a CrsMatrix read from a matrix market file.
MatrixMarketFileToCrsMatrix(str filename, Epetra.Map rowMap, Epetra.Map
colMap=None, Epetra.Map rangeMap=None, Epetra.Map domainMap=None) ->
Epetra.CrsMatrix
Return a CrsMatrix read from a matrix market file.
int
EpetraExt::MatrixMarketFileToCrsMatrix(const char *filename, const
Epetra_Map &rowMap, const Epetra_Map &colMap, const Epetra_Map
&rangeMap, const Epetra_Map &domainMap, Epetra_CrsMatrix *&A, const
bool transpose=0, const bool verbose=0)
Constructs an Epetra_CrsMatrix object from a Matrix Market format
file, row, column, range and domain map specified; this version is
seldom required unless you want explicit control over column map.
Reads an Epetra_CrsMatrix object from a matrix-market file, but uses
the specified maps for constructing and 'FillComplete()'ing the
matrix. Successfully creates rectangular matrices.
Parameters:
-----------
filename: (In) A filename, including path if desired. The matrix to
be read should be in this file in Matrix Market coordinate format.
rowMap: (In) An Epetra_Map object describing the desired row
distribution of the matrix.
colMap: (In) An Epetra_Map object describing the desired column
distribution of the matrix.
rangeMap: (In) An Epetra_Map object describing the distribution of
range vectors that will be used with this matrix, must be 1-to-1.
domainMap: (In) An Epetra_Map object describing the distribution of
domain vectors that will be used with this matrix, must be 1-to-1.
transpose: (In) A boolean value indicating whether the reader should
transpose the matrix as it is read into matrix A. (default = 0).
verbose: (In) A boolean value indicating whether the reader should
print diagnostic statements to stdout. (default = 0).
A: (Out) An Epetra_CrsMatrix object constructed from file contents.
WARNING: User must delete!!.
Returns 0 if no error, -1 if any problems with file system. (See the
<a href="http://math.nist.gov/MatrixMarket">Matrix Market</a> home
page for details.)
"""
return _EpetraExt.MatrixMarketFileToCrsMatrix(*args)
# This file is compatible with both classic and new-style classes.
|