小编fon*_*nsi的帖子

如何在Python 2.7中实现GMRES的ILU预处理器?

我试图比较使用和不使用ILU预处理器的GMRES求解器.它运行并在未应用预处理器时提供正确的答案(x=[1,1,1]).但是,我似乎无法找到正确应用预处理器的方法.

如何让这段代码与ILU预处理器一起运行?

import numpy as np
import scipy.sparse.linalg as spla

A = np.array([[ 0.4445,  0.4444, -0.2222],
              [ 0.4444,  0.4445, -0.2222],
              [-0.2222, -0.2222,  0.1112]])

b = np.array([[ 0.6667], 
              [ 0.6667], 
              [-0.3332]])

M2 = spla.spilu(A)

x = spla.gmres(A,b,M=M2)

print x
Run Code Online (Sandbox Code Playgroud)

python scipy python-2.7

3
推荐指数
1
解决办法
1995
查看次数

OpenLayers - 如何显示特征的标签?

我尝试过以不同的方式来显示功能的标签,但没有成功。

我定义了一个功能:

var pointFeature = new ol.Feature(wha, {label: "Airport"});
Run Code Online (Sandbox Code Playgroud)

如何让“机场”一词显示在要素的位置(纬度/经度)处?

我是 OpenLayers 的新手,所以如果答案非常简单,我深表歉意。这是完整的代码:

<!DOCTYPE html>
<html>
<head>
<title>IGC example</title>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="http://openlayers.org/en/v3.10.1/css/ol.css" type="text/css">
<script src="http://openlayers.org/en/v3.10.1/build/ol.js"></script>

</head>
<body><div class="ALL">

<div class="container-fluid">

<div class="row-fluid">
  <div class="span12">
    <div id="map" class="map">
    </div>
    <input id="time" type="range" value="0" steps="1" />
    <div class="span4 offset4 pull-right">
      <div id="info" class="alert alert-success">
        &nbsp;
      </div>
    </div>
  </div>
</div>

</div></div>
<script>

            // Geometries
            var wha     = new ol.geom.Circle(ol.proj.transform([-96.1543889, 29.2542778], 'EPSG:4326', 'EPSG:3857'), 400);
            var circle  = …
Run Code Online (Sandbox Code Playgroud)

openlayers

2
推荐指数
1
解决办法
8208
查看次数

如何使用dat.GUI更改几何颜色?

我有以下代码来呈现一个简单的多维数据集。它具有dat.GUI控件来更改旋转,我也想添加一个颜色转换器。最终,我希望具有更复杂的几何形状,并希望能够更改多个元素的颜色。

$(function(){
        var scene = new THREE.Scene();
        var camera = new THREE.PerspectiveCamera(45, window.innerWidth/window.innerHeight, .1, 500);
        var renderer = new THREE.WebGLRenderer();

        renderer.setClearColor(0xdddddd);
        renderer.setSize(window.innerWidth, window.innerHeight);
        renderer.shadowMapEnabled = true;
        renderer.shadowMapSoft = true;

        var axis = new THREE.AxisHelper(10);
        scene.add (axis);

        var grid  = new THREE.GridHelper(50, 5);
        var color = new THREE.Color("rgb(255,0,0)");
        grid.setColors(color, 0x000000);

        scene.add(grid);

        var cubeGeometry = new THREE.BoxGeometry(5, 5, 5);
        var cubeMaterial = new THREE.MeshLambertMaterial({color:0x80ff});
        var cube = new THREE.Mesh(cubeGeometry, cubeMaterial);

        var planeGeometry = new THREE.PlaneGeometry(30,30,30);
        var planeMaterial = new THREE.MeshLambertMaterial({color:0xffffff});
        var plane …
Run Code Online (Sandbox Code Playgroud)

three.js

0
推荐指数
1
解决办法
1115
查看次数

标签 统计

openlayers ×1

python ×1

python-2.7 ×1

scipy ×1

three.js ×1