我对使用HLSL在GPU上实现算法感兴趣,但我主要担心的一个问题是我想要一个可变级别的精度.是否存在可以在GPU上实现64位精度和更高精度的技术.
谢谢!
我有一个boost :: asio的服务器工作正常,除了我正在尝试添加一个检查,没有其他任何接受同一端口上的连接.如果我创建了两个服务器,其中一个始终接受连接,但另一个不报告任何错误(两个中的哪一个接受所有连接似乎是随机的).
服务器类的相关位(它是使用具有Accepted()和typedef的基类的模板,用于创建连接类型):
MessageServer ( boost::asio::io_service &io, unsigned short port_num )
: BaseServerType ( io ), acceptor_ ( io, boost::asio::ip::tcp::endpoint ( boost::asio::ip::tcp::v4(), port_num ) ) {
Listen();
}
void Listen () {
boost::system::error_code ec;
acceptor_.listen ( boost::asio::socket_base::max_connections, ec );
if ( !ec ) {
start_accept();
} else {
// not reached even if a separate process
// is already listening to that port
connection_pointer new_connection;
BaseServerType::Accepted ( new_connection );
}
}
private:
void start_accept() {
connection_pointer new_connection ( CreateConnection …Run Code Online (Sandbox Code Playgroud) 我有一个表示有向图的数据结构,我正在寻找一个好的Silverlight可视化,允许我从一个节点导航到另一个节点,最好是一些不错的动画.
有没有人知道这种显示器的任何良好的UI控件或框架?甚至来自另一个领域的样本(也许是社交网络?).我的图表没有很多节点,因此性能不会成为问题.
我见过用于Java(和Flash)的Prefuse库,这将是理想的."兴趣度"可视化是我追求的东西,但我在Silverlight中找不到任何东西.
谢谢你的任何提示.
有谁知道无损压缩算法,它产生无头输出?例如,不要存储用于压缩它的霍夫曼树?我不谈论硬编码的霍夫曼树,但我想知道是否有任何算法可以压缩和解压缩输入而不在其输出中存储一些元数据.或者这在理论上是不可能的?
我正在寻找一个良好的数据结构来在树的节点上构建等价类.在理想的结构中,以下操作应该是快速的(适当的O(1)/ O(n))和容易(没有神秘代码的段落):
到目前为止,我已经考虑过(其中一些可以组合使用):
我错过了一个甜蜜的选择吗?
language-agnostic algorithm tree equivalence-classes data-structures
为什么最优先级/堆队列实现为0是最高优先级?我假设我错过了一些关键的数学原理.当我最近实现自己的优先级队列时,如果优先级随着整数值的增加而编写插入函数似乎更容易,但显然比我聪明的人认为应该采用另一种方式.
有任何想法吗?
我有一个应用程序,需要将一个数字提高到一个分数幂.目标平台是一个FPGA,我可以得到它的FPU大小的估计,但我需要一个算法,只是为了可行性研究将数字提高到一个分数功率.我假设浮点数是最坏的情况,我预计在实践中我们将能够使用捷径,但是现在我想表明我们可以实施最坏情况.
以为我会问这里,看看是否有任何常见的方法可以结账.我知道有这样做的软件方法,我想要一个合理有效的算法开始.我会担心FPGA的实现.
好吧,我已经编写了一些代码来反转六角形字符作为我组成的有趣练习的一部分.
这就是我现在所拥有的:
#include <stdio.h>
int main() {
char a,b,c;
while (1) {
c = getchar();
if (!feof(stdin)) {
a = c % 16;
b = (c - a) / 16;
c = (a*16) + b;
putchar(c);
}else{break;}
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
它适用于大多数值.例如,0xA0变为0x0A等...
但是,以"F"开头的值并不能很好地发挥作用.
0xF1变为0x10
0xFF变为0xF0
等...
有人能指出我正确的方向吗?
有一个KSPA的自定义实现需要重写.当前实现使用修改的Dijkstra算法,其伪代码在下面粗略地解释.它通常被称为KSPA使用边缘删除策略我认为如此.(我是图论的新手).
Step:-1. Calculate the shortest path between any given pair of nodes using the Dijkstra algorithm. k = 0 here.
Step:-2. Set k = 1
Step:-3. Extract all the edges from all the ‘k-1’ shortest path trees. Add the same to a linked list Edge_List.
Step:-4. Create a combination of ‘k’ edges from Edge_List to be deleted at once such that each edge belongs to a different SPT (Shortest Path Tree). This can be done by inspecting the ‘k’ value …Run Code Online (Sandbox Code Playgroud) 我有一个脚本系统的make文件,有很多测试应该通过.每个测试都是对脚本应用程序的单独调用:
#----------------------------------------------------------------------------
# run test scripts in the module::test
#----------------------------------------------------------------------------
scripted_tests: bin/kin modules/test/actor_equality.kin modules/test/actor_fibre.kin ...
bin/kin modules/test/actor_equality.kin
bin/kin modules/test/actor_fibre.kin
...
Run Code Online (Sandbox Code Playgroud)
哪个好.我也有一些类似的测试应该返回失败.我知道-会忽略返回状态,但必须有一些简单的东西来反转返回状态,这样我才能运行
#----------------------------------------------------------------------------
# run test scripts in the module::test::errors
#----------------------------------------------------------------------------
inverse_tests: bin/kin modules/test/error/bad_function.kin ...
not bin/kin modules/test/error/bad_function.kin
...
Run Code Online (Sandbox Code Playgroud) algorithm ×6
math ×3
c++ ×2
tree ×2
boost ×1
boost-asio ×1
c ×1
compression ×1
exponent ×1
gnu-make ×1
gpgpu ×1
gpu ×1
graph ×1
graph-theory ×1
makefile ×1
precision ×1
prefuse ×1
queue ×1
silverlight ×1